Closed Bug 1988809 Opened 7 months ago Closed 1 month ago

Convert tab variables into design tokens

Categories

(Toolkit :: Themes, task, P3)

task

Tracking

()

RESOLVED FIXED
151 Branch
Tracking Status
firefox151 --- fixed

People

(Reporter: jules, Assigned: jooliver)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [recomp][acorntractors])

Attachments

(1 file)

We're beginning to add more design tokens for the chrome, and tabs are a good candidate. Through tokens, we can handle their mode and theming and begin to integrate more with chrome styles per our meta 1987677.

To turn some of these into tokens, we need to, per our plan:

a. Identify all locations that variable is used
b. Identify its purpose
c. Integrate it into the design tokens system
d. Add documentation on how it is intended to be used (where do we put docs?)
e. Replace all uses with the token

Tab related tokens start with the prefixes "tab", "vertical-tabs".

Tab (found in tabs.css)

  --tab-min-height
  --tab-collapsed-background-width
  --tab-collapsed-width
  --tab-inner-inline-margin
  --tab-inline-padding: 8px;
  --tab-pinned-expanded-background-width
  --tab-pinned-margin-inline-expanded
  --tab-pinned-min-width-expanded
  --tab-pinned-container-margin-inline-expanded
  --tab-border-radius
  --tab-overflow-clip-margin
  --tab-close-button-padding
  --tab-block-margin
  --tab-icon-end-margin
  --tab-label-line-height
  --tab-loading-fill
  --tab-hover-background-color
  --tab-selected-textcolor
  --tab-selected-bgcolor
  --tab-selected-color-scheme

  /** all the way down at line 456 **/
  --tab-sharing-icon-animation

Vertical tabs

 --vertical-tabs-scrollbar-color

Please note differences across vertical tabs through its pref query here.

@media -moz-pref("sidebar.verticalTabs") {
  :root {
    --tab-min-height: max(32px, calc(var(--tab-label-line-height) * 1em));
    --tab-block-margin: 2px;
    --tab-inline-padding: var(--space-medium);
  }
}

And expand on hover differences here

  :root:not([sidebar-expand-on-hover]) & {
    --tab-inline-padding: calc((var(--tab-collapsed-background-width) + 2 * var(--tab-pinned-margin-inline-expanded) - var(--icon-size)) / 2);

And here

 @media not -moz-pref("sidebar.visibility", "expand-on-hover") {
    /* We need these rules to apply at all times when the sidebar.visibility
    pref is not set to "expand-on-hover" as opposed to when the "sidebar-expand-on-hover" attribute
    has not been added to root. There are certain scenarios when that attribute is temporarily
    removed from root such as when toggling the sidebar to expand with the toolbar button. */
    &:is([muted], [soundplaying], [activemedia-blocked]) {
      --tab-icon-end-margin: 2px;
   ...
}
No longer blocks: 1988794
Depends on: 1988794
Assignee: nobody → jooliver
Status: NEW → ASSIGNED
Attachment #9542842 - Attachment description: WIP: Bug 1988809 - move tab variables to design system r=#desktop-theme-reviewers → Bug 1988809 - move tab variables to design system r=#desktop-theme-reviewers
Blocks: 2017977
See Also: → 2018036
Depends on: 2017174
Attachment #9542842 - Attachment description: Bug 1988809 - move tab variables to design system r=#desktop-theme-reviewers → Bug 1988809 - extract tab tokens for use in design system r=#desktop-theme-reviewers
Blocks: 2008598
Pushed by jooliver@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/7ce1db3144e1 https://hg.mozilla.org/integration/autoland/rev/adfca5554cf4 extract tab tokens for use in design system r=desktop-theme-reviewers,tabbrowser-reviewers,jules,jswinarton,mstriemer
Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 151 Branch
Blocks: 2029958
Duplicate of this bug: 2017977
QA Whiteboard: [qa-triage-done-c152/b151]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: