The Sage Assets package contains all SCSS stylesheets, token definitions, and design system styling for the Sage Design System.
Sage Assets uses Pine design tokens which are loaded externally (not bundled):
-
Pine Tokens - Loaded by the consuming application (docs app, KP, etc.)
- Provides semantic tokens (e.g.,
--pine-color-primary) for dark mode compatibility - NOT bundled in sage-assets to avoid duplication when both Pine and Sage are used
- Provides semantic tokens (e.g.,
-
Style Dictionary - Legacy system maintained for backward compatibility
- Used for SCSS hex value lookups via
sage-color-hex()function - Located in
/style-dictionary/tokens/
- Used for SCSS hex value lookups via
// For CSS properties (dark mode compatible)
.my-component {
background-color: sage-color(primary, 300); // Returns: var(--pine-color-primary)
color: sage-color(white); // Returns: var(--pine-color-white)
}
// For SCSS color operations (requires hex values)
$lightness: lightness(sage-color-hex(primary, 300)); // Returns: #2463ebSee SCSS_COLOR_OPERATIONS_STRATEGY.md for detailed guidance on when to use each function.
The following scripts can be ran by typing yarn <script_name> in the root of this repository. The following section goes over each script in detail.
One time build of the package
Specific build for webpack
Specific build for webpack with a watcher attached
One time build of the SassDoc assets
Continually watch and build the SassDoc assets
Continually watch and build the package
Automated script to run during preversion. Used in the Lerna monorepo
Start the SassDocs http server on port 4200
For local development, starts server along with watchers