Stylesheets
tokens.css, styles.css and the per-area files, and the order to load them in.
The package exports these stylesheets (from package.json exports):
| Import | What it holds |
|---|---|
@ergasti/bricks/tokens.css | The design tokens: custom properties on :root. No element rules and no @font-face. |
@ergasti/bricks/styles.css | Every component style, in order: kit, shell, blocks, PR blocks. |
@ergasti/bricks/kit.css | The kit's styles alone, for an app that uses only the kit. |
@ergasti/bricks/shell.css | The shell's styles. Load after kit.css. |
@ergasti/bricks/blocks.css | The brand blocks' styles. Load after kit.css. |
@ergasti/bricks/pr.css | The PR blocks' styles (not the PR theme). Load after kit.css. |
@ergasti/bricks/themes/pr.css | The pr theme: variables only, scoped to [data-bricks-theme='pr']. |
Load order
tokens.cssfirst: the component styles read its variables.themes/pr.cssaftertokens.css, only if you use the PR theme.- Then either
styles.css, orkit.cssfollowed by the area files you need. Never both:styles.cssalready contains the others.
// Everything
import '@ergasti/bricks/tokens.css';
import '@ergasti/bricks/styles.css';
// Kit only
import '@ergasti/bricks/tokens.css';
import '@ergasti/bricks/kit.css';
// Kit + shell, with the PR theme
import '@ergasti/bricks/tokens.css';
import '@ergasti/bricks/themes/pr.css';
import '@ergasti/bricks/kit.css';
import '@ergasti/bricks/shell.css';Each area file holds every stylesheet of its area. A release can add rules or files inside an area (0.6.0 adds the PR Portal's gift claims and focusable decision codes to pr.css) without a new import path, so the imports above stay the same from release to release.
The order inside the component styles is part of the API: a later file may override an earlier one. The sequence is the kit's primitives, cells, patterns, data table, v3 and kit files, then lists, then the shell, the blocks and the PR blocks. styles.css and the split files keep that order for you; do not reorder or cherry-pick files out of dist/.
What the styles do and do not do
- There is no global reset and no
bodyrule. The kit styles its own classes (kit-…). - One rule is wider than that: the console-era select chevron applies to
select.kit-selectand to selects inside aToolbar. A select of your own does not get it unless you addclassName="kit-select"(the 0.2.0 change is described on Migration). - The library ships no fonts. See Installation.
- Sizes and colours that a theme may change are custom properties declared in
tokens.css(the theme hooks). Override them aftertokens.css, never by editing a component's class. See Theming.
Per-page weight
styles.css is the biggest file because it holds all four packages. An app that only uses the kit, or the kit and the shell, loads less with the split files. Run your bundler's analyser on your own build to see the real numbers.