Skip to content

Commit 7396ded

Browse files
committed
docs: remove sassdoc from package.json and add README for theme-specific Sass
1 parent a141767 commit 7396ded

9 files changed

Lines changed: 1066 additions & 4276 deletions

File tree

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,5 @@ search_bundle.js
4343
node_modules/
4444

4545
attack-style/dist/
46-
attack-style/docs/
4746
attack-version-archives/
4847
tmp/

attack-style/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,17 @@ To set up the ATT&CK Style package, follow these steps:
5454
```
5555

5656
The files are now ready to be used in the process to build the ATT&CK website!
57+
58+
## Documentation
59+
60+
Style documentation is maintained as Markdown files next to the SCSS source.
61+
Use these files as the source of truth for how each style folder is organized:
62+
63+
* `abstracts/README.md`
64+
* `base/README.md`
65+
* `layout/README.md`
66+
* `components/README.md`
67+
* `themes/README.md`
68+
69+
When adding or changing SCSS behavior, update the nearest Markdown file in the same folder.
70+
These docs are committed source files, not generated output.

attack-style/abstracts/README.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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. |

attack-style/base/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Base Styles
2+
3+
This folder contains broad styles that apply across pages before layout and component-specific rules.
4+
5+
## Files
6+
7+
| File | Purpose |
8+
| --- | --- |
9+
| `_base.scss` | Defines shared utility classes and base color treatments used by generated pages. |
10+
| `_typography.scss` | Defines small text label helpers. |
11+
12+
## Notes
13+
14+
`_base.scss` depends on `abstracts/color-functions` so base classes stay aligned with the active theme.
15+
The `%bg-alternate` placeholder is extended by `.bg-alternate` and should remain theme-aware.
16+
17+
Keep new rules here only when they are genuinely global.
18+
Rules for a specific page section, navigation area, or interactive feature should live in `layout/` or `components/`.

attack-style/components/README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Components
2+
3+
This folder contains styles for discrete ATT&CK website features.
4+
5+
## Files
6+
7+
| File | Purpose |
8+
| --- | --- |
9+
| `_search.scss` | Styles the full-screen search overlay, search input, filters, result list, result cards, warnings, loading states, and search highlights. |
10+
| `_matrix.scss` | Styles matrix containers, tactic columns, technique rows, scroll indicators, side matrix behavior, and matrix responsiveness. |
11+
| `_tour.scss` | Styles guided-tour popovers and disables backdrop/highlight animation artifacts. |
12+
| `_versioning.scss` | Styles version switch controls and version table break rows. |
13+
14+
## Notes
15+
16+
Component files should use semantic colors through `abstracts/color-functions` and shared unit helpers through `abstracts/utilities`.
17+
18+
Keep component selectors scoped to the feature they support.
19+
If a selector is reused across unrelated parts of the site, move the shared piece to `base/` or `layout/` instead of coupling components together.

attack-style/layout/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Layout Styles
2+
3+
This folder contains page structure, navigation, and footer styles.
4+
5+
## Files
6+
7+
| File | Purpose |
8+
| --- | --- |
9+
| `_layout.scss` | Defines document-level layout, common page utilities, button treatments, image sizing, and responsive page structure. |
10+
| `_nav.scss` | Defines top navigation, dropdowns, side navigation, mobile navigation behavior, and navigation icon styling. |
11+
| `_footer.scss` | Defines footer layout, footer links, responsive footer behavior, and print hiding. |
12+
13+
## Notes
14+
15+
Layout files may depend on `base/` placeholders and `abstracts/` helpers.
16+
Keep layout rules focused on structural page behavior and shared chrome.
17+
18+
When adding styles for a specific feature such as search, matrix tables, tours, or version controls, prefer `components/`.

0 commit comments

Comments
 (0)