You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
***Single Directory Components (SDC)** keep markup, styles, metadata, and logic together, making components clear, reusable, and Drupal-native.
14
15
***Vite** is chosen for speed, simplicity, and modern ESM workflows.
16
+
***Lit** provides a lightweight, reactive layer for Web Components. It ensures that complex UI logic remains fast and encapsulated, allowing for high interactivity with minimal overhead
15
17
***Storybook** is isolated by design to enforce clean, native, CMS-agnostic components.
16
18
17
-
This combination ensures:
18
-
* fast development
19
-
* predictable behavior
20
-
* long-term maintainability
21
-
* clear component ownership and structure
19
+
## Component Inventory
20
+
21
+
### Atoms
22
+
23
+
| Component | Status | SDC | Web Components | Lit |
|[Sticky Header](./components/00-base/01-primitives/sticky-header)| experimental |**SDC + Web Component** - adds "Smart Sticky" functionality to any header or navigation bar |
58
+
|[Reveal](./components/00-base/01-primitives/reveal)| experimental |**SDC + Web Component** - provides a "reveal on scroll" animation for its content |
59
+
|[Focus Trap](./components/00-base/01-primitives/focus-trap)| stable | JS only component used by Drawer, Menu toggle |
22
60
23
61
## Quick Start
24
62
@@ -28,17 +66,25 @@ Install all dependencies
28
66
npm install
29
67
```
30
68
31
-
Starts the Vite development server
69
+
Develop common Drupal styles
32
70
33
71
```bash
34
72
npm run dev
35
73
```
36
-
74
+
Develop SDC components
75
+
```bash
76
+
npm run dev:sdc
77
+
```
37
78
Build SDC components and main style.css
38
79
39
80
```bash
40
81
npm run build
41
82
```
83
+
Run Storybook
84
+
```bash
85
+
npm run storybook
86
+
```
87
+
42
88
## Theme Renaming
43
89
This theme includes a migration script to safely change the theme's machine name. This is particularly useful when using this repository as a starter kit.
44
90
### What the script does:
@@ -63,60 +109,18 @@ Run the script:
63
109
```
64
110
Enter your new theme machine name (e.g., `my_awesome_theme`) when prompted.
65
111
66
-
## Theme Management
112
+
## Theme Light / Dark modes
67
113
68
114
This project implements a flexible theme system with native Dark Mode support.
69
115
70
116
### 1. Native System Support (Default)
71
117
The theme is **Auto-first** by design. Even without the toggler component, the site automatically inherits the user's OS preference via `prefers-color-scheme`. Dark mode CSS variables are active by default to ensure a seamless experience from the first visit.
72
118
73
119
### 2. Manual Theme Toggler
74
-
The `<wudo-theme-toggler>` Web Component allows users to manually override system settings.
120
+
The [Theme Toggler](./components/01-atoms/theme-toggler) Web Component allows users to manually override system settings.
75
121
***Tri-state Logic:** Cycles through **Auto** (System), **Dark**, and **Light** modes.
76
122
***Zero Flicker:** Applies `data-theme` to the `<html>` element instantly to prevent Layout Shift.
77
123
***Fully Localized:** All labels and ARIA attributes are passed from Drupal/Twig, making the component 100% translatable.
78
-
## Component Inventory
79
-
80
-
### Atoms
81
-
Fundamental building blocks that cannot be broken down further.
82
-
83
-
| Component | Status | SDC | Web Components | Lit |
|[Sticky Header](./components/00-base/01-primitives/sticky-header)| experimental |**SDC + Web Component** - adds "Smart Sticky" functionality to any header or navigation bar |
118
-
|[Reveal](./components/00-base/01-primitives/reveal)| experimental |**SDC + Web Component** - provides a "reveal on scroll" animation for its content |
119
-
|[Focus Trap](./components/00-base/01-primitives/focus-trap)| stable | JS only component used by Drawer, Menu toggle |
0 commit comments