emily-css 1.0.8 → 1.0.14
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/CHANGELOG.md +154 -0
- package/README.md +64 -222
- package/bin/emilyui.js +35 -6
- package/package.json +18 -4
- package/src/generators.js +34 -1
- package/src/index.js +148 -47
- package/src/init.js +641 -188
- package/src/purge-cmd.js +2 -2
- package/src/showcase.js +90 -0
- package/src/watch.js +193 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `emily-css` are documented here.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## v1.0.14 — May 2026
|
|
8
|
+
|
|
9
|
+
**updated readme**
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
- updated readme
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
## v1.0.13 — May 2026
|
|
16
|
+
|
|
17
|
+
**added functionality to commit to github and then push to npm release**
|
|
18
|
+
|
|
19
|
+
### Added
|
|
20
|
+
- added functionality to commit to github and then push to npm release
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
## v1.0.12 — May 2026
|
|
24
|
+
|
|
25
|
+
****
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
## v1.0.11 — May 2026
|
|
29
|
+
|
|
30
|
+
****
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
## v1.0.10 — May 2026
|
|
34
|
+
|
|
35
|
+
**Changelog automation**
|
|
36
|
+
|
|
37
|
+
### Added
|
|
38
|
+
- Release script (`npm run release`) — reads git log, prompts for version bump, writes CHANGELOG.md, commits and tags automatically
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## v1.0.9 — May 2026
|
|
43
|
+
|
|
44
|
+
**Showcase server + code block utilities**
|
|
45
|
+
|
|
46
|
+
### Added
|
|
47
|
+
- Showcase server — run `npm run emily:showcase` to browse components on localhost:3456
|
|
48
|
+
- Code block utilities (`.code-window`, `.token-*`) in generated CSS — VSCode Dark+ style syntax highlighting
|
|
49
|
+
- `pre`/`code` base styles added to `@layer base`
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## v1.0.8 — May 2026
|
|
54
|
+
|
|
55
|
+
**Watch mode + build pipeline**
|
|
56
|
+
|
|
57
|
+
### Added
|
|
58
|
+
- Watch mode — `npx emily-css watch` rebuilds CSS automatically on config change
|
|
59
|
+
- Build + purge can now be chained in a single pipeline
|
|
60
|
+
- npm scripts wired into `package.json` during `npx emily-css init`
|
|
61
|
+
|
|
62
|
+
### Changed
|
|
63
|
+
- `init.js` provides a more guided setup experience with clearer prompts
|
|
64
|
+
- `bin/emilyui.js` updated to correctly route `watch`/`build`/`purge` subcommands
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## v1.0.7 — April 2026
|
|
69
|
+
|
|
70
|
+
**Purge regex fix**
|
|
71
|
+
|
|
72
|
+
### Fixed
|
|
73
|
+
- Purge crashed when class names contained regex metacharacters (`[`, `]`, `(`, `)`, `{`, `}`, etc). Previously only `:` and `.` were escaped — now uses full metacharacter escaping
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## v1.0.6 — April 2026
|
|
78
|
+
|
|
79
|
+
**Dist + font cleanup**
|
|
80
|
+
|
|
81
|
+
### Changed
|
|
82
|
+
- `dist/` and `fonts/` directories removed from git tracking
|
|
83
|
+
|
|
84
|
+
### Breaking changes
|
|
85
|
+
- If you were pulling `dist/emily.css` directly from GitHub, run `npx emily-css build` locally instead
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## v1.0.5 — April 2026
|
|
90
|
+
|
|
91
|
+
**Split font system**
|
|
92
|
+
|
|
93
|
+
### Added
|
|
94
|
+
- Separate heading and body font config — `fontFamily.heading` and `fontFamily.body` are now independent
|
|
95
|
+
- Google Fonts CDN integration — fonts loaded via `@import` in generated CSS
|
|
96
|
+
- Font-specific tests added to test suite
|
|
97
|
+
|
|
98
|
+
### Changed
|
|
99
|
+
- Bundled font files removed from the npm package
|
|
100
|
+
- `emily.config.json` updated with split `fontFamily` structure
|
|
101
|
+
|
|
102
|
+
### Breaking changes
|
|
103
|
+
- If your config has `fontFamily` as a single string, update it to `{ "heading": "...", "body": "..." }`
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## v1.0.3 — April 2026
|
|
108
|
+
|
|
109
|
+
**Package size reduction**
|
|
110
|
+
|
|
111
|
+
### Changed
|
|
112
|
+
- Demo CSS removed from the published npm package
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## v1.0.2 — April 2026
|
|
117
|
+
|
|
118
|
+
**Package distribution fix**
|
|
119
|
+
|
|
120
|
+
### Added
|
|
121
|
+
- `.npmignore` added — controls which files are included in the published package
|
|
122
|
+
- `dist` files explicitly declared in `package.json` `files` array
|
|
123
|
+
|
|
124
|
+
### Fixed
|
|
125
|
+
- Unnecessary files (tests, src, docs) were being included in the npm tarball
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## v1.0.1 — April 2026
|
|
130
|
+
|
|
131
|
+
**CLI rename fix**
|
|
132
|
+
|
|
133
|
+
### Fixed
|
|
134
|
+
- Internal references to old `emily-ui` CLI name updated to `emily-css`
|
|
135
|
+
|
|
136
|
+
### Breaking changes
|
|
137
|
+
- If you had scripts referencing `npx emily-ui`, update them to `npx emily-css`
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## v1.0.0 — April 2026
|
|
142
|
+
|
|
143
|
+
**Initial release**
|
|
144
|
+
|
|
145
|
+
### Added
|
|
146
|
+
- 11,844 utility classes generated from `emily.config.json`
|
|
147
|
+
- OKLCH colour scale generation — one hex in, 10-shade scale out
|
|
148
|
+
- Responsive variants (`sm:` `md:` `lg:` `xl:` `2xl:`)
|
|
149
|
+
- State variants (`hover:` `focus-visible:` `active:` `disabled:` `dark:`)
|
|
150
|
+
- Purge system — strips unused classes, ~97% file size reduction
|
|
151
|
+
- Interactive setup wizard (`npx emily-css init`)
|
|
152
|
+
- 72 tests, all passing
|
|
153
|
+
|
|
154
|
+
---
|
package/README.md
CHANGED
|
@@ -1,307 +1,149 @@
|
|
|
1
|
-
#
|
|
1
|
+
# emilyCSS
|
|
2
2
|
|
|
3
|
-
A config-driven
|
|
3
|
+
**A config-driven design system generator for developers working in constrained or legacy environments.**
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Define your brand in one JSON file and generate a production-ready, accessibility-first stylesheet in seconds.
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## The Mental Model
|
|
8
8
|
|
|
9
|
-
-
|
|
10
|
-
- **Config-driven** - Entire framework configured via `emily.config.json`
|
|
11
|
-
- **Utility-first** - Composable utilities for layout, spacing, typography and colour
|
|
12
|
-
- **Responsive ready** - All utilities work with responsive prefixes (`sm:`, `md:`, `lg:`, `xl:`, `2xl:`)
|
|
13
|
-
- **State variants** - `hover:`, `focus-visible:`, `active:`, `disabled:` built-in
|
|
14
|
-
- **Accessibility first** - WCAG 2.2 AA compliance in core utilities (focus rings, contrast, motion)
|
|
15
|
-
- **Purge system** - Remove unused CSS automatically for production
|
|
9
|
+
emilyCSS is built for real-world systems like **Drupal, Power Pages, WordPress, static HTML**, and other environments where modern build pipelines often don't exist.
|
|
16
10
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
1. **Configure** — Define your brand colours, fonts, and spacing in `emily.config.json`
|
|
12
|
+
2. **Generate** — Run one command to produce a clean, optimized CSS file
|
|
13
|
+
3. **Deploy** — Link the stylesheet and copy production-ready components from the showcase
|
|
20
14
|
|
|
21
|
-
|
|
22
|
-
npm install emily-css
|
|
23
|
-
```
|
|
15
|
+
## Quick Start
|
|
24
16
|
|
|
25
|
-
###
|
|
17
|
+
### 1. Initialize
|
|
26
18
|
|
|
27
19
|
```bash
|
|
28
20
|
npx emily-css init
|
|
29
21
|
```
|
|
30
22
|
|
|
31
|
-
This walks you through
|
|
23
|
+
This creates your `emily.config.json`, walks you through your brand settings, and runs your first build.
|
|
32
24
|
|
|
33
|
-
|
|
34
|
-
- Brand colours (primary, secondary, success, warning, error, neutral)
|
|
35
|
-
- Font families
|
|
36
|
-
- Base spacing unit
|
|
37
|
-
- Source directory (used by the purge command)
|
|
38
|
-
|
|
39
|
-
It then generates `emily.config.json` and runs your first build automatically.
|
|
40
|
-
|
|
41
|
-
### 3. Link the CSS in your project
|
|
25
|
+
### 2. Link the CSS
|
|
42
26
|
|
|
43
27
|
```html
|
|
44
|
-
<link rel="stylesheet" href="./dist/emily.css">
|
|
28
|
+
<link rel="stylesheet" href="./dist/emily.min.css">
|
|
45
29
|
```
|
|
46
30
|
|
|
47
|
-
###
|
|
31
|
+
### 3. Development
|
|
48
32
|
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
</button>
|
|
33
|
+
```bash
|
|
34
|
+
npx emily-css watch # Rebuilds automatically on config/template changes
|
|
35
|
+
npx emily-css build # Manual rebuild
|
|
53
36
|
```
|
|
54
37
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
### 5. Purge unused CSS for production
|
|
38
|
+
Open the showcase:
|
|
58
39
|
|
|
59
40
|
```bash
|
|
60
|
-
|
|
41
|
+
npm run emily:showcase # Serves at http://localhost:3456
|
|
61
42
|
```
|
|
62
43
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
Output:
|
|
66
|
-
- `dist/emily.purged.css` - Purged CSS
|
|
67
|
-
- `dist/emily.purged.min.css` - Minified version
|
|
68
|
-
|
|
69
|
-
Use the purged file in production:
|
|
44
|
+
## Core Features
|
|
70
45
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
46
|
+
- **Token-Driven Colours** — One hex per colour → balanced 10-shade scale using OKLCH
|
|
47
|
+
- **Predictable Spacing** — Everything scales from your baseUnit
|
|
48
|
+
- **Accessibility First** — Focus-visible rings, motion utilities, WCAG 2.2 AA colours
|
|
49
|
+
- **No Build Pipeline Required** — Just a static CSS file
|
|
50
|
+
- **Smart Purge** — Remove unused utilities for tiny production files
|
|
51
|
+
- **UI Starter Kit** — Copy-paste accessible components from the showcase
|
|
74
52
|
|
|
75
53
|
## Commands
|
|
76
54
|
|
|
77
55
|
```bash
|
|
78
|
-
npx emily-css init
|
|
79
|
-
npx emily-css build
|
|
80
|
-
npx emily-css
|
|
81
|
-
|
|
56
|
+
npx emily-css init # Setup + first build
|
|
57
|
+
npx emily-css build # Regenerate CSS
|
|
58
|
+
npx emily-css watch # Development watch mode
|
|
59
|
+
npx emily-css purge # Remove unused styles for production
|
|
82
60
|
```
|
|
83
61
|
|
|
84
62
|
## How Purge Works
|
|
85
63
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
For example:
|
|
89
|
-
|
|
90
|
-
```html
|
|
91
|
-
<div class="p-4 bg-primary-80 rounded-lg">Content</div>
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
EmilyUI keeps `.p-4`, `.bg-primary-80`, `.rounded-lg` and removes everything else.
|
|
95
|
-
|
|
96
|
-
Supported file types: `.html`, `.twig`, `.njk`, `.liquid`, `.hbs`, `.jsx`, `.tsx`, `.vue`, `.php`, `.astro`, `.svelte`, `.blade.php` (configurable via `extensions` in `emily.config.json`)
|
|
97
|
-
|
|
98
|
-
**Note:** Class names must exist as plain text in your files. Dynamically constructed class names will not be detected:
|
|
64
|
+
emilyCSS scans your templates for used class names and removes everything else.
|
|
99
65
|
|
|
100
|
-
|
|
101
|
-
// This will be missed by purge:
|
|
102
|
-
const colour = 'primary-80'
|
|
103
|
-
const cls = `bg-${colour}`
|
|
66
|
+
Configure it in `emily.config.json`:
|
|
104
67
|
|
|
105
|
-
|
|
106
|
-
|
|
68
|
+
```json
|
|
69
|
+
"purge": {
|
|
70
|
+
"extensions": [".html", ".php", ".twig", ".liquid", ".jsx", ".vue", ".astro"]
|
|
71
|
+
}
|
|
107
72
|
```
|
|
108
73
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
## File Size
|
|
112
|
-
|
|
113
|
-
EmilyUI uses a purge-based approach (generate all utilities, then remove unused).
|
|
74
|
+
**Important:** Dynamically constructed classes (e.g. `bg-${colour}`) are not detected. Use static strings or add them to your safelist.
|
|
114
75
|
|
|
115
|
-
|
|
116
|
-
|---|---|---|
|
|
117
|
-
| Tailwind v2 | 2.4-8MB | under 10KB |
|
|
118
|
-
| EmilyUI v1 | 1.1MB | 10-50KB |
|
|
119
|
-
| Tailwind v3/v4 (JIT) | generates on demand | - |
|
|
76
|
+
## File Size (Typical)
|
|
120
77
|
|
|
121
|
-
|
|
78
|
+
| State | Size |
|
|
79
|
+
|-------|------|
|
|
80
|
+
| Full build | ~1.1 MB |
|
|
81
|
+
| After purge | 10–50 KB |
|
|
122
82
|
|
|
123
|
-
##
|
|
124
|
-
|
|
125
|
-
```
|
|
126
|
-
emily-css/
|
|
127
|
-
├── src/
|
|
128
|
-
│ ├── index.js - Main build script
|
|
129
|
-
│ ├── generators.js - Utility generation functions
|
|
130
|
-
│ ├── purge.js - Purge system
|
|
131
|
-
│ ├── purge-cmd.js - Purge CLI command
|
|
132
|
-
│ └── init.js - Interactive setup
|
|
133
|
-
├── dist/
|
|
134
|
-
│ ├── emily.css - Generated CSS
|
|
135
|
-
│ ├── emily.min.css - Minified CSS
|
|
136
|
-
│ ├── emily.purged.css - Purged CSS
|
|
137
|
-
│ └── emily.purged.min.css
|
|
138
|
-
├── showcase.html - Example components
|
|
139
|
-
├── emily.config.json - Your config
|
|
140
|
-
├── package.json
|
|
141
|
-
└── README.md
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
## Configuration
|
|
145
|
-
|
|
146
|
-
Edit `emily.config.json` to customise:
|
|
83
|
+
## Configuration Example
|
|
147
84
|
|
|
148
85
|
```json
|
|
149
86
|
{
|
|
150
87
|
"name": "My Brand",
|
|
151
|
-
"description": "Design system",
|
|
152
|
-
|
|
153
88
|
"baseUnit": "8px",
|
|
154
|
-
"baseFontSize": "16px",
|
|
155
89
|
"fontFamily": {
|
|
156
90
|
"heading": "lexend",
|
|
157
91
|
"body": "inter"
|
|
158
92
|
},
|
|
159
|
-
|
|
160
93
|
"colours": {
|
|
161
|
-
"primary": "#
|
|
162
|
-
"
|
|
163
|
-
"success": "#017f65",
|
|
164
|
-
"warning": "#ffc107",
|
|
165
|
-
"error": "#b20000",
|
|
166
|
-
"neutral": "#6b7280"
|
|
167
|
-
},
|
|
168
|
-
|
|
169
|
-
"breakpoints": {
|
|
170
|
-
"sm": "640px",
|
|
171
|
-
"md": "768px",
|
|
172
|
-
"lg": "1024px",
|
|
173
|
-
"xl": "1280px",
|
|
174
|
-
"2xl": "1536px"
|
|
94
|
+
"primary": "#2563EB",
|
|
95
|
+
"neutral": "#57534E"
|
|
175
96
|
},
|
|
176
|
-
|
|
177
97
|
"purge": {
|
|
178
|
-
"extensions": [".html", ".
|
|
98
|
+
"extensions": [".html", ".php", ".jsx", ".vue"]
|
|
179
99
|
}
|
|
180
100
|
}
|
|
181
101
|
```
|
|
182
102
|
|
|
183
|
-
After
|
|
103
|
+
After changes: `npx emily-css build`
|
|
184
104
|
|
|
185
|
-
|
|
186
|
-
npx emily-css build
|
|
187
|
-
```
|
|
105
|
+
## Component Showcase
|
|
188
106
|
|
|
189
|
-
|
|
107
|
+
After building, run `npm run emily:showcase` and visit `http://localhost:3456`. It contains production-ready, accessible components built with your exact brand.
|
|
190
108
|
|
|
191
|
-
EmilyUI
|
|
109
|
+
## EmilyUI vs emilyCSS
|
|
192
110
|
|
|
193
|
-
- **
|
|
194
|
-
- **
|
|
195
|
-
- **Sizing** - width (`w-`), height (`h-`), max-width, min-height
|
|
196
|
-
- **Positioning** - absolute, relative, fixed, sticky, top, right, bottom, left
|
|
197
|
-
- **Flexbox** - flex, flex-direction, justify-content, align-items, flex-wrap
|
|
198
|
-
- **Grid** - grid, grid-cols, grid-rows, grid-gap
|
|
199
|
-
- **Colours** - background (`bg-`), text, borders, accent for form controls
|
|
200
|
-
- **Typography** - font-size, font-weight, line-height, text-align
|
|
201
|
-
- **Borders** - border-width, border-style, border-colour, border-radius
|
|
202
|
-
- **Shadows** - box-shadow, text-shadow
|
|
203
|
-
- **Opacity** - opacity levels
|
|
204
|
-
- **Accessibility** - sr-only, focus-visible, motion-safe, forced-colors
|
|
205
|
-
- **State variants** - `hover:`, `focus-visible:`, `active:`, `disabled:`
|
|
206
|
-
- **Responsive variants** - `sm:`, `md:`, `lg:`, `xl:`, `2xl:`
|
|
111
|
+
- **EmilyUI** — The broader brand / ecosystem
|
|
112
|
+
- **emilyCSS** — The current product (`emily-css` npm package + CLI)
|
|
207
113
|
|
|
208
|
-
##
|
|
114
|
+
## Example Components
|
|
209
115
|
|
|
210
116
|
### Button
|
|
211
117
|
|
|
212
118
|
```html
|
|
213
|
-
<button class="px-
|
|
214
|
-
|
|
119
|
+
<button class="px-6 py-3 rounded-lg bg-primary-80 text-white hover:bg-primary-90 focus-visible:ring-2 focus-visible:ring-primary-50 font-medium">
|
|
120
|
+
Submit
|
|
215
121
|
</button>
|
|
216
122
|
```
|
|
217
123
|
|
|
218
124
|
### Responsive Card
|
|
219
125
|
|
|
220
126
|
```html
|
|
221
|
-
<div class="w-full md:w-96 p-
|
|
222
|
-
<h2 class="text-
|
|
223
|
-
<p class="mt-
|
|
127
|
+
<div class="w-full md:w-96 p-6 rounded-lg bg-white border border-neutral-30 shadow-sm">
|
|
128
|
+
<h2 class="text-2xl font-semibold text-neutral-90">Card Title</h2>
|
|
129
|
+
<p class="mt-3 text-neutral-70">Content goes here.</p>
|
|
224
130
|
</div>
|
|
225
131
|
```
|
|
226
132
|
|
|
227
|
-
### Accessible Form Input
|
|
228
|
-
|
|
229
|
-
```html
|
|
230
|
-
<label for="email" class="block text-sm font-medium text-neutral-80">
|
|
231
|
-
Email
|
|
232
|
-
</label>
|
|
233
|
-
<input
|
|
234
|
-
id="email"
|
|
235
|
-
type="email"
|
|
236
|
-
class="mt-1 w-full px-3 py-2 border-1 border-neutral-40 rounded-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-50"
|
|
237
|
-
/>
|
|
238
|
-
```
|
|
239
|
-
|
|
240
|
-
## Accessibility
|
|
241
|
-
|
|
242
|
-
All utilities are built with WCAG 2.2 AA in mind:
|
|
243
|
-
|
|
244
|
-
- **Focus rings** - Focus-visible states include proper colour contrast
|
|
245
|
-
- **Colour contrast** - All colour scales meet AA contrast ratios
|
|
246
|
-
- **Motion** - `motion-safe` and `motion-reduce` utilities for users with vestibular disorders
|
|
247
|
-
- **Screen reader support** - `.sr-only` utility for screen-reader-only content
|
|
248
|
-
- **Forced colours** - Utilities respect Windows High Contrast mode
|
|
249
|
-
|
|
250
|
-
## Testing
|
|
251
|
-
|
|
252
|
-
```bash
|
|
253
|
-
npm test
|
|
254
|
-
```
|
|
255
|
-
|
|
256
|
-
72 automated tests covering colour generation, utilities, variants, config integrity, and build output. All passing.
|
|
257
|
-
|
|
258
|
-
## Troubleshooting
|
|
259
|
-
|
|
260
|
-
### Styles not applying?
|
|
261
|
-
|
|
262
|
-
1. Check the responsive prefix: `.md\:flex` not `.md:flex`
|
|
263
|
-
2. Verify class name spelling
|
|
264
|
-
3. Clear browser cache and rebuild: `npx emily-css build`
|
|
265
|
-
|
|
266
|
-
### File size too large?
|
|
267
|
-
|
|
268
|
-
```bash
|
|
269
|
-
npx emily-css purge
|
|
270
|
-
```
|
|
271
|
-
|
|
272
|
-
### Config not applying?
|
|
273
|
-
|
|
274
|
-
1. Edit `emily.config.json`
|
|
275
|
-
2. Run `npx emily-css build`
|
|
276
|
-
3. No cache invalidation needed
|
|
277
|
-
|
|
278
133
|
## Fonts
|
|
279
134
|
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
Set `fontFamily` as an object to use different fonts for headings and body:
|
|
135
|
+
emilyCSS applies font stacks but does not include font files. Use `@fontsource` (recommended):
|
|
283
136
|
|
|
284
|
-
```
|
|
285
|
-
|
|
286
|
-
"heading": "lexend",
|
|
287
|
-
"body": "inter"
|
|
288
|
-
}
|
|
289
|
-
```
|
|
290
|
-
|
|
291
|
-
Or as a string if you want one font throughout:
|
|
292
|
-
|
|
293
|
-
```json
|
|
294
|
-
"fontFamily": "inter"
|
|
137
|
+
```bash
|
|
138
|
+
npm install @fontsource/inter @fontsource/lexend
|
|
295
139
|
```
|
|
296
140
|
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
To use a custom font, set `fontFamily` to any other value and add your own `@import` or `<link>` to your HTML before loading `emily.css`.
|
|
141
|
+
Then import the weights you need.
|
|
300
142
|
|
|
301
143
|
## Support
|
|
302
144
|
|
|
303
|
-
- Website
|
|
304
|
-
- GitHub
|
|
145
|
+
- **Website:** https://www.emilyui.com
|
|
146
|
+
- **GitHub:** https://github.com/andyjterry/emily-ui
|
|
305
147
|
|
|
306
148
|
## License
|
|
307
149
|
|
package/bin/emilyui.js
CHANGED
|
@@ -6,16 +6,45 @@ if (command === "init") {
|
|
|
6
6
|
require("../src/init.js");
|
|
7
7
|
} else if (command === "build") {
|
|
8
8
|
const { build } = require("../src/index.js");
|
|
9
|
-
build();
|
|
9
|
+
build({ keepFull: process.argv.includes("--keep-full") });
|
|
10
10
|
} else if (command === "purge") {
|
|
11
11
|
require("../src/purge-cmd.js");
|
|
12
|
+
} else if (command === "watch") {
|
|
13
|
+
require("../src/watch.js");
|
|
14
|
+
} else if (command === "showcase") {
|
|
15
|
+
require("../src/showcase.js");
|
|
16
|
+
} else if (command === "help") {
|
|
17
|
+
console.log(`
|
|
18
|
+
emily-css — Config-driven CSS framework generator
|
|
19
|
+
|
|
20
|
+
Commands:
|
|
21
|
+
emily-css init Set up a new project (interactive wizard)
|
|
22
|
+
emily-css build Generate production CSS to dist/emily.min.css
|
|
23
|
+
emily-css watch Dev mode: watch for config changes and rebuild
|
|
24
|
+
emily-css purge Scan project files and remove unused utilities
|
|
25
|
+
emily-css showcase Launch the component showcase in your browser
|
|
26
|
+
emily-css help Show this help text
|
|
27
|
+
|
|
28
|
+
npm scripts (added by init):
|
|
29
|
+
npm run emily:build Same as emily-css build
|
|
30
|
+
npm run emily:watch Same as emily-css watch
|
|
31
|
+
npm run emily:showcase Same as emily-css showcase
|
|
32
|
+
npm run emily:help Same as emily-css help
|
|
33
|
+
|
|
34
|
+
Docs: https://emilyui.dev
|
|
35
|
+
`);
|
|
12
36
|
} else {
|
|
13
37
|
console.log(`
|
|
14
|
-
emily-css
|
|
38
|
+
emily-css — Config-driven CSS framework generator
|
|
39
|
+
|
|
40
|
+
Usage:
|
|
41
|
+
emily-css init Set up a new project
|
|
42
|
+
emily-css build Generate production CSS
|
|
43
|
+
emily-css watch Dev mode: rebuild on changes
|
|
44
|
+
emily-css purge Remove unused utilities
|
|
45
|
+
emily-css showcase Browse components in your browser
|
|
46
|
+
emily-css help Full command reference
|
|
15
47
|
|
|
16
|
-
|
|
17
|
-
emily-css init Set up a new project
|
|
18
|
-
emily-css build Generate emily.css from your config
|
|
19
|
-
emily-css purge Remove unused utilities for production
|
|
48
|
+
Run emily-css help for more detail.
|
|
20
49
|
`);
|
|
21
50
|
}
|
package/package.json
CHANGED
|
@@ -1,22 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "emily-css",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.14",
|
|
4
4
|
"description": "A config-driven utility CSS framework. Define your brand once, generate the CSS.",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"bin": {
|
|
7
|
-
"emily-css": "
|
|
7
|
+
"emily-css": "bin/emilyui.js"
|
|
8
8
|
},
|
|
9
9
|
"files": [
|
|
10
10
|
"bin/",
|
|
11
11
|
"src/",
|
|
12
12
|
"README.md",
|
|
13
|
-
"LICENSE"
|
|
13
|
+
"LICENSE",
|
|
14
|
+
"CHANGELOG.md"
|
|
14
15
|
],
|
|
15
16
|
"scripts": {
|
|
16
17
|
"build": "node src/index.js",
|
|
17
18
|
"dev": "nodemon src/index.js",
|
|
18
19
|
"init": "node src/init.js",
|
|
19
|
-
"test": "node tests/test.js"
|
|
20
|
+
"test": "node tests/test.js",
|
|
21
|
+
"emily:showcase": "node src/showcase.js",
|
|
22
|
+
"commit": "node scripts/commit.js",
|
|
23
|
+
"release": "node scripts/release.js",
|
|
24
|
+
"ship": "node scripts/ship.js"
|
|
20
25
|
},
|
|
21
26
|
"keywords": [
|
|
22
27
|
"css",
|
|
@@ -36,5 +41,14 @@
|
|
|
36
41
|
},
|
|
37
42
|
"devDependencies": {
|
|
38
43
|
"nodemon": "^3.0.0"
|
|
44
|
+
},
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"boxen": "^5.1.2",
|
|
47
|
+
"chalk": "^4.1.2",
|
|
48
|
+
"chokidar": "^5.0.0",
|
|
49
|
+
"cross-spawn": "^7.0.6",
|
|
50
|
+
"emily-css": "^1.0.8",
|
|
51
|
+
"enquirer": "^2.4.1",
|
|
52
|
+
"ora": "^5.4.1"
|
|
39
53
|
}
|
|
40
54
|
}
|
package/src/generators.js
CHANGED
|
@@ -483,6 +483,38 @@ function containerUtilities() {
|
|
|
483
483
|
`;
|
|
484
484
|
}
|
|
485
485
|
|
|
486
|
+
// ============================================================================
|
|
487
|
+
// CODE BLOCK UTILITIES
|
|
488
|
+
// ============================================================================
|
|
489
|
+
// Styles pre/code elements to look like a VSCode Dark+ editor out of the box.
|
|
490
|
+
// All colours are fixed VSCode Dark+ values — not config-driven, because code
|
|
491
|
+
// editor chrome should always look like a code editor regardless of brand.
|
|
492
|
+
function codeUtilities() {
|
|
493
|
+
return `/* Code — window chrome */
|
|
494
|
+
.code-window { border-radius: 8px; overflow: hidden; border: 1px solid #3c3c3c; }
|
|
495
|
+
.code-title-bar { background-color: #2d2d2d; padding: 0.5rem 1rem; display: flex; align-items: center; gap: 0.5rem; border-bottom: 1px solid #3c3c3c; }
|
|
496
|
+
.code-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
|
|
497
|
+
.code-dot-red { background-color: #ff5f57; }
|
|
498
|
+
.code-dot-yellow { background-color: #ffbd2e; }
|
|
499
|
+
.code-dot-green { background-color: #28c840; }
|
|
500
|
+
.code-filename { font-family: "Menlo", "Monaco", "Courier New", monospace; font-size: 0.85rem; color: white; margin-left: 0.5rem; }
|
|
501
|
+
|
|
502
|
+
/* Code — VSCode Dark+ token colours */
|
|
503
|
+
.token-tag { color: #569cd6; }
|
|
504
|
+
.token-attr { color: #9cdcfe; }
|
|
505
|
+
.token-string { color: #ce9178; }
|
|
506
|
+
.token-number { color: #b5cea8; }
|
|
507
|
+
.token-variant { color: #4ec9b0; }
|
|
508
|
+
.token-utility { color: #dcdcaa; }
|
|
509
|
+
.token-colour { color: #6a9955; }
|
|
510
|
+
.token-comment { color: #6a9955; opacity: 0.75; font-style: italic; }
|
|
511
|
+
.token-keyword { color: #c586c0; }
|
|
512
|
+
.token-operator { color: #d4d4d4; }
|
|
513
|
+
.token-line-number { color: #858585; user-select: none; padding-right: 1rem; display: inline-block; min-width: 2rem; text-align: right; }
|
|
514
|
+
|
|
515
|
+
`;
|
|
516
|
+
}
|
|
517
|
+
|
|
486
518
|
module.exports = {
|
|
487
519
|
displayUtilities,
|
|
488
520
|
sizingUtilities,
|
|
@@ -502,5 +534,6 @@ module.exports = {
|
|
|
502
534
|
blendUtilities,
|
|
503
535
|
cursorUtilities,
|
|
504
536
|
accessibilityUtilities,
|
|
505
|
-
containerUtilities
|
|
537
|
+
containerUtilities,
|
|
538
|
+
codeUtilities
|
|
506
539
|
};
|