Fix Bug 1402312 - Implement dark theme #4044
Conversation
| } | ||
|
|
||
| // Jump through some hoops to check if the current theme has light or dark | ||
| // text. If light, then we enable our dark (background) theme. |
rlr
Mar 19, 2018
Author
Contributor
NOTE: inspiration for this comes from https://searchfox.org/mozilla-central/source/toolkit/modules/LightweightThemeConsumer.jsm#108-112
NOTE: inspiration for this comes from https://searchfox.org/mozilla-central/source/toolkit/modules/LightweightThemeConsumer.jsm#108-112
|
|
||
| const THEME_UPDATE_EVENT = "lightweight-theme-styling-update"; | ||
|
|
||
| this.ThemeFeed = class ThemeFeed { |
rlr
Mar 19, 2018
Author
Contributor
This feed will be obsolete or need to change once https://bugzilla.mozilla.org/show_bug.cgi?id=1444459 is implemented and lands.
This feed will be obsolete or need to change once https://bugzilla.mozilla.org/show_bug.cgi?id=1444459 is implemented and lands.
| updateTheme(data) { | ||
| if (data && data.window) { | ||
| // We only update newtab theme if the theme activated isn't window specific. | ||
| // We'll be able to do better in the future: see Bug 1444459 |
rlr
Mar 19, 2018
Author
Contributor
Fun fact, different windows can be assigned different themes via web extensions, for example. Also private browsing. Out of scope for now :)
Fun fact, different windows can be assigned different themes via web extensions, for example. Also private browsing. Out of scope for now :)
90f145b
to
1feae14
|
Does anybody have some time to look at this today or early next week? @sarracini @Mardak @k88hudson @piatra ? Please |
|
Looking! |
| --newtab-contextmenu-button-color: $white; | ||
| --newtab-modal-color: $white; | ||
| --newtab-overlay-color: $grey-20; | ||
| --newtab-searchbox-color: $grey-10; |
Mardak
Mar 23, 2018
Member
nit: --newtab-searchbox-background-color as there's a bunch of colors ;)
Also, could you make this $white here to fix https://bugzilla.mozilla.org/show_bug.cgi?id=1447752 :)
nit: --newtab-searchbox-background-color as there's a bunch of colors ;)
Also, could you make this $white here to fix https://bugzilla.mozilla.org/show_bug.cgi?id=1447752 :)
|
|
||
| &:active { | ||
| background-color: $background-primary; | ||
| background-color: $grey-20; |
Mardak
Mar 23, 2018
Member
This should be grey-20 when clicking always?
This should be grey-20 when clicking always?
rlr
Mar 23, 2018
Author
Contributor
This is the hover on the prefs gear icon. For overall consistency, this should probably match --newtab-section-active-color so I should rename that.
This is the hover on the prefs gear icon. For overall consistency, this should probably match --newtab-section-active-color so I should rename that.
| --newtab-section-active-contextmenu-color: $white; | ||
| --newtab-topsites-label-color: $grey-10-80; | ||
| --newtab-card-background-color: $grey-90; | ||
| --newtab-inner-box-shadow-color: $grey-60; |
Mardak
Mar 23, 2018
Member
I'm still looking through this, but are there any conceptually related uses of a color that are used for more than one variable? I don't think I spotted any yet, but for example if --newtab-text-primary-color and --newtab-textbox-color were the same, there could be a local scss $var to share the two. But then, why would we have two different css --var? (I suppose the css var could exist if say dark shared a color but light had different colors -- but then again, why are they not consistent between the two themes?)
I'm still looking through this, but are there any conceptually related uses of a color that are used for more than one variable? I don't think I spotted any yet, but for example if --newtab-text-primary-color and --newtab-textbox-color were the same, there could be a local scss $var to share the two. But then, why would we have two different css --var? (I suppose the css var could exist if say dark shared a color but light had different colors -- but then again, why are they not consistent between the two themes?)
|
Could you generally describe your overall process of converting? E.g., the scss $alias over to css --var? |
|
Basically, I went through every color spec'd out in the dark theme spec that needed to be changed and started breaking them out into variables. And then I tried to consolidate into as few variables as possible in some cases I had to get UX (Amy) to nod some changes/compromises to save a variable and keep more generic. But it's possible we can reduce it more? See https://mozilla.invisionapp.com/share/H4FW3RYFXVK#/screens/279681634_New_Tab_Dark_Theme_Spec and: |
|
Afterwards, I wondered if I should've kept all the scss |
|
Also, there are cases that two variables are the same in the default theme but different in the dark theme, and vice-versa. |
| --newtab-button-secondary-color: inherit; | ||
| --newtab-contextmenu-button-color: $white; | ||
| --newtab-modal-color: $white; | ||
| --newtab-overlay-color: $grey-20; |
rlr
Mar 23, 2018
Author
Contributor
I guess up to here, the variables are pretty generic. And all the ones below are pretty specific to different sections.
I guess up to here, the variables are pretty generic. And all the ones below are pretty specific to different sections.
Mardak
Mar 28, 2018
Member
At least in reviewing, having these variables sorted would have been much easier to track things down. I suppose potentially you could have 2 list of variables separated by a newline with a comment each sorted for more generic vs section specific.
At least in reviewing, having these variables sorted would have been much easier to track things down. I suppose potentially you could have 2 list of variables separated by a newline with a comment each sorted for more generic vs section specific.
| --newtab-inner-box-shadow-color: $grey-60; | ||
| } | ||
|
|
||
| // scss variables related to the theme. |
rlr
Mar 23, 2018
Author
Contributor
I moved these variables below into this file because some depend on the CSS variables defined above. But I guess they can go back to _variables.scss even though that's imported first because the vars don't get evaluated until runtime anyway.
I moved these variables below into this file because some depend on the CSS variables defined above. But I guess they can go back to _variables.scss even though that's imported first because the vars don't get evaluated until runtime anyway.
| $border-secondary: 1px solid var(--newtab-border-secondary-color); | ||
| $input-primary: $blue-60; | ||
| $input-secondary: transparent; | ||
| $shadow-primary: 0 0 0 5px $grey-30; |
Mardak
Mar 23, 2018
Member
I would have expected any shade of black to be different for light vs dark. Default background is $grey-10, so this $grey-30 shadow is 20 degrees away. To maintain the same amount of contrast on the dark theme's $grey-80 background, I would have expected $grey-60 for the shadow:
I would have expected any shade of black to be different for light vs dark. Default background is $grey-10, so this $grey-30 shadow is 20 degrees away. To maintain the same amount of contrast on the dark theme's $grey-80 background, I would have expected $grey-60 for the shadow:
Mardak
Mar 23, 2018
Member
bryan said "Top is better by far" with +1 from aaron
bryan said "Top is better by far" with +1 from aaron
| --newtab-text-secondary-color: $grey-10-40; | ||
| --newtab-text-conditional-color: $grey-10; | ||
| --newtab-link-primary-color: $blue-40; | ||
| --newtab-link-secondary-color: $blue-40; |
Mardak
Mar 24, 2018
Member
The "secondary" link color is currently used for Pocket stuff, and I'm pretty sure it's teal for default theme specifically because Pocket uses teal for its links. Should get design to confirm that it was intentional to make Pocket links not teal anymore. And if so, why keep it teal for default theme?
The "secondary" link color is currently used for Pocket stuff, and I'm pretty sure it's teal for default theme specifically because Pocket uses teal for its links. Should get design to confirm that it was intentional to make Pocket links not teal anymore. And if so, why keep it teal for default theme?
| text-decoration: none; | ||
|
|
||
| &:hover { | ||
| color: $link-secondary; |
Mardak
Mar 24, 2018
Member
Removing the :hover -secondary is right, so we can get rid of this overriding color too:
activity-stream/system-addon/content-src/components/TopSites/_TopSites.scss
Lines 364 to 366
in
837cea5
I seem to recall design wanting links to underline on hover.. but I guess leave it this way for now.
Removing the :hover -secondary is right, so we can get rid of this overriding color too:
activity-stream/system-addon/content-src/components/TopSites/_TopSites.scss
Lines 364 to 366 in 837cea5
I seem to recall design wanting links to underline on hover.. but I guess leave it this way for now.
| @@ -22,12 +21,7 @@ h2 { | |||
| } | |||
|
|
|||
| a { | |||
| color: $link-primary; | |||
Mardak
Mar 24, 2018
Member
Why did this need to move into Base? I suppose technically there could be links under body that aren't under .outer-wrapper but there's other things in this file that are using var()…?
Why did this need to move into Base? I suppose technically there could be links under body that aren't under .outer-wrapper but there's other things in this file that are using var()…?
rlr
Mar 26, 2018
•
Author
Contributor
I moved to .outer-wrapper because that's the first (topmost?) node that we control from react. I can't (cleanly) set classes or css vars to body or anything above .outer-wrapper. A positive side effect of moving the themed stuff to be sandboxed in .outer-wrapper is that this doesn't break snippets styles.
I moved to .outer-wrapper because that's the first (topmost?) node that we control from react. I can't (cleanly) set classes or css vars to body or anything above .outer-wrapper. A positive side effect of moving the themed stuff to be sandboxed in .outer-wrapper is that this doesn't break snippets styles.
Mardak
Mar 26, 2018
Member
I haven't actually used css variables, but looking at m-c usage/declarations, they seem to typically be under a :root { --var: … } selector.
@k88hudson do you have any preference or know of desired usage patterns?
I haven't actually used css variables, but looking at m-c usage/declarations, they seem to typically be under a :root { --var: … } selector.
@k88hudson do you have any preference or know of desired usage patterns?
Mardak
Mar 26, 2018
Member
mconley points out that there is some movement to more appropriately scope css variables for performance reasons, e.g., https://bugzilla.mozilla.org/show_bug.cgi?id=1435122
mconley points out that there is some movement to more appropriately scope css variables for performance reasons, e.g., https://bugzilla.mozilla.org/show_bug.cgi?id=1435122
| @@ -84,7 +78,7 @@ a { | |||
| padding: 15px 25px 0; | |||
|
|
|||
| button { | |||
| background-color: $input-secondary; | |||
| background: var(--newtab-button-secondary-color); | |||
Mardak
Mar 24, 2018
Member
Was there a need to make this background and not more scoped to background-color? It would probably be better consistency / expectation to use background-color wherever we use a var(…color)
Was there a need to make this background and not more scoped to background-color? It would probably be better consistency / expectation to use background-color wherever we use a var(…color)
rlr
Mar 26, 2018
Author
Contributor
no need, just saving bytes 😝 . kind of my personal preference but dont really care either way.
no need, just saving bytes
| @@ -1,5 +1,5 @@ | |||
| .context-menu { | |||
| background: $background-primary; | |||
| background: var(--newtab-background-color); | |||
| border-radius: $context-menu-border-radius; | |||
| box-shadow: $context-menu-shadow; | |||
| @@ -22,9 +21,11 @@ | |||
| width: 100%; | |||
|
|
|||
| input { | |||
| border: 0; | |||
| background: var(--newtab-searchbox-background-color); | |||
| border: solid 1px var(--newtab-searchbox-border-color); | |||
| border-radius: $search-border-radius; | |||
| box-shadow: $shadow-secondary, 0 0 0 1px $black-15; | |||
Mardak
Mar 24, 2018
Member
There's various blacks here that probably need to be themed. E.g., search button hover, etc.
There's various blacks here that probably need to be themed. E.g., search button hover, etc.
| @@ -0,0 +1,80 @@ | |||
| // Default theme | |||
| .outer-wrapper { | |||
Mardak
Mar 24, 2018
Member
We can set :not(.dark-theme) to avoid having both styles apply with the latter overriding for dark theme. Not sure if there's a good way to make sure both lists define the same variables though…
We can set :not(.dark-theme) to avoid having both styles apply with the latter overriding for dark theme. Not sure if there's a good way to make sure both lists define the same variables though…
rlr
Mar 26, 2018
Author
Contributor
is there a performance gain to doing that? or just a little less clutter in dev tools inspector?
is there a performance gain to doing that? or just a little less clutter in dev tools inspector?
Mardak
Mar 26, 2018
Member
I'm not sure actually ;) Yeah I noticed it from devtools style inspector. I would assume it's quite implementation detail specific if it's more "expensive" to track multiple rules that apply and get overridden vs doing a :not selector.
@k88hudson any thoughts here?
I'm not sure actually ;) Yeah I noticed it from devtools style inspector. I would assume it's quite implementation detail specific if it's more "expensive" to track multiple rules that apply and get overridden vs doing a :not selector.
@k88hudson any thoughts here?
Mardak
Mar 26, 2018
Member
John-Galt seems to suggest it probably won't make much of a difference performance-wise. So for developer / QA checking, I think we can stick without :not as the default theme vars will always be set, so if we accidentally forget to set it in .dark, it should be more obvious when a light theme's color shows up incorrectly.
John-Galt seems to suggest it probably won't make much of a difference performance-wise. So for developer / QA checking, I think we can stick without :not as the default theme vars will always be set, so if we accidentally forget to set it in .dark, it should be more obvious when a light theme's color shows up incorrectly.
rlr
Mar 28, 2018
Author
Contributor
A problem with having the variables under .outer-wrapper is that snippets/onboarding won't be able to see them because they live outside of this in the DOM tree. So, we probably wan't to assign them to :root at that point, but then we will need a new way to override them for each theme because we can't set a .dark-theme class to :root can we? I guess we can cross that bridge when we get there. Maybe https://bugzilla.mozilla.org/show_bug.cgi?id=1444459 will be fixed soonish and we can just wait for that.
A problem with having the variables under .outer-wrapper is that snippets/onboarding won't be able to see them because they live outside of this in the DOM tree. So, we probably wan't to assign them to :root at that point, but then we will need a new way to override them for each theme because we can't set a .dark-theme class to :root can we? I guess we can cross that bridge when we get there. Maybe https://bugzilla.mozilla.org/show_bug.cgi?id=1444459 will be fixed soonish and we can just wait for that.
|
I just got off vidyo with @bryanbell @aaronrbenson +Amy. Those were the changes we came up with ^^ 0253625
And they want it in their hands ASAP. I guess we can further tweak it in production^Wnightly if necessary. |
|
@Mardak I was talking about the main browser searchbar (hidden by default), not the one in about:newtab. |
|
Oh, I see. @rlr, activity stream is the only consumer of contentSearchUI now, so most likely we'll need to update it. Or more likely set the appropriate styling for default/dark from our css. |
| @@ -84,3 +85,8 @@ | |||
| transform: translateY(2px); | |||
| } | |||
| } | |||
|
|
|||
| // The search dropdown isn't themed (yet), so we need to keep dark text. | |||
| #searchSuggestionTable { // sass-lint:disable-line no-ids | |||
Mardak
Mar 28, 2018
Member
There's already a .contentSearchSuggestionTable just a few lines higher that we can reuse.
@@ -79,7 +80,25 @@
}
+}
+@at-root {
// Adjust the style of the contentSearchUI-generated table
- .contentSearchSuggestionTable { // sass-lint:disable-line class-name-format
+ // sass-lint:disable-block class-name-format
+ .contentSearchSuggestionTable {
+ background-color: var(--newtab-searchbox-background-color);
border: 0;
- transform: translateY(2px);
+ transform: translateY(3px);
+
+ .contentSearchHeader {
+ background-color: var(--newtab-background-color);
+ color: var(--newtab-text-secondary-color);
+ }
+
+ .contentSearchHeader,
+ .contentSearchSuggestionsList {
+ border-color: var(--newtab-border-primary-color);
+ }
+
+ .contentSearchSearchWithHeaderSearchText {
+ color: var(--newtab-text-primary-color);
+ }
}
There's already a .contentSearchSuggestionTable just a few lines higher that we can reuse.
@@ -79,7 +80,25 @@
}
+}
+@at-root {
// Adjust the style of the contentSearchUI-generated table
- .contentSearchSuggestionTable { // sass-lint:disable-line class-name-format
+ // sass-lint:disable-block class-name-format
+ .contentSearchSuggestionTable {
+ background-color: var(--newtab-searchbox-background-color);
border: 0;
- transform: translateY(2px);
+ transform: translateY(3px);
+
+ .contentSearchHeader {
+ background-color: var(--newtab-background-color);
+ color: var(--newtab-text-secondary-color);
+ }
+
+ .contentSearchHeader,
+ .contentSearchSuggestionsList {
+ border-color: var(--newtab-border-primary-color);
+ }
+
+ .contentSearchSearchWithHeaderSearchText {
+ color: var(--newtab-text-primary-color);
+ }
}
Mardak
Mar 28, 2018
Member
Oh, and I wonder if we should name the --vars as --newtab-search-… (no "box") ?
Oh, and I wonder if we should name the --vars as --newtab-search-… (no "box") ?
Mardak
Mar 28, 2018
Member
(I used @at-root mostly to create a new block for the sass disable.)
(I used @at-root mostly to create a new block for the sass disable.)
rlr
Mar 28, 2018
Author
Contributor
awesome, thanks!. and --newtab-search- sounds good. fixing
awesome, thanks!. and --newtab-search- sounds good. fixing
|
We'll want to style the search table with css vars. Also cleaning up input-primary/secondary scss and css var conflicts/discrepancy. I suppose design wants to try things out sooner, so various questions, e.g., context menu text color matching icons, should be tracked and maybe fixed in a followup? |
| @@ -93,19 +99,17 @@ main { | |||
| background-color: transparent; | |||
| border: 0; | |||
| cursor: pointer; | |||
| fill: $fill-secondary; | |||
| fill: var(--newtab-icon-primary-color); | |||
Mardak
Mar 28, 2018
Member
This changes the color for default theme, but I guess this is fine (going from grey-90-60 to grey-90-80)
This changes the color for default theme, but I guess this is fine (going from grey-90-60 to grey-90-80)
| } | ||
|
|
||
| &:hover, | ||
| &:focus, | ||
| &:active { |
Mardak
Mar 28, 2018
Member
Is it intended to have no differentiation between hovering vs actively clicking the gear? I believe the previous hover was to also help it show up against the sidebar's background, but now we only can open, so probably a reasonable time to change the expected styling.
Is it intended to have no differentiation between hovering vs actively clicking the gear? I believe the previous hover was to also help it show up against the sidebar's background, but now we only can open, so probably a reasonable time to change the expected styling.
rlr
Mar 28, 2018
Author
Contributor
currently, when you click the background goes away. I guess we can keep that behavior. I dont think it really makes a difference either way since it's behavior is more like a link than a button.
currently, when you click the background goes away. I guess we can keep that behavior. I dont think it really makes a difference either way since it's behavior is more like a link than a button.
| --newtab-button-secondary-color: inherit; | ||
| --newtab-contextmenu-button-color: $white; | ||
| --newtab-modal-color: $white; | ||
| --newtab-overlay-color: $grey-20; |
Mardak
Mar 28, 2018
Member
At least in reviewing, having these variables sorted would have been much easier to track things down. I suppose potentially you could have 2 list of variables separated by a newline with a comment each sorted for more generic vs section specific.
At least in reviewing, having these variables sorted would have been much easier to track things down. I suppose potentially you could have 2 list of variables separated by a newline with a comment each sorted for more generic vs section specific.
| @@ -99,13 +93,14 @@ a { | |||
| } | |||
|
|
|||
| &.dismiss { | |||
| background-color: $input-secondary; | |||
Mardak
Mar 28, 2018
Member
Sorry for the earlier comment to switch this away from transparent. After looking more at the whole patch, I think we should just get rid of $input-secondary as it's confusing to also have --newtab-button-secondary-color. Looks like this .dismiss is a special case styling for the manual migration "link" button.
Sorry for the earlier comment to switch this away from transparent. After looking more at the whole patch, I think we should just get rid of $input-secondary as it's confusing to also have --newtab-button-secondary-color. Looks like this .dismiss is a special case styling for the manual migration "link" button.
| @@ -20,7 +20,7 @@ | |||
| width: 100%; | |||
|
|
|||
| &.separator { | |||
| border-bottom: 1px solid $context-menu-border-color; | |||
| border-bottom: 1px solid var(--newtab-border-secondary-color); | |||
Mardak
Mar 28, 2018
Member
This changed from $black-20 (20% opacity) to $grey-30 (no transparency). Looks pretty close, so probably fine.
This border value ends up being just $border-secondary now.
This changed from $black-20 (20% opacity) to $grey-30 (no transparency). Looks pretty close, so probably fine.
This border value ends up being just $border-secondary now.
| this._prefs.set("prerender", PrerenderData.arePrefsValid(pref => this._prefs.get(pref), indexedDBPrefs)); | ||
| const prefsAreValid = PrerenderData.arePrefsValid(pref => this._prefs.get(pref), indexedDBPrefs); | ||
| const themeIsDefault = (theme || this.store.getState().Theme).className === INITIAL_STATE.Theme.className; | ||
| this._prefs.set("prerender", prefsAreValid && themeIsDefault); |
Mardak
Mar 28, 2018
Member
Maybe an alternative to invalidating prerendering or extra prerendering dark theme.. What if we used localStorage or something in the page to add .dark-theme to <body> as the page loads? The storage gets updated when Theme.className arrives so the next load of the page should synchronously render the appropriate background color. Although this would prevent different themes per window…
I guess we'll just keep the invalidation for now…
Maybe an alternative to invalidating prerendering or extra prerendering dark theme.. What if we used localStorage or something in the page to add .dark-theme to <body> as the page loads? The storage gets updated when Theme.className arrives so the next load of the page should synchronously render the appropriate background color. Although this would prevent different themes per window…
I guess we'll just keep the invalidation for now…
| Services.obs.addObserver(this, THEME_UPDATE_EVENT); | ||
|
|
||
| let temp = {LightweightThemeManager}; | ||
| ChromeUtils.import("resource://gre/modules/LightweightThemeManager.jsm", temp); |
Mardak
Mar 28, 2018
Member
This seems odd… I guess for injecting custom LightweightThemeManager for testing? That's what the injector is for? Although in this case, we would just override the global if this was imported normally?
This seems odd… I guess for injecting custom LightweightThemeManager for testing? That's what the injector is for? Although in this case, we would just override the global if this was imported normally?
rlr
Mar 28, 2018
Author
Contributor
I was assuming whoever did this knew what they were doing: https://searchfox.org/mozilla-central/source/toolkit/modules/LightweightThemeConsumer.jsm#29-30
But I could make it global if there is no reason to have done that.
I was assuming whoever did this knew what they were doing: https://searchfox.org/mozilla-central/source/toolkit/modules/LightweightThemeConsumer.jsm#29-30
But I could make it global if there is no reason to have done that.
| beforeEach(() => { | ||
| globals = new GlobalOverrider(); | ||
| sandbox = globals.sandbox; | ||
| ({ThemeFeed, THEME_UPDATE_EVENT} = injector({})); |
Mardak
Mar 28, 2018
Member
If nothing is being injected, why not just import the module normally?
If nothing is being injected, why not just import the module normally?
rlr
Mar 28, 2018
Author
Contributor
In case you asked me to make LightweightThemeManager global? 😉
In case you asked me to make LightweightThemeManager global?
| @@ -1,5 +1,5 @@ | |||
| .context-menu { | |||
| background: $background-primary; | |||
| background: var(--newtab-background-color); | |||
| padding-left: 3px; | ||
| } | ||
|
|
||
| button { | ||
| background: $grey-10; | ||
| background: $input-secondary; |
Mardak
Mar 29, 2018
Member
@rlr looks like this was skipped? The disclaimer's button is now just transparent instead of a var
@rlr looks like this was skipped? The disclaimer's button is now just transparent instead of a var
|
I guess I'll have to fix merge conflicts if this is ready to land before pull #4058 |
| --newtab-search-icon-color: $grey-90-40; | ||
| --newtab-section-header-text-color: $grey-50; | ||
| --newtab-section-navigation-text-color: $grey-50; | ||
| --newtab-section-navigation-link-color: $blue-40; |
rlr
Mar 28, 2018
Author
Contributor
this was missing a dark theme value. but it was actually unused! removing
this was missing a dark theme value. but it was actually unused! removing
|
Snippets/onboarding was out of scope for this I thought. @k88hudson had mentioned something something or the other. |
|
Filed followup bugs for onboarding and snippets: |
| border: 0; | ||
| padding: 0; | ||
| text-decoration: underline; | ||
| } | ||
|
|
||
| &.done { | ||
| background: $input-primary; | ||
| background-color: var(--newtab-button-primary-color); | ||
| border: solid 1px $blue-60; |
Mardak
Mar 28, 2018
Member
not sure why I didn't use $input-primary instead of this $blue-60 for border.. but it should probably just be var(--newtab-button-primary-color) now
not sure why I didn't use $input-primary instead of this $blue-60 for border.. but it should probably just be var(--newtab-button-primary-color) now
|
From the feedback on slack, given that we'll make all dark's blues blue-40 and default's blue-60, should we have a different var name: + --newtab-button-primary-color: $blue-60;
+ --newtab-link-primary-color: $blue-60;
+ --newtab-search-focus-border-color: $blue-50;
+ --newtab-button-primary-color: $blue-60;
+ --newtab-link-primary-color: $blue-40;
+ --newtab-search-focus-border-color: $blue-40; |
|
Although keeping individual css variables allows them to be individually overridden by a theme if desired… |
|
Having one var for all the blues sounds compelling. But yeah maybe they should remain separate because I can't think a name for a variable that combines them. |
|
|
|
I guess we can still get stingier with variables when we start to expose them to theming api. |
| const {initialized} = App; | ||
| const prefs = props.Prefs.values; | ||
|
|
||
| const shouldBeFixedToTop = PrerenderData.arePrefsValid(name => prefs[name]); | ||
|
|
||
| const outerClassName = `outer-wrapper${shouldBeFixedToTop ? " fixed-to-top" : ""} ${prefs.enableWideLayout ? "wide-layout-enabled" : "wide-layout-disabled"}`; | ||
| const outerClassName = `outer-wrapper ${Theme.className}${shouldBeFixedToTop ? " fixed-to-top" : ""} ${prefs.enableWideLayout ? "wide-layout-enabled" : "wide-layout-disabled"}`; |
Mardak
Mar 29, 2018
Member
This ends up causing all the prerendered files to have an extra space:
"outer-wrapper fixed-to-top…"
This ends up causing all the prerendered files to have an extra space:
"outer-wrapper fixed-to-top…"














r? @Mardak / @k88hudson
In action:

Screenshots:
