-
Notifications
You must be signed in to change notification settings - Fork 1.7k
MDC Migration: Globally restyle mat-icon-button
#6608
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
5e7b135
e0bace3
12c46a1
6543aca
d839bba
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,6 +61,10 @@ $metrics-min-card-height: 320px; | |
@mixin metrics-card-controls { | ||
@include tb-theme-foreground-prop(color, secondary-text); | ||
white-space: nowrap; | ||
|
||
::ng-deep button[mat-icon-button] { | ||
font-size: 16px; | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Somewhere in the metrics code we (unsuccessfully) try to override the height of the pin icon to 18px (I see it in the css browser but it doesn't get applied). Can you remove that as part of this change? I think it looks perfectly fine at 24px x 24px. The reason it might look odd to someone is because the two icons directly surrounding it are a bit squat - but that's not really the pin icon's problem. |
||
} | ||
|
||
@mixin metrics-empty-message { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -291,6 +291,33 @@ $tb-dark-theme: map_merge( | |
} | ||
} | ||
|
||
body, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To summarize various comments below:
|
||
body.dark-mode { | ||
button[mat-icon-button].mat-mdc-icon-button { | ||
rileyajones marked this conversation as resolved.
Show resolved
Hide resolved
|
||
width: unset; | ||
rileyajones marked this conversation as resolved.
Show resolved
Hide resolved
|
||
height: unset; | ||
display: inline-flex; | ||
justify-content: center; | ||
align-items: center; | ||
flex-wrap: wrap; | ||
rileyajones marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
.mat-mdc-button-touch-target { | ||
height: 100%; | ||
width: 100%; | ||
} | ||
|
||
mat-icon.mat-icon { | ||
min-width: 1em; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think what you're really looking for is: flex-shrink: 0; There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You're right, that is cleaner |
||
} | ||
|
||
mat-icon.mat-icon, | ||
svg { | ||
width: 1em; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I understand correctly, the affect of setting width and height to "1em" is that we can now control svg size by using "font-size" property? That's interesting but I also think it's counter intuitive and probably the wrong path to go down. Consider:
We really should just put: If there is a component that wants to specify a smaller icon (say, for example, the icons in the runs table) then they can just also specify their overrides in terms of pixels. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How do you feel about meeting in the middle with a css variable? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, a css variable seems like a reasonable idea. I don't have a lot of experience with them - is there a way to document the variable in a way that is discoverable and understandable by those who actually need to use it? |
||
height: 1em; | ||
} | ||
} | ||
} | ||
|
||
// Cannot use `tb-dark-theme` as :host-context in the global stylesheet is | ||
// meaningless. | ||
body.dark-mode { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,16 +40,6 @@ $_icon_size: 12px; | |
} | ||
} | ||
|
||
.sorting-icon-container, | ||
.context-menu-container { | ||
width: $_icon_size + 4px; | ||
height: $_icon_size + 4px; | ||
border-radius: 5px; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
} | ||
|
||
.cell { | ||
align-items: center; | ||
display: flex; | ||
|
@@ -60,6 +50,18 @@ $_icon_size: 12px; | |
line-height: 1; | ||
} | ||
|
||
button.sorting-icon-container, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
button.context-menu-container { | ||
width: $_icon_size + 4px; | ||
height: $_icon_size + 4px; | ||
border-radius: 5px; | ||
display: flex; | ||
rileyajones marked this conversation as resolved.
Show resolved
Hide resolved
|
||
justify-content: center; | ||
align-items: center; | ||
font-size: 12px; | ||
padding: 4px; | ||
} | ||
|
||
.sorting-icon-container { | ||
::ng-deep path { | ||
fill: unset; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is unnecessary with my other suggestions. I think the 24px x 24px default is perfectly fine here.