Skip to content
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

Global CSS file has grown 5000 lines. #7325

Closed
2 of 4 tasks
driskull opened this issue Jul 17, 2023 · 17 comments
Closed
2 of 4 tasks

Global CSS file has grown 5000 lines. #7325

driskull opened this issue Jul 17, 2023 · 17 comments
Assignees
Labels
4 - verified Issues that have been released and confirmed resolved. calcite-components Issues specific to the @esri/calcite-components package. p - medium Issue is non core or affecting less that 60% of people using the library refactor Issues tied to code that needs to be significantly reworked. spike Issues that need quick investigations for time estimations, prioritization, or a quick assessment.

Comments

@driskull
Copy link
Member

driskull commented Jul 17, 2023

Description

  1. Can we reduce the file size of the calcite.css style sheet? The CSS file grew from ~300 lines to ~5300 lines. So basically 5000 new lines.

    1.3.0: https://cdn.jsdelivr.net/npm/@esri/[email protected]/dist/calcite/calcite.css
    1.4.0: https://cdn.jsdelivr.net/npm/@esri/[email protected]/dist/calcite/calcite.css

  2. Can we move the animation classes into a new file for utility classes that can be used by teams if necessary. We can document this new file and its utility classes. The animation keyframes should also be renamed to be BEM so that they do not have any conflicts.

@keyframes in {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}
  1. Remove the overflow-hidden class only being used by modal. This could change to an inline style where Modal can just set the overflow to hidden on the document instead of using a class.
.overflow-hidden {
  overflow: hidden;
}
  1. Remove the following, it should be done in a components CSS not in the global CSS.
host([hidden]) {
  display: none;
}

Proposed Advantages

Reduced file size, no conflicting code, utility classes are separated and documented properly.

Which Component

All

  • Refactor utility classes (Matt, Adam)
  • Refactor tokens (Ali, Franco)

Relevant Info

No response

Calcite package

  • @esri/calcite-components
  • @esri/calcite-components-react
@driskull driskull added refactor Issues tied to code that needs to be significantly reworked. 0 - new New issues that need assignment. needs triage Planning workflow - pending design/dev review. labels Jul 17, 2023
@github-actions github-actions bot added the calcite-components Issues specific to the @esri/calcite-components package. label Jul 17, 2023
@driskull
Copy link
Member Author

cc @jcfranco @alisonailea

@jcfranco
Copy link
Member

We could treat the order to also reflect priority/impact too.

  1. It looks like the wiring up of tokens caused the increase. @alisonailea Are there any strategies we could apply to strike a balance between token availability/flexibility and global CSS bloat (possibly moving component-specific tokens to the component's styles)? This will increase even more as we add more tokens and components.
  2. For the time being, I'd like to focus on generalizing as much animations as possible and moving them to _animations.scss.
  3. Your suggestion sounds perfect.
  4. Is your concern here the style impacting non-Calcite components? I think this one might still be good to keep in the global styles.

@driskull
Copy link
Member Author

driskull commented Jul 17, 2023

For the time being, I'd like to focus on generalizing as much animations as possible and moving them to _animations.scss.

These animations are already in _animations.scss which gets pulled into the calcite.css. The problem is that the names of them are unspecific. Such as keyframes named "in" and "in-down". We should BEM these if we plan to keep them as utility classes.

Is your concern here the style impacting non-Calcite components? I think this one might still be good to keep in the global styles.

Yes, my concern is impacting other components external to calcite and that this should really be applied within the component and not outside. It also doesn't work correctly in all cases and we had to add this style inside the component anyway.

@driskull
Copy link
Member Author

Maybe we can setup a meeting to discuss the animations because they are really the only utility classes that would remain in this file. Only one component is using one of them. The others are just available for use without any documentation. I would think these would be in a separate external file that is documented somewhere.

@jcfranco
Copy link
Member

These animations are already in _animations.scss...

Gotcha and 100% agreed on the animation util renaming. I forgot to add that earlier.

It also doesn't work correctly in all cases and we had to add this style inside the component anyway.

You reminded me that :host doesn't work on a global context, so we should be able to remove that safely. We could also look into enabling a rule that would warn if anything in includes.scss, or referenced by it, generates CSS by default.

Maybe we can setup a meeting to discuss the animations...

👍

@geospatialem geospatialem added 1 - assigned Issues that are assigned to a sprint and a team member. and removed 0 - new New issues that need assignment. labels Jul 18, 2023
@geospatialem geospatialem added this to the 2023 August Priorities milestone Jul 18, 2023
@geospatialem geospatialem added p - medium Issue is non core or affecting less that 60% of people using the library and removed needs triage Planning workflow - pending design/dev review. labels Jul 18, 2023
driskull added a commit that referenced this issue Jul 24, 2023
…#7346)

**Related Issue:** #7325

## Summary

- Removes style modifying all host components with hidden attribute.
This is modifying components outside of calcite and applying host styles
outside of the host. Host styles should have no effect outside of a
shadow DOM. https://developer.mozilla.org/en-US/docs/Web/CSS/:host
- Adds includes mixin for common component internal styles such as
hidden attribute styling
- Includes mixin in every component file.
driskull added a commit that referenced this issue Jul 25, 2023
…7347)

**Related Issue:** #7325

## Summary

- refactor(modal): use inline style to set overflow instead of a class
- We don't want to expose css utility classes this way.
@driskull
Copy link
Member Author

driskull commented Jul 25, 2023

Ok. the remainder of items to do are:

  • Figure out what to do with the animation classes. Separate stylesheet for these? BEM name them? Do away with them?
  • Reduce file size by moving component specific vars into the component CSS only.

driskull added a commit that referenced this issue Jul 25, 2023
**Related Issue:** #7325

## Summary

- Reduces root selector amount.
  - Only a single root selector now
- animation and floating-ui CSS were spitting out their own root
selectors just for CSS vars
- Moves animation helper classes into a mixin
- Moves reduced motion CSS into a mixin
@alisonailea
Copy link
Contributor

token transformer and token themes can be updated to significantly reduce the CSS variable bloat

@driskull driskull removed their assignment Aug 17, 2023
@macandcheese
Copy link
Contributor

  • Figure out what to do with the animation classes. Separate stylesheet for these? BEM name them? Do away with them?

One discussed idea was a calcite-css-util package in the monorepo to hold animation classes, css grid, etc.

@geospatialem geospatialem added the spike Issues that need quick investigations for time estimations, prioritization, or a quick assessment. label Oct 3, 2023
@alisonailea
Copy link
Contributor

Architecture of proposed design token refactor to reduce global calicte.css file https://www.figma.com/file/FmEJJxV2Ty3506mJ90Tsdk/Breakout-Component-Design-Tokens?type=whiteboard&node-id=0%3A1&t=M977O09URTMZvQsk-1

alisonailea added a commit that referenced this issue Nov 22, 2023
**Related Issue:** #7325 #8141

## Summary

Turns out, reducing the tokens set globally in calcite.css required a
refactor of how tokens were built. During discussions with Calcite
designers we also used this opportunity to update tokens to support
Figma Variables, composite tokens, and fix mis-alignments with our token
naming scheme. This work introduces breaking changes to tokens.

BREAKING CHANGE:
- Platform output
  - removes component tokens from global output
  - new platform output files.
    - Replaces “headless” with “global”
    - removes “calcite” from filenames

- Package.json exports
- `@esri/calcite-design-tokens/css/headless` was replaced by
`@esri/calcite-design-tokens/css/global`
- `@esri/calcite-design-tokens/scss/headless` was replaced by
`@esri/calcite-design-tokens/scss/global`
- `@esri/calcite-design-tokens/js/headless` was replaced by
`@esri/calcite-design-tokens/js/global`
- `@esri/calcite-design-tokens/es6/headless` was replaced by
`@esri/calcite-design-tokens/es6/global`

- Token paths and values
  - Border
    - Border width tokens now use t-shirt sizing
      - `Border.border-width.0` is now `border.width.sm`
      - `border.border-width.1` is now `border.width.base`
      - `border.border-width.2` is now `border.width.md`
      - `border.border-width.3` is now `border.width.lg`
      - `border.border-width.4` is now `border.width.xl`
    - Unused border radius tokens were removed
      - `Core.border.border-radius.0`
      - `Core.border.border-radius.2`
      - `Core.border.border-radius.3`
    - Border-radius tokens now use t-shirt sizing
- `semantic.ui.border.border-radius` is `semantic.border.radius.default`
      - `Core.border.border-radius.1` is now `semantic.border.radius.sm`
      - `Core.border.border-radius.4` is now `semantic.border.radius.md`
      - `Core.border.border-radius.5` is now `semantic.border.radius.lg`
      - `Core.border.border-radius.6` is now `semantic.border.radius.xl`
  - Sizing
    - `core.sizing.` tokens are now `core.size.default.`
  - Breakpoints
- breakpoint tokens are now in their own separate output file for most
platform output (except JS)
- breakpoint token path has been updated `.breakpoint.` is now
`.container-size.`
    - delete unused `breakpoint.cols` tokens
  - Box Shadow
    - global box shadow tokens now use t-shirt sizing
      - `box-shadow.0` = `box-shadow.none`
      - `box-shadow.1` = `box-shadow.sm`
      - `box-shadow.2` = `box-shadow.md`
  - Colors
    - remove “palette” from core color paths
- `core.color.palette.high-saturation` is now
`core.color.high-saturation`
    - Light Mode and Dark Mode
- Semantic color tokens now use the composite color scheme token type to
reference "light" and "dark" mode instead of having separate light and
dark tokens.
- .calcite-mode-light and .calcite-mode-dark classes as well as the
color scheme media queries are now provided via
`calcite-design-tokens/css/index.css`
- light and dark mode mixins are provided via
`calcite-design-tokens/css/index.scss`
    - remove "ui" from output platform names in favor of "color" 
      - --calcite-ui-background = --calcite-color-background
      - --calcite-ui-brand = --calcite-color-brand
- --calcite-button-transparent-hover =
--calcite-color-background-transparent-press
- --calcite-alert-dismiss-progress-background -
—calcite-color-background-transparent-dismiss
      - --calcite-link-blue-underline = --calcite-color-brand-underline
- --calcite-scrim-background-internal =
—calcite-color-background-transparent
  - Font
    - Size
      - Font sizes now use t-shirt sizing
        - `font.font-size.0` = `semantic.font.size.xs`
        - `font.font-size.1` = `semantic.font.size.sm`
        - `font.font-size.2` = `semantic.font.size.default`
        - `font.font-size.3` = `semantic.font.size.md`
        - `font.font-size.4` = `semantic.font.size.lg`
        - `font.font-size.5` = `semantic.font.size.xl`
        - `font.font-size.6` = `semantic.font.size.xxl`
      - Unsused font-sizes have been removed
        - `font.font-size.7`
        - `font.font-size.8`

---------

Co-authored-by: Ben Elan <[email protected]>
Co-authored-by: JC Franco <[email protected]>
benelan added a commit that referenced this issue Nov 23, 2023
**Related Issue:** #7325 #8141

Turns out, reducing the tokens set globally in calcite.css required a
refactor of how tokens were built. During discussions with Calcite
designers we also used this opportunity to update tokens to support
Figma Variables, composite tokens, and fix mis-alignments with our token
naming scheme. This work introduces breaking changes to tokens.

BREAKING CHANGE:
- Platform output
  - removes component tokens from global output
  - new platform output files.
    - Replaces “headless” with “global”
    - removes “calcite” from filenames

- Package.json exports
- `@esri/calcite-design-tokens/css/headless` was replaced by
`@esri/calcite-design-tokens/css/global`
- `@esri/calcite-design-tokens/scss/headless` was replaced by
`@esri/calcite-design-tokens/scss/global`
- `@esri/calcite-design-tokens/js/headless` was replaced by
`@esri/calcite-design-tokens/js/global`
- `@esri/calcite-design-tokens/es6/headless` was replaced by
`@esri/calcite-design-tokens/es6/global`

- Token paths and values
  - Border
    - Border width tokens now use t-shirt sizing
      - `Border.border-width.0` is now `border.width.sm`
      - `border.border-width.1` is now `border.width.base`
      - `border.border-width.2` is now `border.width.md`
      - `border.border-width.3` is now `border.width.lg`
      - `border.border-width.4` is now `border.width.xl`
    - Unused border radius tokens were removed
      - `Core.border.border-radius.0`
      - `Core.border.border-radius.2`
      - `Core.border.border-radius.3`
    - Border-radius tokens now use t-shirt sizing
- `semantic.ui.border.border-radius` is `semantic.border.radius.default`
      - `Core.border.border-radius.1` is now `semantic.border.radius.sm`
      - `Core.border.border-radius.4` is now `semantic.border.radius.md`
      - `Core.border.border-radius.5` is now `semantic.border.radius.lg`
      - `Core.border.border-radius.6` is now `semantic.border.radius.xl`
  - Sizing
    - `core.sizing.` tokens are now `core.size.default.`
  - Breakpoints
- breakpoint tokens are now in their own separate output file for most
platform output (except JS)
- breakpoint token path has been updated `.breakpoint.` is now
`.container-size.`
    - delete unused `breakpoint.cols` tokens
  - Box Shadow
    - global box shadow tokens now use t-shirt sizing
      - `box-shadow.0` = `box-shadow.none`
      - `box-shadow.1` = `box-shadow.sm`
      - `box-shadow.2` = `box-shadow.md`
  - Colors
    - remove “palette” from core color paths
- `core.color.palette.high-saturation` is now
`core.color.high-saturation`
    - Light Mode and Dark Mode
- Semantic color tokens now use the composite color scheme token type to
reference "light" and "dark" mode instead of having separate light and
dark tokens.
- .calcite-mode-light and .calcite-mode-dark classes as well as the
color scheme media queries are now provided via
`calcite-design-tokens/css/index.css`
- light and dark mode mixins are provided via
`calcite-design-tokens/css/index.scss`
    - remove "ui" from output platform names in favor of "color"
      - --calcite-ui-background = --calcite-color-background
      - --calcite-ui-brand = --calcite-color-brand
- --calcite-button-transparent-hover =
--calcite-color-background-transparent-press
- --calcite-alert-dismiss-progress-background -
—calcite-color-background-transparent-dismiss
      - --calcite-link-blue-underline = --calcite-color-brand-underline
- --calcite-scrim-background-internal =
—calcite-color-background-transparent
  - Font
    - Size
      - Font sizes now use t-shirt sizing
        - `font.font-size.0` = `semantic.font.size.xs`
        - `font.font-size.1` = `semantic.font.size.sm`
        - `font.font-size.2` = `semantic.font.size.default`
        - `font.font-size.3` = `semantic.font.size.md`
        - `font.font-size.4` = `semantic.font.size.lg`
        - `font.font-size.5` = `semantic.font.size.xl`
        - `font.font-size.6` = `semantic.font.size.xxl`
      - Unsused font-sizes have been removed
        - `font.font-size.7`
        - `font.font-size.8`

---------

Co-authored-by: Ben Elan <[email protected]>
Co-authored-by: JC Franco <[email protected]>
@alisonailea alisonailea added 3 - installed Issues that have been merged to master branch and are ready for final confirmation. and removed 2 - in development Issues that are actively being worked on. labels Nov 27, 2023
@github-actions github-actions bot assigned geospatialem and DitwanP and unassigned alisonailea Nov 27, 2023
Copy link
Contributor

Installed and assigned for verification.

@alisonailea
Copy link
Contributor

Previous size of the built calcite.css 346kb
New and improved size of calcite.css 24kb

benelan added a commit that referenced this issue Nov 29, 2023
**Related Issue:** #7325 #8141

Turns out, reducing the tokens set globally in calcite.css required a
refactor of how tokens were built. During discussions with Calcite
designers we also used this opportunity to update tokens to support
Figma Variables, composite tokens, and fix mis-alignments with our token
naming scheme. This work introduces breaking changes to tokens.

BREAKING CHANGE:
- Platform output
  - removes component tokens from global output
  - new platform output files.
    - Replaces “headless” with “global”
    - removes “calcite” from filenames

- Package.json exports
- `@esri/calcite-design-tokens/css/headless` was replaced by
`@esri/calcite-design-tokens/css/global`
- `@esri/calcite-design-tokens/scss/headless` was replaced by
`@esri/calcite-design-tokens/scss/global`
- `@esri/calcite-design-tokens/js/headless` was replaced by
`@esri/calcite-design-tokens/js/global`
- `@esri/calcite-design-tokens/es6/headless` was replaced by
`@esri/calcite-design-tokens/es6/global`

- Token paths and values
  - Border
    - Border width tokens now use t-shirt sizing
      - `Border.border-width.0` is now `border.width.sm`
      - `border.border-width.1` is now `border.width.base`
      - `border.border-width.2` is now `border.width.md`
      - `border.border-width.3` is now `border.width.lg`
      - `border.border-width.4` is now `border.width.xl`
    - Unused border radius tokens were removed
      - `Core.border.border-radius.0`
      - `Core.border.border-radius.2`
      - `Core.border.border-radius.3`
    - Border-radius tokens now use t-shirt sizing
- `semantic.ui.border.border-radius` is `semantic.border.radius.default`
      - `Core.border.border-radius.1` is now `semantic.border.radius.sm`
      - `Core.border.border-radius.4` is now `semantic.border.radius.md`
      - `Core.border.border-radius.5` is now `semantic.border.radius.lg`
      - `Core.border.border-radius.6` is now `semantic.border.radius.xl`
  - Sizing
    - `core.sizing.` tokens are now `core.size.default.`
  - Breakpoints
- breakpoint tokens are now in their own separate output file for most
platform output (except JS)
- breakpoint token path has been updated `.breakpoint.` is now
`.container-size.`
    - delete unused `breakpoint.cols` tokens
  - Box Shadow
    - global box shadow tokens now use t-shirt sizing
      - `box-shadow.0` = `box-shadow.none`
      - `box-shadow.1` = `box-shadow.sm`
      - `box-shadow.2` = `box-shadow.md`
  - Colors
    - remove “palette” from core color paths
- `core.color.palette.high-saturation` is now
`core.color.high-saturation`
    - Light Mode and Dark Mode
- Semantic color tokens now use the composite color scheme token type to
reference "light" and "dark" mode instead of having separate light and
dark tokens.
- .calcite-mode-light and .calcite-mode-dark classes as well as the
color scheme media queries are now provided via
`calcite-design-tokens/css/index.css`
- light and dark mode mixins are provided via
`calcite-design-tokens/css/index.scss`
    - remove "ui" from output platform names in favor of "color"
      - --calcite-ui-background = --calcite-color-background
      - --calcite-ui-brand = --calcite-color-brand
- --calcite-button-transparent-hover =
--calcite-color-background-transparent-press
- --calcite-alert-dismiss-progress-background -
—calcite-color-background-transparent-dismiss
      - --calcite-link-blue-underline = --calcite-color-brand-underline
- --calcite-scrim-background-internal =
—calcite-color-background-transparent
  - Font
    - Size
      - Font sizes now use t-shirt sizing
        - `font.font-size.0` = `semantic.font.size.xs`
        - `font.font-size.1` = `semantic.font.size.sm`
        - `font.font-size.2` = `semantic.font.size.default`
        - `font.font-size.3` = `semantic.font.size.md`
        - `font.font-size.4` = `semantic.font.size.lg`
        - `font.font-size.5` = `semantic.font.size.xl`
        - `font.font-size.6` = `semantic.font.size.xxl`
      - Unsused font-sizes have been removed
        - `font.font-size.7`
        - `font.font-size.8`

---------

Co-authored-by: Ben Elan <[email protected]>
Co-authored-by: JC Franco <[email protected]>
@geospatialem geospatialem added 4 - verified Issues that have been released and confirmed resolved. and removed 3 - installed Issues that have been merged to master branch and are ready for final confirmation. labels Dec 1, 2023
@geospatialem
Copy link
Member

Verified with the rc cdn, css sizing mentioned in Ali's comment above.

benelan added a commit that referenced this issue Dec 1, 2023
**Related Issue:** #7325 #8141

Turns out, reducing the tokens set globally in calcite.css required a
refactor of how tokens were built. During discussions with Calcite
designers we also used this opportunity to update tokens to support
Figma Variables, composite tokens, and fix mis-alignments with our token
naming scheme. This work introduces breaking changes to tokens.

BREAKING CHANGE:
Platform output:
- removes component tokens from global output
- new platform output files.
    - Replaces “headless” with “global”
    - removes “calcite” from filenames

Package.json exports:
- `@esri/calcite-design-tokens/css/headless` was replaced by
    `@esri/calcite-design-tokens/css/global`
- `@esri/calcite-design-tokens/scss/headless` was replaced by
    `@esri/calcite-design-tokens/scss/global`
- `@esri/calcite-design-tokens/js/headless` was replaced by
    `@esri/calcite-design-tokens/js/global`
- `@esri/calcite-design-tokens/es6/headless` was replaced by
    `@esri/calcite-design-tokens/es6/global`

Token paths and values:
- Border
    - Border width tokens now use t-shirt sizing
        - `Border.border-width.0` is now `border.width.sm`
        - `border.border-width.1` is now `border.width.base`
        - `border.border-width.2` is now `border.width.md`
        - `border.border-width.3` is now `border.width.lg`
        - `border.border-width.4` is now `border.width.xl`
    - Unused border radius tokens were removed
        - `Core.border.border-radius.0`
        - `Core.border.border-radius.2`
        - `Core.border.border-radius.3`
    - Border-radius tokens now use t-shirt sizing
        - `semantic.ui.border.border-radius` is `semantic.border.radius.default`
        - `Core.border.border-radius.1` is now `semantic.border.radius.sm`
        - `Core.border.border-radius.4` is now `semantic.border.radius.md`
        - `Core.border.border-radius.5` is now `semantic.border.radius.lg`
        - `Core.border.border-radius.6` is now `semantic.border.radius.xl`
- Sizing
    - `core.sizing.` tokens are now `core.size.default.`
- Breakpoints
    - breakpoint tokens are now in their own separate output file for most
        platform output (except JS)
    - breakpoint token path has been updated `.breakpoint.` is now
        `.container-size.`
    - delete unused `breakpoint.cols` tokens
- Box Shadow
    - global box shadow tokens now use t-shirt sizing
        - `box-shadow.0` = `box-shadow.none`
        - `box-shadow.1` = `box-shadow.sm`
        - `box-shadow.2` = `box-shadow.md`
- Colors
    - remove “palette” from core color paths
        - `core.color.palette.high-saturation` is now
            `core.color.high-saturation`
- Light Mode and Dark Mode
    - Semantic color tokens now use the composite color scheme token type to
        reference "light" and "dark" mode instead of having separate light and
        dark tokens.
    - .calcite-mode-light and .calcite-mode-dark classes as well as the
        color scheme media queries are now provided via
        `calcite-design-tokens/css/index.css`
    - light and dark mode mixins are provided via
        `calcite-design-tokens/css/index.scss`
    - remove "ui" from output platform names in favor of "color"
        - --calcite-ui-background = --calcite-color-background
        - --calcite-ui-brand = --calcite-color-brand
        - --calcite-button-transparent-hover = --calcite-color-background-transparent-press
        - --calcite-alert-dismiss-progress-background
        - --calcite-color-background-transparent-dismiss
        - --calcite-link-blue-underline = --calcite-color-brand-underline
        - --calcite-scrim-background-internal = --calcite-color-background-transparent
- Font
    - Size
        - Font sizes now use t-shirt sizing
            - `font.font-size.0` = `semantic.font.size.xs`
            - `font.font-size.1` = `semantic.font.size.sm`
            - `font.font-size.2` = `semantic.font.size.default`
            - `font.font-size.3` = `semantic.font.size.md`
            - `font.font-size.4` = `semantic.font.size.lg`
            - `font.font-size.5` = `semantic.font.size.xl`
            - `font.font-size.6` = `semantic.font.size.xxl`
        - Unsused font-sizes have been removed
            - `font.font-size.7`
            - `font.font-size.8`

---------

Co-authored-by: Ben Elan <[email protected]>
Co-authored-by: JC Franco <[email protected]>
benelan added a commit that referenced this issue Dec 1, 2023
**Related Issue:** #7325 #8141

Turns out, reducing the tokens set globally in calcite.css required a
refactor of how tokens were built. During discussions with Calcite
designers we also used this opportunity to update tokens to support
Figma Variables, composite tokens, and fix mis-alignments with our token
naming scheme. This work introduces breaking changes to tokens.

BREAKING CHANGE:
Platform output:
- removes component tokens from global output
- new platform output files.
    - Replaces “headless” with “global”
    - removes “calcite” from filenames

Package.json exports:
- `@esri/calcite-design-tokens/css/headless` was replaced by
    `@esri/calcite-design-tokens/css/global`
- `@esri/calcite-design-tokens/scss/headless` was replaced by
    `@esri/calcite-design-tokens/scss/global`
- `@esri/calcite-design-tokens/js/headless` was replaced by
    `@esri/calcite-design-tokens/js/global`
- `@esri/calcite-design-tokens/es6/headless` was replaced by
    `@esri/calcite-design-tokens/es6/global`

Token paths and values:
- Border
    - Border width tokens now use t-shirt sizing
        - `Border.border-width.0` is now `border.width.sm`
        - `border.border-width.1` is now `border.width.base`
        - `border.border-width.2` is now `border.width.md`
        - `border.border-width.3` is now `border.width.lg`
        - `border.border-width.4` is now `border.width.xl`
    - Unused border radius tokens were removed
        - `Core.border.border-radius.0`
        - `Core.border.border-radius.2`
        - `Core.border.border-radius.3`
    - Border-radius tokens now use t-shirt sizing
        - `semantic.ui.border.border-radius` is `semantic.border.radius.default`
        - `Core.border.border-radius.1` is now `semantic.border.radius.sm`
        - `Core.border.border-radius.4` is now `semantic.border.radius.md`
        - `Core.border.border-radius.5` is now `semantic.border.radius.lg`
        - `Core.border.border-radius.6` is now `semantic.border.radius.xl`
- Sizing
    - `core.sizing.` tokens are now `core.size.default.`
- Breakpoints
    - breakpoint tokens are now in their own separate output file for most
        platform output (except JS)
    - breakpoint token path has been updated `.breakpoint.` is now
        `.container-size.`
    - delete unused `breakpoint.cols` tokens
- Box Shadow
    - global box shadow tokens now use t-shirt sizing
        - `box-shadow.0` = `box-shadow.none`
        - `box-shadow.1` = `box-shadow.sm`
        - `box-shadow.2` = `box-shadow.md`
- Colors
    - remove “palette” from core color paths
        - `core.color.palette.high-saturation` is now
            `core.color.high-saturation`
- Light Mode and Dark Mode
    - Semantic color tokens now use the composite color scheme token type to
        reference "light" and "dark" mode instead of having separate light and
        dark tokens.
    - .calcite-mode-light and .calcite-mode-dark classes as well as the
        color scheme media queries are now provided via
        `calcite-design-tokens/css/index.css`
    - light and dark mode mixins are provided via
        `calcite-design-tokens/css/index.scss`
    - remove "ui" from output platform names in favor of "color"
        - --calcite-ui-background = --calcite-color-background
        - --calcite-ui-brand = --calcite-color-brand
        - --calcite-button-transparent-hover = --calcite-color-background-transparent-press
        - --calcite-alert-dismiss-progress-background
        - --calcite-color-background-transparent-dismiss
        - --calcite-link-blue-underline = --calcite-color-brand-underline
        - --calcite-scrim-background-internal = --calcite-color-background-transparent
- Font
    - Size
        - Font sizes now use t-shirt sizing
            - `font.font-size.0` = `semantic.font.size.xs`
            - `font.font-size.1` = `semantic.font.size.sm`
            - `font.font-size.2` = `semantic.font.size.default`
            - `font.font-size.3` = `semantic.font.size.md`
            - `font.font-size.4` = `semantic.font.size.lg`
            - `font.font-size.5` = `semantic.font.size.xl`
            - `font.font-size.6` = `semantic.font.size.xxl`
        - Unsused font-sizes have been removed
            - `font.font-size.7`
            - `font.font-size.8`

---------

Co-authored-by: Ben Elan <[email protected]>
Co-authored-by: JC Franco <[email protected]>
benelan added a commit that referenced this issue Dec 2, 2023
**Related Issue:** #7325 #8141

Turns out, reducing the tokens set globally in calcite.css required a
refactor of how tokens were built. During discussions with Calcite
designers we also used this opportunity to update tokens to support
Figma Variables, composite tokens, and fix mis-alignments with our token
naming scheme. This work introduces breaking changes to tokens.

BREAKING CHANGE:
Platform output:
- removes component tokens from global output
- new platform output files.
    - Replaces “headless” with “global”
    - removes “calcite” from filenames

Package.json exports:
- `@esri/calcite-design-tokens/css/headless` was replaced by
    `@esri/calcite-design-tokens/css/global`
- `@esri/calcite-design-tokens/scss/headless` was replaced by
    `@esri/calcite-design-tokens/scss/global`
- `@esri/calcite-design-tokens/js/headless` was replaced by
    `@esri/calcite-design-tokens/js/global`
- `@esri/calcite-design-tokens/es6/headless` was replaced by
    `@esri/calcite-design-tokens/es6/global`

Token paths and values:
- Border
    - Border width tokens now use t-shirt sizing
        - `Border.border-width.0` is now `border.width.sm`
        - `border.border-width.1` is now `border.width.base`
        - `border.border-width.2` is now `border.width.md`
        - `border.border-width.3` is now `border.width.lg`
        - `border.border-width.4` is now `border.width.xl`
    - Unused border radius tokens were removed
        - `Core.border.border-radius.0`
        - `Core.border.border-radius.2`
        - `Core.border.border-radius.3`
    - Border-radius tokens now use t-shirt sizing
        - `semantic.ui.border.border-radius` is `semantic.border.radius.default`
        - `Core.border.border-radius.1` is now `semantic.border.radius.sm`
        - `Core.border.border-radius.4` is now `semantic.border.radius.md`
        - `Core.border.border-radius.5` is now `semantic.border.radius.lg`
        - `Core.border.border-radius.6` is now `semantic.border.radius.xl`
- Sizing
    - `core.sizing.` tokens are now `core.size.default.`
- Breakpoints
    - breakpoint tokens are now in their own separate output file for most
        platform output (except JS)
    - breakpoint token path has been updated `.breakpoint.` is now
        `.container-size.`
    - delete unused `breakpoint.cols` tokens
- Box Shadow
    - global box shadow tokens now use t-shirt sizing
        - `box-shadow.0` = `box-shadow.none`
        - `box-shadow.1` = `box-shadow.sm`
        - `box-shadow.2` = `box-shadow.md`
- Colors
    - remove “palette” from core color paths
        - `core.color.palette.high-saturation` is now
            `core.color.high-saturation`
- Light Mode and Dark Mode
    - Semantic color tokens now use the composite color scheme token type to
        reference "light" and "dark" mode instead of having separate light and
        dark tokens.
    - .calcite-mode-light and .calcite-mode-dark classes as well as the
        color scheme media queries are now provided via
        `calcite-design-tokens/css/index.css`
    - light and dark mode mixins are provided via
        `calcite-design-tokens/css/index.scss`
    - remove "ui" from output platform names in favor of "color"
        - --calcite-ui-background = --calcite-color-background
        - --calcite-ui-brand = --calcite-color-brand
        - --calcite-button-transparent-hover = --calcite-color-background-transparent-press
        - --calcite-alert-dismiss-progress-background
        - --calcite-color-background-transparent-dismiss
        - --calcite-link-blue-underline = --calcite-color-brand-underline
        - --calcite-scrim-background-internal = --calcite-color-background-transparent
- Font
    - Size
        - Font sizes now use t-shirt sizing
            - `font.font-size.0` = `semantic.font.size.xs`
            - `font.font-size.1` = `semantic.font.size.sm`
            - `font.font-size.2` = `semantic.font.size.default`
            - `font.font-size.3` = `semantic.font.size.md`
            - `font.font-size.4` = `semantic.font.size.lg`
            - `font.font-size.5` = `semantic.font.size.xl`
            - `font.font-size.6` = `semantic.font.size.xxl`
        - Unsused font-sizes have been removed
            - `font.font-size.7`
            - `font.font-size.8`

---------

Co-authored-by: Ben Elan <[email protected]>
Co-authored-by: JC Franco <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4 - verified Issues that have been released and confirmed resolved. calcite-components Issues specific to the @esri/calcite-components package. p - medium Issue is non core or affecting less that 60% of people using the library refactor Issues tied to code that needs to be significantly reworked. spike Issues that need quick investigations for time estimations, prioritization, or a quick assessment.
Projects
None yet
Development

No branches or pull requests

6 participants