![Maven Central Adds Sigstore Signature Validation](https://cdn.sanity.io/images/cgdhsj6q/production/7da3bc8a946cfb5df15d7fcf49767faedc72b483-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
@spectrum-css/tokens
Advanced tools
Core tokens builder for Spectrum CSS
This package uses StyleDictionary to build Spectrum core tokens for CSS.
package.json
file.--system
) that are used to map the component-level class styles to the core tokens from the desired context. These are generated by the postcss-add-theming-layer
plugin as part of the build and should not be relied upon for naming consistency across releases. Do not attempt to overwrite or extend these variables in your application.Though the token data in this package focus on only the current context (Spectrum 2), our team is committed to offering backwards compatibility for Spectrum 1 and Express through at least December of 2024.
To this end, every component that requires backward mapping support will include:
dist/themes/spectrum.css
dist/themes/express.css
dist/themes/spectrum-two.css
Consumers should load only the mappings for the components they are using in their application. This will ensure that the component-level mappings are aligned with the base CSS for each component. Spectrum 1 and Express component mappings should be loaded with the global-vars.css
and appropriate color and scale assets from the last version of the tokens package: v14.x. Loading the Spectrum 1 or Express component-level mappings with the Spectrum 2 global variables will result in incorrect values being applied to the components and will break the desired design for the component.
The output is concatenated into a single dist/index.css
for use in a vanilla HTML application. This entire file should be imported, and the relevant classes should be toggled to swap out core tokens.
On the <body>
element, start with .spectrum
, add in .spectrum--light
, then .spectrum--medium
. To switch to another context, add .spectrum--legacy
or .spectrum--express
.
For additional guidance on which assets to load, see the architecture section below.
All compiled assets are shipped from the dist
folder. Most of the assets are available in the dist/css
folder. The component-level mappings for Spectrum 1, Express, and Spectrum 2 exist in the components output as theme assets. These should be loaded with the appropriate global variables and color and scale assets from the last version of the tokens package: v14.x.
global-vars.css
: Shared global, unchanging tokens.light-vars.css
: Tokens specific to the light color.dark-vars.css
: Tokens specific to the dark color.medium-vars.css
: Tokens specific to the medium (desktop) scale.large-vars.css
: Tokens specific to the large (mobile) scale.index.css
: The above files rolled up into 1 css file for convenience; best for use in a vanilla HTML application.Overrides and additions to core tokens can be added to custom/*-vars.css
.
Ensure that you add new values to the appropriate color, or scale file:
global-vars.css
- Shared global, unchanging tokenslight-vars.css
- Tokens specific to the light colordark-vars.css
- Tokens specific to the dark colormedium-vars.css
- Tokens specific to the medium (desktop) scalelarge-vars.css
- Tokens specific to the large (mobile) scaleValues added here will be copied over and concatenated with the custom properties being generated from the core tokens by StyleDictionary.
There are no additional contextual folders (i.e., dist/css/spectrum/
) because this package supports no other theming systems outside of the component token mappings. All global tokens are found in the dist/css
folder.
For more notes on how the token data has changed, see the @adobe/spectrum-tokens release documentation.
FAQs
The Spectrum CSS tokens package
We found that @spectrum-css/tokens demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.