Skip to content
This repository was archived by the owner on Feb 29, 2020. It is now read-only.

Fix Bug 1453479 - more dark theme updates#4087

Merged
rlr merged 1 commit intomozilla:masterfrom
rlr:Bug1453479/dark-theme-updates
Apr 13, 2018
Merged

Fix Bug 1453479 - more dark theme updates#4087
rlr merged 1 commit intomozilla:masterfrom
rlr:Bug1453479/dark-theme-updates

Conversation

@rlr
Copy link
Copy Markdown
Contributor

@rlr rlr commented Apr 12, 2018

No description provided.

@rlr
Copy link
Copy Markdown
Contributor Author

rlr commented Apr 12, 2018

I have a few outstanding questions to Amy still. But maybe getting more eyeballs on this will create more? @Mardak

screen shot 2018-04-11 at 11 33 26 pm

screen shot 2018-04-12 at 8 14 57 am

screen shot 2018-04-12 at 8 20 47 am

screen shot 2018-04-12 at 8 18 54 am

screen shot 2018-04-12 at 8 17 21 am

height: $search-height;
// The extra 1px is to account for the box-shadow being outside of the element
// instead of inside. It needs to be like that to not overlap the inner background
// color of the hover state of the submit button.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to reproduce this code comment but I couldnt see a difference? So I removed the horizontal margin so the dropdown is the right width.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm.. @k88hudson added that comment in #3785.. Doesn't look like either 1px need to be around anymore?

@rlr rlr force-pushed the Bug1453479/dark-theme-updates branch from 7ca9af4 to e60dd22 Compare April 12, 2018 14:57
@rlr rlr requested a review from Mardak April 12, 2018 15:15
@rlr
Copy link
Copy Markdown
Contributor Author

rlr commented Apr 12, 2018

@Mardak ok, I think this is ready for 👁 👁 . Hopefully the last "major" round of changes for now 😝 #tedious

@rlr rlr force-pushed the Bug1453479/dark-theme-updates branch from 8a593ac to 2ae1230 Compare April 12, 2018 16:17
--newtab-textbox-border: $grey-90-20;
--newtab-textbox-color: inherit;
--newtab-textbox-focus-color: $blue-60;
--newtab-textbox-focus-boxshadow: 0 0 0 1px $blue-60, 0 0 0 4px rgba($blue-60, 0.3); // sass-lint:disable-line no-color-literals
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like this but... is there a cleaner solution?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you referring to the duplicate stuff between default and dark? Maybe something like:

diff --git a/system-addon/content-src/styles/_theme.scss b/system-addon/content-src/styles/_theme.scss
index eb04f699..97bccdcc 100644
--- a/system-addon/content-src/styles/_theme.scss
+++ b/system-addon/content-src/styles/_theme.scss
@@ -1 +1,6 @@
+@mixin textbox-focus($color) {
+  --newtab-textbox-focus-color: $color;
+  --newtab-textbox-focus-boxshadow: 0 0 0 1px $color, 0 0 0 4px rgba($color, 0.3); // sass-lint:disable-line no-color-literals
+}
+
 // Default theme
@@ -21,4 +26,3 @@ body {
   --newtab-textbox-border: $grey-90-20;
-  --newtab-textbox-focus-color: $blue-60;
-  --newtab-textbox-focus-boxshadow: 0 0 0 1px $blue-60, 0 0 0 4px rgba($blue-60, 0.3); // sass-lint:disable-line no-color-literals
+  @include textbox-focus($blue-60);
 
@@ -74,4 +78,3 @@ body {
   --newtab-textbox-border: $grey-10-20;
-  --newtab-textbox-focus-color: $blue-40;
-  --newtab-textbox-focus-boxshadow: 0 0 0 1px $blue-40, 0 0 0 4px rgba($blue-40, 0.3); // sass-lint:disable-line no-color-literals
+  @include textbox-focus($blue-40);
 

@rlr
Copy link
Copy Markdown
Contributor Author

rlr commented Apr 12, 2018

Focused search box now looks like this (+ Amy approved):

screen shot 2018-04-12 at 12 12 04 pm

screen shot 2018-04-12 at 12 12 20 pm

--newtab-textbox-border: $grey-90-20;
--newtab-textbox-color: inherit;
--newtab-textbox-focus-color: $blue-60;
--newtab-textbox-focus-boxshadow: 0 0 0 1px $blue-60, 0 0 0 4px rgba($blue-60, 0.3); // sass-lint:disable-line no-color-literals
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you referring to the duplicate stuff between default and dark? Maybe something like:

diff --git a/system-addon/content-src/styles/_theme.scss b/system-addon/content-src/styles/_theme.scss
index eb04f699..97bccdcc 100644
--- a/system-addon/content-src/styles/_theme.scss
+++ b/system-addon/content-src/styles/_theme.scss
@@ -1 +1,6 @@
+@mixin textbox-focus($color) {
+  --newtab-textbox-focus-color: $color;
+  --newtab-textbox-focus-boxshadow: 0 0 0 1px $color, 0 0 0 4px rgba($color, 0.3); // sass-lint:disable-line no-color-literals
+}
+
 // Default theme
@@ -21,4 +26,3 @@ body {
   --newtab-textbox-border: $grey-90-20;
-  --newtab-textbox-focus-color: $blue-60;
-  --newtab-textbox-focus-boxshadow: 0 0 0 1px $blue-60, 0 0 0 4px rgba($blue-60, 0.3); // sass-lint:disable-line no-color-literals
+  @include textbox-focus($blue-60);
 
@@ -74,4 +78,3 @@ body {
   --newtab-textbox-border: $grey-10-20;
-  --newtab-textbox-focus-color: $blue-40;
-  --newtab-textbox-focus-boxshadow: 0 0 0 1px $blue-40, 0 0 0 4px rgba($blue-40, 0.3); // sass-lint:disable-line no-color-literals
+  @include textbox-focus($blue-40);
 


&.active {
background: var(--newtab-element-active-color);
background: var(--newtab-element-hover-color);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Somewhat confusing that .active uses -hover-color.. oh well

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can rename the css class to 🤔 something.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eh, we can just leave it :p

height: $search-height;
// The extra 1px is to account for the box-shadow being outside of the element
// instead of inside. It needs to be like that to not overlap the inner background
// color of the hover state of the submit button.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm.. @k88hudson added that comment in #3785.. Doesn't look like either 1px need to be around anymore?

$input-error-border: solid 1px $red-60;
$input-error-boxshadow: 0 0 0 1px $red-60, 0 0 0 4px rgba($red-60, 0.3);
$input-focus-boxshadow: 0 0 0 1px $blue-50, 0 0 0 4px rgba($blue-50, 0.3);
$input-focus-boxshadow: var(--newtab-textbox-focus-boxshadow);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's just the var, probably just directly use var(--newtab-textbox-focus-boxshadow) and var(--newtab-card-shadow) without the sass variable. Functions wouldn't really be able to do stuff with the value anyway.

$os-infopanel-arrow-height: 10px;
$os-infopanel-arrow-offset-end: 6px;
$os-infopanel-arrow-width: 20px;
$os-search-focus-shadow-radius: 1px;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this removal actually desired? It regresses #3745 which said to have 1px for windows.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I asked Amy explicitly about it. I'll double confirm.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the UX powers say we can get rid of the windows specific special case 🎉

--newtab-button-primary-color: $blue-60;
--newtab-button-secondary-color: inherit;
--newtab-element-active-color: $grey-20;
--newtab-element-hover-color: $grey-20;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be no differentiation from hover and clicking on a context menu item for default theme?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh right, it needs to get darker. 👍

Copy link
Copy Markdown
Member

@Mardak Mardak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a bit more cleanup! Thanks

$shadow-primary: 0 0 0 5px var(--newtab-card-active-outline-color);
$shadow-secondary: 0 1px 4px 0 $grey-90-10;
$shadow-secondary: 0 1px 4px 0 $grey-90-20;
$shadow-card: var(--newtab-card-shadow);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sass variable can go too

// instead of inside. It needs to be like that to not overlap the inner background
// color of the hover state of the submit button.
margin: 1px 1px $section-spacing;
margin: 1px 0 $section-spacing;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

k88 says if it looks right, then good to go, and from my testing, it seems fine with margin-bottom: $section-spacing;

@rlr
Copy link
Copy Markdown
Contributor Author

rlr commented Apr 13, 2018

^ I also added :active state for the prefs gear icon

@rlr rlr force-pushed the Bug1453479/dark-theme-updates branch from e03ee52 to 180d534 Compare April 13, 2018 20:05
@rlr rlr merged commit 030284a into mozilla:master Apr 13, 2018
$input-border-active: solid 1px var(--newtab-textbox-focus-color);
$input-error-border: solid 1px $red-60;
$input-error-boxshadow: 0 0 0 1px $red-60, 0 0 0 4px rgba($red-60, 0.3);
$input-focus-boxshadow: 0 0 0 1px $blue-50, 0 0 0 4px rgba($blue-50, 0.3);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I forgot to note that I think sass allows a custom function where we can pass in a $red-60 or $blue-40/60/$color to generate the 0 0 0 1px $color, 0 0 0 4px rgba($color, 0.3) value.. maybe.......... ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works! And even avoids the disable-line ;)

diff --git a/system-addon/content-src/styles/_theme.scss b/system-addon/content-src/styles/_theme.scss
--- a/system-addon/content-src/styles/_theme.scss
+++ b/system-addon/content-src/styles/_theme.scss
@@ -1,4 +1,8 @@
+@function textbox-shadow($color) {
+  @return 0 0 0 1px $color, 0 0 0 4px rgba($color, 0.3);
+}
+
 @mixin textbox-focus($color) {
   --newtab-textbox-focus-color: $color;
-  --newtab-textbox-focus-boxshadow: 0 0 0 1px $color, 0 0 0 4px rgba($color, 0.3); // sass-lint:disable-line no-color-literals
+  --newtab-textbox-focus-boxshadow: textbox-shadow($color);
 }
@@ -118,3 +122,3 @@ $input-border-active: solid 1px var(--newtab-textbox-focus-color);
 $input-error-border: solid 1px $red-60;
-$input-error-boxshadow: 0 0 0 1px $red-60, 0 0 0 4px rgba($red-60, 0.3);
+$input-error-boxshadow: textbox-shadow($red-60);
 $inner-box-shadow: 0 0 0 1px var(--newtab-inner-box-shadow-color);

@rlr rlr deleted the Bug1453479/dark-theme-updates branch April 13, 2018 22:13
@as-pine-proxy
Copy link
Copy Markdown
Collaborator

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants