-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
feat(select): Move colors for default select to mixins #1934
Changes from 3 commits
741870c
27b4aa8
cb5b822
06fddb4
219c2fa
68bd036
8b92157
0b1296d
2ead80b
8dc389d
34be534
f7fc139
6bda358
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 |
---|---|---|
|
@@ -276,16 +276,14 @@ these mixins within CSS selectors like `.foo-select` to apply styling. | |
|
||
Mixin | Description | ||
--- | --- | ||
`mdc-select-ink-color($color)` | Customizes the text entered into the select.* | ||
`mdc-select-fill-color($color)` | Customizes the background color of the select. | ||
`mdc-select-ink-color($color)` | Customizes the text entered into the select. This style applies only to the css version. | ||
`mdc-select-container-fill-color($color)` | Customizes the background color of the select. | ||
`mdc-select-label-color($color)` | Customizes the label color of the select in the unfocused state. | ||
`mdc-select-focused-label-color($color, $opacity: 0.87)` | Customizes the label color of the select when focused. Changing opacity for the label when floating is optional. | ||
`mdc-select-bottom-line-color($color)` | Customizes the color of the default bottom line of the select. | ||
`mdc-select-focused-bottom-line-color($color)` | Customizes the color of the bottom line of the select when focused. | ||
`mdc-select-selected-text-color($color)` | Customizes the color of the option that has been selected. | ||
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. Can you attach a screenshot of what you are coloring here? I cant figure out what this is. 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. 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. Try and combine this with mdc-select-ink-color. And mdc-select-ink-color is the better name. |
||
|
||
>_NOTE_: * - This style applies to the css only version. | ||
|
||
### MDC Select Component API | ||
|
||
The MDC Select component API is modeled after a subset of the `HTMLSelectElement` functionality, and | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,14 +17,14 @@ | |
// Public | ||
|
||
@mixin mdc-select-ink-color($color) { | ||
:not(.mdc-select--disabled) { | ||
&:not(.mdc-select--disabled) { | ||
@include mdc-select-ink-color_($color); | ||
} | ||
} | ||
|
||
@mixin mdc-select-fill-color($color) { | ||
:not(.mdc-select--disabled) { | ||
@include mdc-select-fill-color_($color); | ||
@mixin mdc-select-container-fill-color($color) { | ||
&:not(.mdc-select--disabled) { | ||
@include mdc-select-container-fill-color_($color); | ||
} | ||
} | ||
|
||
|
@@ -58,6 +58,14 @@ | |
} | ||
} | ||
|
||
@mixin mdc-select-focused-bottom-line { | ||
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 should make this private |
||
// JS-enhanced and CSS-only Selects require different selectors for focused bottom-line due to different DOM structure | ||
.mdc-select__surface:focus .mdc-select__bottom-line, | ||
.mdc-select__surface:focus ~ .mdc-select__bottom-line { | ||
@content; | ||
} | ||
} | ||
|
||
// Private | ||
|
||
@mixin mdc-select-ink-color_($color) { | ||
|
@@ -66,7 +74,7 @@ | |
} | ||
} | ||
|
||
@mixin mdc-select-fill-color_($color) { | ||
@mixin mdc-select-container-fill-color_($color) { | ||
.mdc-select__surface { | ||
@include mdc-theme-prop(background-color, $color); | ||
} | ||
|
@@ -98,12 +106,11 @@ | |
} | ||
|
||
@mixin mdc-select-focused-bottom-line-color_($color) { | ||
.mdc-select__surface:focus .mdc-select__bottom-line, | ||
.mdc-select__surface:focus ~ .mdc-select__bottom-line { | ||
@include mdc-select-focused-bottom-line { | ||
@include mdc-theme-prop(background-color, $color); | ||
} | ||
|
||
.mdc-select--open .mdc-select__bottom-line { | ||
&.mdc-select--open .mdc-select__bottom-line { | ||
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. why do you need this CSS selector? why is mdc-select-focused-bottom-line not enough? 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.
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. ahh...okay add a comment above this CSS selector |
||
@include mdc-theme-prop(background-color, $color); | ||
} | ||
} | ||
|
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.
Add that this only covers the JS only version....otherwise label-color is covered by ink-color for CSS only