|
| 1 | +# Abstracts |
| 2 | + |
| 3 | +This folder contains Sass primitives used by the rest of `attack-style`. |
| 4 | +Files in this folder should not emit large blocks of CSS on their own unless they explicitly define shared declarations such as fonts. |
| 5 | + |
| 6 | +## Files |
| 7 | + |
| 8 | +| File | Purpose | |
| 9 | +| --- | --- | |
| 10 | +| `_variables.scss` | Defines brand and user color maps plus the semantic `$colors` map used across the site. | |
| 11 | +| `_color-functions.scss` | Provides accessors and derived color helpers for entries in `$colors`. | |
| 12 | +| `_utilities.scss` | Provides small reusable mixins and unit helpers. | |
| 13 | +| `_font-faces.scss` | Defines shared font-face declarations. | |
| 14 | + |
| 15 | +## Color Model |
| 16 | + |
| 17 | +`_variables.scss` keeps raw brand values separate from semantic color names. |
| 18 | +Most styles should use semantic keys from `$colors`, such as `primary`, `secondary`, `footer`, `active`, `body`, `link`, `matrix-header`, `search-highlight`, and `deemphasis`. |
| 19 | + |
| 20 | +Each color entry may contain: |
| 21 | + |
| 22 | +| Key | Meaning | |
| 23 | +| --- | --- | |
| 24 | +| `color` | The background, foreground, or base color value. | |
| 25 | +| `on-color` | The readable text color intended for use on top of `color`. | |
| 26 | + |
| 27 | +Some entries omit `on-color` when they are not meant to contain inner text. |
| 28 | + |
| 29 | +## Helper Functions |
| 30 | + |
| 31 | +Use the functions in `_color-functions.scss` instead of reading `$colors` directly from component or layout files: |
| 32 | + |
| 33 | +| Function | Use | |
| 34 | +| --- | --- | |
| 35 | +| `color($name)` | Reads the base color for a semantic color name. | |
| 36 | +| `on-color($name)` | Reads the readable text color for a semantic color name. | |
| 37 | +| `color-alternate($name, $contrast: 1)` | Computes a nearby alternate shade for patterning or subtle contrast. | |
| 38 | +| `on-color-emphasis($name)` | Computes a stronger foreground color against a semantic background. | |
| 39 | +| `on-color-deemphasis($name)` | Computes a quieter foreground color against a semantic background. | |
| 40 | +| `border-color($name)` | Computes a border color for a semantic background. | |
| 41 | +| `background-color($name)` | Computes a subtle derived background shade. | |
| 42 | +| `escape-color($color)` | Escapes a concrete color for use inside inline SVG data URLs. | |
| 43 | + |
| 44 | +## Utility Mixins And Functions |
| 45 | + |
| 46 | +| Helper | Use | |
| 47 | +| --- | --- | |
| 48 | +| `font($primary, $secondary: sans-serif)` | Emits a font-family declaration. | |
| 49 | +| `to-rem($target-val)` | Converts a pixel-like number against a 16px base to `rem`. | |
| 50 | +| `rem($value)` | Applies the site's legacy rem offset helper. | |
| 51 | +| `margin($property, $value)` | Emits margin declarations based on the site's 24px spacing unit. | |
0 commit comments