kss-modern 1.3.0-beta.1 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -6,10 +6,11 @@ A modern, KSS-compatible styleguide generator. Parses KSS comment blocks from CS
6
6
 
7
7
  - KSS-compatible comment parsing from CSS/SCSS files
8
8
  - Live component previews with modifier variants
9
+ - Per-section theme dropdown (`Themes:`) to switch previews between the default and themed views
9
10
  - Pug template support via worker thread pool
10
11
  - Color palette and icon gallery documentation
11
12
  - Figma embed integration with light/dark theme sync
12
- - Accessibility auditing (axe-core) and HTML validation
13
+ - Accessibility auditing (axe-core) and HTML validation, per component or page-wide via `window.kssAudit()` for CI and AI agents
13
14
  - Markdown descriptions with custom components (alerts, accordions)
14
15
  - Dark mode with three-way toggle (System/Light/Dark)
15
16
  - Global search, keyboard navigation, and "Open in Editor" links
@@ -47,7 +48,7 @@ This scans all `.css` and `.scss` files in `contentDir` for KSS comment blocks a
47
48
  ## Documentation
48
49
 
49
50
  - **[Setup Guide](docs/setup.md)** — Installation, configuration reference, watch mode, project structure, and API reference
50
- - **[Usage Guide](docs/usage.md)** — Writing KSS comments, all available properties (markup, modifiers, colors, icons, Markdown, Figma, status, wrapper, html/body classes, etc.), and styleguide UI features
51
+ - **[Usage Guide](docs/usage.md)** — Writing KSS comments, all available properties (markup, modifiers, colors, icons, Markdown, Figma, status, wrapper, html/body classes, themes, etc.), and styleguide UI features
51
52
  - **[Changelog](CHANGELOG.md)** — Version history and release notes
52
53
 
53
54
  ## Basic KSS Example
@@ -4,6 +4,14 @@ interface SectionMeta {
4
4
  }[];
5
5
  }
6
6
 
7
+ /**
8
+ * One entry of a section's `Themes:` block — a theme class (or class list, e.g. `.theme-a.compact`)
9
+ * written as in the KSS comment, plus the label shown in the theme dropdown.
10
+ */
11
+ interface ThemeOption {
12
+ value: string;
13
+ description: string;
14
+ }
7
15
  interface ColorObject {
8
16
  name?: string;
9
17
  color: string;
@@ -31,6 +39,8 @@ interface in2Section {
31
39
  wrapper?: string;
32
40
  htmlclass?: string;
33
41
  bodyclass?: string;
42
+ /** Theme contexts offered by the section's theme dropdown; classes are applied to the preview's <html>. */
43
+ themes?: ThemeOption[];
34
44
  source: {
35
45
  css: {
36
46
  file: string;
@@ -202,7 +212,7 @@ type StyleguideChange = {
202
212
  type: 'structural';
203
213
  } | {
204
214
  type: 'markup';
205
- file: string;
215
+ files: string[];
206
216
  sections: string[];
207
217
  };
208
218
  /**
@@ -4,6 +4,14 @@ interface SectionMeta {
4
4
  }[];
5
5
  }
6
6
 
7
+ /**
8
+ * One entry of a section's `Themes:` block — a theme class (or class list, e.g. `.theme-a.compact`)
9
+ * written as in the KSS comment, plus the label shown in the theme dropdown.
10
+ */
11
+ interface ThemeOption {
12
+ value: string;
13
+ description: string;
14
+ }
7
15
  interface ColorObject {
8
16
  name?: string;
9
17
  color: string;
@@ -31,6 +39,8 @@ interface in2Section {
31
39
  wrapper?: string;
32
40
  htmlclass?: string;
33
41
  bodyclass?: string;
42
+ /** Theme contexts offered by the section's theme dropdown; classes are applied to the preview's <html>. */
43
+ themes?: ThemeOption[];
34
44
  source: {
35
45
  css: {
36
46
  file: string;
@@ -202,7 +212,7 @@ type StyleguideChange = {
202
212
  type: 'structural';
203
213
  } | {
204
214
  type: 'markup';
205
- file: string;
215
+ files: string[];
206
216
  sections: string[];
207
217
  };
208
218
  /**