-
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(color): Add on-surface and surface to theme. #2556
Merged
Merged
Changes from 17 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
2b6c37f
feat(theme): Add new mdc-theme-on-primary global variable
lynnmercier b67d378
add the feature of picking black/white text for on-primary if the use…
lynnmercier 663bf91
fix theme demo page, update README
lynnmercier 6a0c403
feat(theme): Update for comments
williamernest a54bea7
Merge branch 'master' into feat/on-primary
williamernest addd657
WIP: Add surface and on-surface colors. Update cards/chips
williamernest f8826a7
feat(theme): Revert change to chips demo
williamernest 5b65caf
feat(theme): revert changes to other components that are not card or …
williamernest 531eeaa
Merge branch 'master' into feat/on-primary
williamernest 0704448
WIP: MErge with master
williamernest 9dd3307
feat(theme): Update theme class generator to apply background-color t…
williamernest b76ea41
Merge branch 'feat/on-primary' into feat/color/on-surface
williamernest e62be16
Merge branch 'master' into feat/on-primary
williamernest 38e155e
feat(theme): Update for comments
williamernest 08a752f
feat(theme): Update for comments
williamernest 460f9cb
Merge master
williamernest 19d5a89
Merge branch 'feat/on-primary' into feat/color/on-surface
williamernest 1aac4d4
feat(theme): Update for comments:
williamernest dfda05b
feat(theme): Update for comments.
williamernest f60d563
feat(theme): Add import statement
williamernest File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,16 +14,18 @@ | |
// limitations under the License. | ||
// | ||
|
||
@import "@material/theme/variables"; | ||
|
||
$mdc-chip-border-radius-default: 16px; | ||
$mdc-chip-fill-color-default: rgba(black, .08); | ||
$mdc-chip-ink-color-default: rgba(black, .6); | ||
$mdc-chip-fill-color-default: rgba(mdc-theme-prop-value(on-surface), .12); | ||
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. These should all use the |
||
$mdc-chip-ink-color-default: rgba(mdc-theme-prop-value(on-surface), .87); | ||
$mdc-chip-horizontal-padding: 12px; | ||
$mdc-chip-vertical-padding: 7px; | ||
|
||
$mdc-chip-icon-color: rgba(black, .54); | ||
$mdc-chip-icon-color: rgba(mdc-theme-prop-value(on-surface), .54); | ||
$mdc-chip-trailing-icon-size: 18px; | ||
$mdc-chip-trailing-icon-hover-color: rgba(black, .62); | ||
$mdc-chip-trailing-icon-focus-color: rgba(black, .87); | ||
$mdc-chip-trailing-icon-hover-color: rgba(mdc-theme-prop-value(on-surface), .62); | ||
$mdc-chip-trailing-icon-focus-color: rgba(mdc-theme-prop-value(on-surface), .87); | ||
|
||
$mdc-chip-checkmark-animation-delay: 50ms; | ||
$mdc-chip-checkmark-animation-duration: 150ms; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,9 @@ $mdc-theme-secondary: $mdc-theme-accent !default; | |
$mdc-theme-on-secondary: if(mdc-theme-contrast-tone($mdc-theme-secondary) == "dark", #000, #fff) !default; | ||
$mdc-theme-background: #fff !default; // White | ||
|
||
$mdc-theme-surface: white !default; | ||
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. Nit: change to #fff since we changed all the others to #fff |
||
$mdc-theme-on-surface: if(mdc-theme-contrast-tone($mdc-theme-surface) == "dark", #000, #fff) !default; | ||
|
||
// | ||
// Text colors according to light vs dark and text type. | ||
// | ||
|
@@ -70,8 +73,11 @@ $mdc-theme-property-values: ( | |
secondary: $mdc-theme-secondary, | ||
/* Background */ | ||
background: $mdc-theme-background, | ||
/* Surface */ | ||
surface: $mdc-theme-surface, | ||
on-primary: $mdc-theme-on-primary, | ||
on-secondary: $mdc-theme-on-secondary, | ||
on-surface: $mdc-theme-on-surface, | ||
// Text-primary on "background" background | ||
text-primary-on-background: mdc-theme-ink-color-for-fill_(primary, $mdc-theme-background), | ||
text-secondary-on-background: mdc-theme-ink-color-for-fill_(secondary, $mdc-theme-background), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Can we update the variable instead of replacing it here? (IIRC I added that variable for reuse with shape, at least in demos, but potentially of use to users for similar purposes as well)
Also FYI this results in changing from
#dbdbdb
to#e0e0e0