Skip to content

Deduplicate CSS variables created from color tokens #2555

Description

@adbutterfield

Description

Currently, a new CSS variable is created for each semantic color token that references a global color token. For example:

  --eLRRDV: var(--fUtZST);
  --iapPBc: var(--jfSFfL);
  --jJSFog: var(--jfSFfL);
  --gidpOD: var(--etTVqn);
  --jSfsaG: var(--fUtZST);
  --qrNFe: var(--jfSFfL);
  --jdenfz: var(--etTVqn);
  --fGwJyg: var(--etTVqn);
  --bJIcUi: var(--ibzxgb);
  --dxqhXC: var(--ibzxgb);
  --fABWCR: var(--ibzxgb);
  --fZjaHc: var(--jmRNMc);
  --fdtfbY: var(--jmRNMc);
  --kzRiqf: var(--etTVqn);
  --iMpwjQ: var(--etTVqn);

Instead of creating this additional layer of CSS variables, it would be more efficient and reduce bundle size a bit if semantic tokens could use the same CSS variable for the global token directly.

Problem Statement/Justification

(As mentioned above) it would be more efficient and reduce bundle size a bit if semantic tokens could use the same CSS variable for the global token directly.

Proposed Solution or API

This affects internal implementation. I haven't looked into the source yet too see what change would be required...

Alternatives

No response

Additional Information

No response

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions