-
Notifications
You must be signed in to change notification settings - Fork 406
Replace hardcoded SCSS color values with CSS custom properties #14085
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
base: master
Are you sure you want to change the base?
Changes from all commits
aaf66b6
cc53f21
90a07ff
caf6fd1
0c117a2
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 |
|---|---|---|
|
|
@@ -14,12 +14,12 @@ | |
| &, | ||
| &:link, | ||
| &:visited { | ||
| color: $black; | ||
| color: var(--amo-input-text); | ||
|
Member
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. Not the right choice - It's not a text input/form widget |
||
| } | ||
|
|
||
| &:active, | ||
| &:hover { | ||
| color: $link-color; | ||
| color: var(--amo-link-color); | ||
| } | ||
| } | ||
| } | ||
|
|
@@ -38,7 +38,7 @@ | |
| .AddonReviewManager-savedRating { | ||
| @include margin-start(6px); | ||
|
|
||
| color: $grey-50; | ||
| color: var(--amo-text-muted); | ||
| flex-grow: 1; | ||
| opacity: 1; | ||
| text-align: right; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,7 +49,7 @@ | |
|
|
||
| a, | ||
| a:link { | ||
| color: $link-color; | ||
| color: var(--amo-link-color); | ||
| text-decoration: none; | ||
| } | ||
|
|
||
|
|
@@ -62,7 +62,7 @@ | |
|
|
||
| a, | ||
| a:link { | ||
| color: $black; | ||
| color: var(--amo-input-text); | ||
|
Member
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. Not the right choice - It's not a text input/form widget |
||
| font-size: $font-size-l; | ||
| text-decoration: underline; | ||
| } | ||
|
|
@@ -76,7 +76,7 @@ | |
| } | ||
|
|
||
| .AddonSummaryCard-addonAverage { | ||
| color: $grey-50; | ||
| color: var(--amo-text-muted); | ||
| margin-top: 6px; | ||
| text-align: center; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,7 @@ | |
|
|
||
| html, | ||
| body { | ||
| background: $header-base-color; | ||
| background: var(--amo-bg-body); | ||
| height: 100%; | ||
| } | ||
|
|
||
|
|
@@ -17,11 +17,11 @@ textarea { | |
| // Fix search input and possibly other inputs. | ||
| // See https://github.com/mozilla/addons-frontend/issues/3640 | ||
|
|
||
| background: $white; | ||
| border: 1px solid $grey-50; | ||
| background: var(--amo-bg-input); | ||
| border: 1px solid var(--amo-border-color); | ||
|
Member
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. Subtle change |
||
| border-radius: $border-radius-xs; | ||
| box-shadow: none; | ||
| color: $black; | ||
| color: var(--amo-input-text); | ||
| font-size: $font-size-default; | ||
| padding: 4px; | ||
| } | ||
|
|
@@ -42,7 +42,7 @@ textarea { | |
| body { | ||
| @include font-regular; | ||
|
|
||
| color: $body-font-color; | ||
| color: var(--amo-text-body); | ||
| font-size: $font-size-default; | ||
| line-height: $line-height-body; | ||
| } | ||
|
|
@@ -55,7 +55,7 @@ h1, | |
| h2 { | ||
| @include font-bold; | ||
|
|
||
| color: $primary-font-color; | ||
| color: var(--amo-text-primary); | ||
| font-weight: 600; | ||
| line-height: $line-height-compressed; | ||
| } | ||
|
|
@@ -78,7 +78,7 @@ h3 { | |
| a:link { | ||
| @include font-medium; | ||
|
|
||
| color: $link-color; | ||
| color: var(--amo-link-color); | ||
| } | ||
|
|
||
| em { | ||
|
|
@@ -90,12 +90,12 @@ strong { | |
| } | ||
|
|
||
| .caption { | ||
| color: $primary-font-color; | ||
| color: var(--amo-text-primary); | ||
| font-size: $font-size-xs; | ||
| } | ||
|
|
||
| .date-time { | ||
| color: #b1b1b1; | ||
| color: var(--amo-text-date); | ||
|
Member
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 don't think it's worth having its own variable. Let's use |
||
| font-size: $font-size-default; | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,24 +9,24 @@ | |
| @include padding-start(28px); | ||
|
|
||
| // This prevents a flicker of black when focusing on mobile. | ||
| background-color: $white; | ||
| border: 1px solid $white; | ||
| background-color: var(--amo-bg-input); | ||
| border: 1px solid var(--amo-border-color); | ||
|
Comment on lines
+12
to
+13
Member
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. Significant changes, need a more careful look to see if that impacts anything (see existing comment in the CSS a couple lines above) |
||
| border-radius: $border-radius-s; | ||
| color: $black; | ||
| color: var(--amo-input-text); | ||
| height: 27px; | ||
| outline: 0; | ||
| text-overflow: ellipsis; | ||
| white-space: nowrap; | ||
| width: 100%; | ||
|
|
||
| &:hover { | ||
| border-color: $teal-50; | ||
| border-color: var(--amo-focus-border); | ||
| } | ||
|
|
||
| &:focus { | ||
| @include focus; | ||
|
|
||
| border-color: $teal-50; | ||
| border-color: var(--amo-focus-border); | ||
| } | ||
|
|
||
| @include respond-to(medium) { | ||
|
|
@@ -42,11 +42,11 @@ | |
| .AutoSearchInput-suggestions-list { | ||
| @include end(0); | ||
|
|
||
| background-color: $white; | ||
| background-color: var(--amo-bg-content); | ||
| border-bottom-left-radius: $border-radius-s; | ||
| border-bottom-right-radius: $border-radius-s; | ||
| box-shadow: 1px 4px 3px transparentize($black, 0.5); | ||
| color: $black; | ||
| color: var(--amo-input-text); | ||
| margin: 0; | ||
| padding: 0; | ||
| position: absolute; | ||
|
|
@@ -66,7 +66,7 @@ | |
| .AutoSearchInput-suggestions-item:active, | ||
| .AutoSearchInput-suggestions-item:focus, | ||
| .AutoSearchInput-suggestions-item--highlighted { | ||
| color: $link-color; | ||
| color: var(--amo-link-color); | ||
| white-space: normal; | ||
|
|
||
| .SearchSuggestion-icon-arrow { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,9 +6,9 @@ $badge-size-small: 12px; | |
| .Badge { | ||
| align-items: center; | ||
| border-radius: 22px; | ||
| border: 1px solid $color-light-gray-40; | ||
| border: 1px solid var(--amo-border-color); | ||
| box-sizing: border-box; | ||
| color: $grey-90; | ||
| color: var(--amo-text-dark); | ||
| display: inline-flex; | ||
| font-size: $font-size-default; | ||
| gap: 6px; | ||
|
|
@@ -20,13 +20,13 @@ $badge-size-small: 12px; | |
| &:hover, | ||
| &:active, | ||
| &:focus { | ||
| border-color: $color-light-gray-90; | ||
| border-color: var(--amo-border-color); | ||
| } | ||
| } | ||
|
|
||
| .Badge-link { | ||
| align-items: center; | ||
| color: $color-dark-gray-05; | ||
| color: var(--amo-text-dark); | ||
|
Member
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. Significant change here and above, but I think for the better. |
||
| display: flex; | ||
| flex-grow: 0; | ||
| flex-shrink: 0; | ||
|
|
||
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.
Note: here and in other places where
$blue-50is replaced byvar(--amo-link-color), this is a slight departure from the previous style, since--amo-link-coloris$link-color, which is$blue-60.It's not necessarily a bad thing (fewer colors to worry about is probably a good thing), but worth double-checking in case that has undesirable effects with regards to contrast etc.