Closed Bug 1669542 Opened 6 years ago Closed 6 years ago

Unify the .toolbarbutton-1 styling

Categories

(Thunderbird :: Theme, task)

task

Tracking

(thunderbird_esr78 wontfix, thunderbird82 wontfix)

RESOLVED FIXED
83 Branch
Tracking Status
thunderbird_esr78 --- wontfix
thunderbird82 --- wontfix

People

(Reporter: Paenglab, Assigned: Paenglab)

Details

Attachments

(2 files, 3 obsolete files)

Until now we have three different stylings for the toolbarbutton-1. To make it simpler and make it on all platforms the same we should unify the styling and move it to the shared files.

I used the Linux styling as I think it's the cleanest of the three.

Additionally I tried to make some rules pretty by adding spaces after the commas and make the rules not too long.

Assignee: nobody → richard.marti
Status: NEW → ASSIGNED
Attachment #9179965 - Flags: review?(alessandro)
Comment on attachment 9179965 [details] [diff] [review] 1669542-unify-toolbarbutton-1.patch Review of attachment 9179965 [details] [diff] [review]: ----------------------------------------------------------------- ::: mail/themes/osx/mail/messenger.css @@ +158,5 @@ > .findbar-button { > background: none; > +} > + > +.toolbarbutton-1 { Is there any reason why this class was named this way? It seems a bit of a quick and dirty naming. We should rename it with something more semantically correct, like `button-toolbar`. I think it's always better to use a consistent format for classes, always starting with the element type (eg. button-, input-, row-, etc.) and separate words with dashes. For ID selectors instead we should stick with a camelCase, what do you think? That would mean updating the class above to `button-findbar`. I know that would mean updating pretty much all the files to replace that class name, so this would most likely be a blocking point for future uplifts. ::: mail/themes/shared/mail/messenger.css @@ +223,5 @@ > +.toolbarbutton-1 > .toolbarbutton-menubutton-dropmarker { > + border: 1px solid transparent; > + border-radius: var(--toolbarbutton-border-radius); > + transition-property: background-color, border-color; > + transition-duration: 150ms; Let's unify these attributes with `transition: background-color .15s, border-color .15s;

(In reply to Alessandro Castellani (:aleca) from comment #2)

Comment on attachment 9179965 [details] [diff] [review]
1669542-unify-toolbarbutton-1.patch

Review of attachment 9179965 [details] [diff] [review]:

::: mail/themes/osx/mail/messenger.css
@@ +158,5 @@

.findbar-button {
background: none;
+}
+
+.toolbarbutton-1 {

Is there any reason why this class was named this way? It seems a bit of a
quick and dirty naming.
We should rename it with something more semantically correct, like
button-toolbar.

I think it's always better to use a consistent format for classes, always
starting with the element type (eg. button-, input-, row-, etc.) and
separate words with dashes.
For ID selectors instead we should stick with a camelCase, what do you think?
That would mean updating the class above to button-findbar.

I know that would mean updating pretty much all the files to replace that
class name, so this would most likely be a blocking point for future uplifts.

I'm for doing this in a separate bug. There are almost 300 lines to change and not really the focus of this bug.

::: mail/themes/shared/mail/messenger.css
@@ +223,5 @@

+.toolbarbutton-1 > .toolbarbutton-menubutton-dropmarker {

  • border: 1px solid transparent;
  • border-radius: var(--toolbarbutton-border-radius);
  • transition-property: background-color, border-color;
  • transition-duration: 150ms;

Let's unify these attributes with `transition: background-color .15s,
border-color .15s;

Done.

Attachment #9179965 - Attachment is obsolete: true
Attachment #9179965 - Flags: review?(alessandro)
Attachment #9179978 - Flags: review?(alessandro)

I hope this won't lose the native look of buttons on each OS...?

This is about the toolbarbuttons which have already their own, non-native, styling.

Comment on attachment 9179978 [details] [diff] [review] 1669542-unify-toolbarbutton-1.patch Review of attachment 9179978 [details] [diff] [review]: ----------------------------------------------------------------- Outstanding effort on unifying these styles. Just a little fix for the dark variation on checked buttons and it'll be good to go. ::: mail/themes/shared/mail/messenger.css @@ +236,5 @@ > + > +.findbar-button:not([disabled=true]):is([checked="true"],:hover:active), > +.toolbarbutton-1 > .toolbarbutton-menubutton-button:not([disabled="true"]):hover:active, > +.toolbarbutton-1[open="true"] > .toolbarbutton-menubutton-dropmarker:not([disabled="true"]), > +.toolbarbutton-1:not([type="menu-button"]):not([disabled="true"]):is([open="true"],[checked="true"],:hover:active) { This attributes don't work very well on dark mode. The bg colour is too bright and we lose AAA contrast with the text colour. On dark mode we should use a slightly darker color, like --toolbarbutton-checkedhover-backgroundcolor. The inset shadow also doesn't look good and we should remove it entirely.
Attachment #9179978 - Flags: review?(alessandro) → review+

I found that .toolbarbutton-1[checked=true]:not(:active):hover didn't worked as the checked rule was stronger. I removed the rule and renamed the --toolbarbutton-checkedhover-backgroundcolor to --toolbarbutton-checked-background and use it on the checked buttons.

Attachment #9179978 - Attachment is obsolete: true
Attachment #9180002 - Flags: review?(alessandro)

Better, but the checked dark variation still doesn't look great with that 1px spread inset box shadow.
Since the light variation uses the inset box shadow to communicate depths, that approach doesn't translate well in dark variation.
I suggest implementing a linear background color to keep the "depth" feeling, and making it work better with dark themes.

--toolbarbutton-active-boxshadow: none;
--toolbarbutton-checked-background: linear-gradient(rgba(0,0,0,0.1), rgba(255, 255, 255, .1));

Patch with your checked proposal from Matrix chat.
I also removed unneeded Windows 7 Quick filter bar button styles.

Attachment #9180002 - Attachment is obsolete: true
Attachment #9180002 - Flags: review?(alessandro)
Attachment #9180192 - Flags: review?(alessandro)
Comment on attachment 9180192 [details] [diff] [review] 1669542-unify-toolbarbutton-1.patch Review of attachment 9180192 [details] [diff] [review]: ----------------------------------------------------------------- Great work!
Attachment #9180192 - Flags: review?(alessandro) → review+
Target Milestone: --- → 83 Branch

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/060c1dcc245c
Unify the .toolbarbutton-1 styling. r=aleca

Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: