lombokcss 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 codinglombok
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,388 @@
1
+ # LombokCSS
2
+
3
+ [![CI](https://github.com/codinglombok/lombokcss/actions/workflows/ci.yml/badge.svg)](https://github.com/codinglombok/lombokcss/actions/workflows/ci.yml)
4
+ [![Deploy docs](https://github.com/codinglombok/lombokcss/actions/workflows/pages.yml/badge.svg)](https://github.com/codinglombok/lombokcss/actions/workflows/pages.yml)
5
+ [![npm version](https://img.shields.io/npm/v/lombokcss.svg)](https://www.npmjs.com/package/lombokcss)
6
+ [![npm downloads](https://img.shields.io/npm/dm/lombokcss.svg)](https://www.npmjs.com/package/lombokcss)
7
+ [![jsDelivr hits](https://img.shields.io/jsdelivr/npm/hm/lombokcss.svg)](https://www.jsdelivr.com/package/npm/lombokcss)
8
+ [![gzip size](https://img.shields.io/badge/gzip-9.7%20KB-success.svg)](#)
9
+ [![license](https://img.shields.io/npm/l/lombokcss.svg)](LICENSE)
10
+
11
+
12
+ A modern, **token-first** component CSS framework. Drop a class, get a working
13
+ component — like Bootstrap. Re-theme everything by changing **one attribute** —
14
+ like a design system. Ships at **~9.7 KB gzipped** (full build, minified).
15
+
16
+ ```
17
+ Component-based (Bootstrap) + Token-driven theming (design systems) + Tiny (Pico/UnoCSS)
18
+ ```
19
+
20
+ ---
21
+
22
+ ## Why it's different
23
+
24
+ Most frameworks bake their look into each component, so changing the visual
25
+ style means overriding hundreds of rules. LombokCSS inverts that:
26
+
27
+ - **Components read only semantic tokens** (`--lc-surface`, `--lc-text`, `--lc-radius`, `--lc-shadow`, `--lc-accent`, …).
28
+ - **A "design style" is just a different set of token values.** Switching it never touches component CSS or your HTML.
29
+
30
+ ```html
31
+ <!-- same markup, five identities -->
32
+ <html data-style="neo-brutalism"> <!-- thick borders, hard shadows -->
33
+ <html data-style="glassmorphism"> <!-- frosted glass -->
34
+ <html data-style="resonant-stark"> <!-- Linear-style dark -->
35
+ ```
36
+
37
+ Dark mode (`data-theme`) and RTL (`dir`) are **independent** axes that compose
38
+ with any style.
39
+
40
+ ---
41
+
42
+ ## Install
43
+
44
+ **CDN (jsDelivr)** — fastest start:
45
+ ```html
46
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/lombokcss/dist/lombok.min.css">
47
+ <script defer src="https://cdn.jsdelivr.net/npm/lombokcss/dist/lombok.js"></script>
48
+ ```
49
+
50
+ **npm:**
51
+ ```bash
52
+ npm install lombokcss
53
+ # or: yarn add lombokcss / pnpm add lombokcss
54
+ ```
55
+ ```js
56
+ import "lombokcss/dist/lombok.min.css";
57
+ import "lombokcss/dist/lombok.js"; // optional, only for interactive components
58
+ ```
59
+
60
+ Pin a version for production (jsDelivr):
61
+ ```html
62
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/lombokcss@0.1.0/dist/lombok.min.css">
63
+ ```
64
+
65
+ **Download:** grab `dist/lombok.min.css` (+ optional `dist/lombok.js`) and link them directly.
66
+
67
+ The JS is **optional**. Accordions, modals and `<dialog>` work natively without
68
+ it; the script only adds dropdown/tab/toast/table-sort/navbar-toggle behavior.
69
+
70
+ ---
71
+
72
+
73
+
74
+ **Other registries.** Also distributed via Composer (`composer require codinglombok/lombokcss`),
75
+ RubyGems (`gem "lombokcss"` → `Lombokcss.assets_path` for Sprockets), and Bower
76
+ (legacy: `bower install lombokcss`, prefer npm). Works with any bundler
77
+ (Vite/Webpack/Parcel) and framework (Vue/React/Svelte) — just import the CSS.
78
+ See the **Getting started** docs for per-tool snippets.
79
+
80
+ ## Documentation site
81
+
82
+ A full multi-page docs site lives in `docs/` (Overview, Getting started, Theming
83
+ & styles, Components, Utilities). Open `docs/index.html` in a browser. The style
84
+ / dark / RTL switchers at the top apply live and **follow you across pages** via
85
+ the URL query string. A single-file interactive playground is at
86
+ `examples/demo.html`.
87
+
88
+ ## Architecture
89
+
90
+ ```
91
+ src/
92
+ variables.css → token architecture (the contract every component depends on)
93
+ core.css → reset/reboot + base element styles (= classless mode)
94
+ themes.css → token value sets per design preset (data-style)
95
+ components.css → all components (read tokens only, RTL-safe, glass-aware)
96
+ utilities.css → atomic utilities + responsive prefixes
97
+ dist/
98
+ lombok.css → bundled, unminified (readable)
99
+ lombok.min.css → bundled + minified (ship this)
100
+ lombok.js → optional interactive behaviors
101
+ ```
102
+
103
+ ### Token layers
104
+ 1. **Primitives & scale** — spacing, font sizes, raw palette.
105
+ 2. **Semantic tokens** — `--lc-surface`, `--lc-text`, `--lc-border`, `--lc-accent`, `--lc-radius`, `--lc-shadow`, `--lc-blur`, status colors. **Components only ever reference these.**
106
+ 3. **Style presets** (`[data-style="…"]`) re-map the semantic tokens.
107
+ 4. **Dark overlay** (`[data-theme="dark"]` / `prefers-color-scheme`) re-maps color tokens; composes with presets via `[data-style][data-theme]` pairs.
108
+
109
+ Glassmorphism support is built into the contract: every surface component
110
+ applies `backdrop-filter: var(--lc-blur)`. `--lc-blur` is `none` everywhere
111
+ except the glass preset, so the property is inert until a glass theme turns it
112
+ on — no per-component glass code.
113
+
114
+ ---
115
+
116
+ ## The five design styles
117
+
118
+ | `data-style` | Character |
119
+ |---------------------------|-----------|
120
+ | `modern-corporate-flat` | Clean, flat, neutral + one brand color, medium radius, soft shadows (default) |
121
+ | `resonant-stark` | Linear-style dark: high contrast, subtle borders, tight type, violet accent |
122
+ | `neo-brutalism` | Thick black borders, hard offset shadows, bold blocks, zero radius |
123
+ | `semantic-minimalist` | Minimal, neutral, generous spacing, serif display, readability-first |
124
+ | `glassmorphism` | Frosted glass over a gradient; translucent surfaces, glowing borders (with opaque fallback) |
125
+
126
+ ---
127
+
128
+ ## Theming guide
129
+
130
+ Everything is a CSS variable. Override on `:root` (or a scope) to customize:
131
+
132
+ ```css
133
+ :root {
134
+ --lc-accent: #e11d48; /* brand color */
135
+ --lc-accent-hover: #be123c;
136
+ --lc-radius: 4px; /* tighter corners */
137
+ --lc-font-sans: "Inter", system-ui, sans-serif;
138
+ --lc-space-4: 1.1rem; /* rescale spacing */
139
+ }
140
+ ```
141
+
142
+ **Dark mode** — three ways, they all work together:
143
+ ```html
144
+ <html data-theme="dark"> <!-- force dark -->
145
+ <html data-theme="light"> <!-- force light -->
146
+ <html> <!-- follows the OS setting -->
147
+ ```
148
+
149
+ **RTL** — set the document direction; all components use logical properties:
150
+ ```html
151
+ <html dir="rtl" lang="ar">
152
+ ```
153
+
154
+ **Make your own style** — add a token block, no component edits:
155
+ ```css
156
+ [data-style="sunset"] {
157
+ --lc-bg:#1a0f0f; --lc-surface:#2a1818; --lc-text:#ffe;
158
+ --lc-accent:#ff7849; --lc-radius:14px; --lc-shadow:0 8px 24px rgba(0,0,0,.4);
159
+ }
160
+ ```
161
+
162
+ ---
163
+
164
+ ## Component usage
165
+
166
+ ```html
167
+ <!-- Buttons -->
168
+ <button class="btn btn-primary">Primary</button>
169
+ <button class="btn btn-outline btn-lg btn-rounded">Big outline</button>
170
+ <span class="btn-group">
171
+ <button class="btn btn-secondary">L</button><button class="btn btn-secondary">R</button>
172
+ </span>
173
+
174
+ <!-- Card -->
175
+ <article class="card">
176
+ <div class="card-body">
177
+ <h3 class="card-title">Title</h3>
178
+ <p class="card-text">Body copy.</p>
179
+ </div>
180
+ <div class="card-footer">Footer</div>
181
+ </article>
182
+
183
+ <!-- Form + validation (native :user-invalid + :has) -->
184
+ <form>
185
+ <div class="field">
186
+ <label class="label" for="e">Email</label>
187
+ <input class="input" id="e" type="email" required>
188
+ <span class="help">We never share it.</span>
189
+ <span class="error-text">Enter a valid email.</span>
190
+ </div>
191
+ <label class="switch"><span>Notify me</span><input type="checkbox"><span class="track"></span></label>
192
+ </form>
193
+
194
+ <!-- Alert / Badge -->
195
+ <div class="alert alert-success"><div><div class="alert-title">Saved</div>All good.</div></div>
196
+ <span class="badge badge-primary">new</span>
197
+
198
+ <!-- Tabs (JS) -->
199
+ <div class="tabs" role="tablist">
200
+ <button role="tab" aria-selected="true" aria-controls="p1">One</button>
201
+ <button role="tab" aria-selected="false" aria-controls="p2">Two</button>
202
+ </div>
203
+ <div class="tab-panel" id="p1" role="tabpanel">…</div>
204
+ <div class="tab-panel" id="p2" role="tabpanel" hidden>…</div>
205
+
206
+ <!-- Accordion (native, no JS) -->
207
+ <div class="accordion">
208
+ <details open><summary>Q</summary><div class="accordion-body">A</div></details>
209
+ </div>
210
+
211
+ <!-- Dropdown (JS) -->
212
+ <div class="dropdown">
213
+ <button class="btn btn-soft" data-dropdown-toggle aria-expanded="false">Menu ▾</button>
214
+ <div class="dropdown-menu">
215
+ <a class="dropdown-item" href="#">Item</a>
216
+ <div class="dropdown-divider"></div>
217
+ <button class="dropdown-item">Action</button>
218
+ </div>
219
+ </div>
220
+
221
+ <!-- Modal (native <dialog> + tiny JS helpers) -->
222
+ <button class="btn btn-primary" data-modal-open="m">Open</button>
223
+ <dialog class="modal" id="m">
224
+ <div class="modal-card">
225
+ <div class="modal-header">Title <button class="btn btn-ghost btn-icon btn-sm" data-modal-close>✕</button></div>
226
+ <div class="modal-body">Body</div>
227
+ <div class="modal-footer"><button class="btn btn-primary" data-modal-close>OK</button></div>
228
+ </div>
229
+ </dialog>
230
+
231
+ <!-- Toast (JS API) -->
232
+ <button class="btn" onclick="Lombok.toast('Done', {variant:'success'})">Notify</button>
233
+
234
+ <!-- Sortable table (JS: click headers) -->
235
+ <div class="table-wrap">
236
+ <table class="table table-hover">
237
+ <thead><tr><th aria-sort="none">Name</th><th aria-sort="none">MRR</th></tr></thead>
238
+ <tbody><tr><td>Nadia</td><td>49</td></tr></tbody>
239
+ </table>
240
+ </div>
241
+ ```
242
+
243
+ <!-- Carousel (CSS-only, scroll-snap) -->
244
+ <div class="carousel"><div class="carousel-track">
245
+ <div class="carousel-slide is-third card">…</div>
246
+ <div class="carousel-slide is-third card">…</div>
247
+ </div></div>
248
+
249
+ <!-- Drawer / Offcanvas (JS) -->
250
+ <button class="btn" data-drawer-open="nav">Menu</button>
251
+ <aside class="drawer" id="nav">
252
+ <div class="drawer-header">Menu <button class="btn btn-ghost btn-icon btn-sm" data-drawer-close>✕</button></div>
253
+ <div class="drawer-body">…</div>
254
+ </aside>
255
+ <div class="drawer-overlay" id="nav-overlay"></div>
256
+
257
+ <!-- Popover (JS) -->
258
+ <div class="popover">
259
+ <button class="btn btn-outline" data-popover-toggle aria-expanded="false">Info ▾</button>
260
+ <div class="popover-panel"><div class="popover-title">Title</div><p>Rich content.</p></div>
261
+ </div>
262
+
263
+ <!-- Sidebar -->
264
+ <nav class="sidebar">
265
+ <div class="sidebar-title">Workspace</div>
266
+ <a class="sidebar-link is-active" href="#">Dashboard</a>
267
+ <a class="sidebar-link" href="#">Projects</a>
268
+ </nav>
269
+
270
+ <!-- Timeline -->
271
+ <ul class="timeline">
272
+ <li><div class="timeline-time">09:00</div><div class="timeline-title">Event</div><p>Detail.</p></li>
273
+ </ul>
274
+ ```
275
+
276
+ Other components included: `navbar` (+ mobile toggle), `breadcrumb`,
277
+ `pagination`, `avatar`/`avatar-group`, `progress`, `spinner`, `skeleton`,
278
+ `stat`, `list-group`, `steps`, CSS-only tooltip (`data-tip="…"`), `kbd`, `code`/`pre`.
279
+
280
+ ### Utilities
281
+ Layout (`flex`, `grid`, `items-*`, `justify-*`, `gap-*`, `grid-cols-1..12`),
282
+ spacing (`p-*`, `m-*`, logical), sizing (`w-full`, `max-w-*`, `min-h-screen`),
283
+ type (`text-sm..3xl`, `font-*`, `text-start/center/end`), color
284
+ (`bg-surface`, `text-muted`, `border`), radius/shadow, position/z-index, plus
285
+ responsive prefixes `sm: md: lg: xl:` (e.g. `md:grid-cols-3`).
286
+
287
+ ### Classless mode
288
+ Plain semantic HTML is styled with zero classes — headings, paragraphs, links,
289
+ lists, `blockquote`, `table`, form inputs, `code`/`pre`/`kbd`. Good for prose
290
+ and quick prototypes.
291
+
292
+ ---
293
+
294
+ ## Build process
295
+
296
+ The dist files are produced with **Lightning CSS**:
297
+
298
+ ```bash
299
+ # bundle the modules in order
300
+ cat src/variables.css src/core.css src/themes.css \
301
+ src/components.css src/utilities.css > dist/lombok.css
302
+
303
+ # minify (autoprefix + dead-code removal)
304
+ npx lightningcss --minify --bundle dist/lombok.css -o dist/lombok.min.css
305
+ ```
306
+
307
+ PostCSS equivalent: `postcss-import` + `autoprefixer` + `cssnano`.
308
+
309
+ ### Shrinking further
310
+ - **Split core vs full:** ship `variables + core + themes + components` and add
311
+ `utilities.css` only if you use utility classes.
312
+ - **Purge unused utilities** with your bundler's CSS purge step keyed on your
313
+ templates.
314
+ - Drop presets you don't use from `themes.css`.
315
+
316
+ ---
317
+
318
+ ## Browser support & accessibility
319
+ Modern CSS used with graceful fallbacks: `:has()`, `:user-invalid`,
320
+ `accent-color`, `backdrop-filter` (opaque fallback via `@supports`), logical
321
+ properties, native `<dialog>`/`<details>`. Components ship with visible
322
+ `:focus-visible` rings, ARIA hooks, and respect `prefers-reduced-motion`.
323
+
324
+ ## Testing
325
+
326
+ Visual-regression tests (Playwright) screenshot the buttons block across all
327
+ five styles plus dark/RTL, and the form validation state, comparing against
328
+ committed baselines in `tests/**-snapshots/`.
329
+
330
+ ```bash
331
+ npm run test:visual # compare against baselines
332
+ npm run test:visual:update # refresh baselines after an intentional change
333
+ ```
334
+
335
+ Baselines are browser-specific. CI runs in a pinned Playwright container
336
+ (`mcr.microsoft.com/playwright:v1.56.0-noble`) so pixels match. When you change
337
+ visuals on purpose, refresh baselines **inside that image** so they match CI:
338
+
339
+ ```bash
340
+ docker run --rm -v "$PWD":/work -w /work mcr.microsoft.com/playwright:v1.56.0-noble \
341
+ bash -c "npm ci && npm run build && npm run build:docs && npm run test:visual:update"
342
+ ```
343
+
344
+ A failing run uploads a `playwright-report` artifact with side-by-side diffs.
345
+
346
+ ## Publishing (maintainers)
347
+
348
+ > Full step-by-step setup (repo creation, branch protection, secrets, Pages,
349
+ > release-please flow, npm/CDN, troubleshooting) is in **[GITHUB_SETUP.md](GITHUB_SETUP.md)**.
350
+
351
+ The package ships only `dist/`, `src/`, `README.md` and `LICENSE` (see the
352
+ `files` field). `prepublishOnly` rebuilds the bundle and enforces the size
353
+ budget, so a broken or oversized build can never be published.
354
+
355
+ **Automated (recommended).** Two GitHub Actions workflows are included:
356
+
357
+ - `.github/workflows/ci.yml` — on every push/PR: `npm ci`, `npm run build`,
358
+ size-budget check, and a guard that fails if committed `dist/` is stale.
359
+ - `.github/workflows/publish.yml` — on a published GitHub Release: builds and
360
+ runs `npm publish --provenance --access public`. Add an `NPM_TOKEN` repo
361
+ secret (an npm automation token); provenance uses the workflow's OIDC token.
362
+
363
+ Release flow:
364
+ ```bash
365
+ npm version patch # or minor / major — bumps package.json + git tag
366
+ git push --follow-tags
367
+ # then create a GitHub Release for that tag -> publish workflow runs
368
+ ```
369
+
370
+ **Manual:**
371
+ ```bash
372
+ npm run build
373
+ npm publish --access public
374
+ ```
375
+
376
+ **CDN is automatic.** Once on npm, jsDelivr and unpkg serve it with no extra
377
+ step: `https://cdn.jsdelivr.net/npm/lombokcss@<version>/dist/lombok.min.css`.
378
+ The `jsdelivr` / `unpkg` fields point both CDNs at the minified CSS by default.
379
+
380
+ **Docs hosting (GitHub Pages).** `.github/workflows/pages.yml` rebuilds the
381
+ docs and deploys `docs/` to Pages on every push to `main`. Enable it once in
382
+ repo **Settings → Pages → Source: GitHub Actions**. Site goes live at
383
+ `https://codinglombok.github.io/lombokcss/`.
384
+
385
+ Need help? See **[SUPPORT.md](SUPPORT.md)**.
386
+
387
+ ## License
388
+ MIT.