@lobergdesign/dot-grid 1.0.6 → 1.0.9
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 +0 -70
- package/package.json +5 -5
- package/.purgecssrc.json +0 -26
- package/purgecss.config.js +0 -77
package/README.md
CHANGED
|
@@ -263,76 +263,6 @@ Available: `.justify-start`, `.justify-end`, `.justify-center`, `.justify-betwee
|
|
|
263
263
|
<div class="grid-c-auto">Auto-sized</div>
|
|
264
264
|
```
|
|
265
265
|
|
|
266
|
-
## 🌲 Tree Shaking / PurgeCSS
|
|
267
|
-
|
|
268
|
-
Like Tailwind CSS, you can significantly reduce the CSS bundle size by removing unused classes using PurgeCSS or similar tools.
|
|
269
|
-
|
|
270
|
-
### Setup with PurgeCSS
|
|
271
|
-
|
|
272
|
-
1. **Install PurgeCSS:**
|
|
273
|
-
|
|
274
|
-
```bash
|
|
275
|
-
npm install --save-dev @fullhuman/postcss-purgecss
|
|
276
|
-
```
|
|
277
|
-
|
|
278
|
-
2. **Copy the configuration:**
|
|
279
|
-
|
|
280
|
-
Copy `purgecss.config.js` from the dot-grid package to your project root, or create your own:
|
|
281
|
-
|
|
282
|
-
```js
|
|
283
|
-
// purgecss.config.js
|
|
284
|
-
module.exports = {
|
|
285
|
-
content: ['./src/**/*.{html,js,jsx,ts,tsx}'],
|
|
286
|
-
css: ['./node_modules/@lobergdesign/dot-grid/dist/grid.css'],
|
|
287
|
-
safelist: {
|
|
288
|
-
greedy: [
|
|
289
|
-
/^grid-c-\d{1,2}$/,
|
|
290
|
-
/^grid-c-(sm|md|lg|xl|xxl)-\d{1,2}$/,
|
|
291
|
-
// ... see purgecss.config.js for full list
|
|
292
|
-
],
|
|
293
|
-
},
|
|
294
|
-
}
|
|
295
|
-
```
|
|
296
|
-
|
|
297
|
-
3. **Add to your build process:**
|
|
298
|
-
|
|
299
|
-
```json
|
|
300
|
-
// package.json
|
|
301
|
-
{
|
|
302
|
-
"scripts": {
|
|
303
|
-
"purge": "purgecss --config ./purgecss.config.js --output ./dist/grid.purged.css"
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
```
|
|
307
|
-
|
|
308
|
-
### With PostCSS
|
|
309
|
-
|
|
310
|
-
```js
|
|
311
|
-
// postcss.config.js
|
|
312
|
-
module.exports = {
|
|
313
|
-
plugins: [
|
|
314
|
-
require('@fullhuman/postcss-purgecss')({
|
|
315
|
-
content: ['./src/**/*.{html,js,jsx,ts,tsx}'],
|
|
316
|
-
safelist: {
|
|
317
|
-
greedy: [
|
|
318
|
-
/^grid-c-/,
|
|
319
|
-
/^grid-r-/,
|
|
320
|
-
/^place-/,
|
|
321
|
-
// Add more patterns as needed
|
|
322
|
-
],
|
|
323
|
-
},
|
|
324
|
-
}),
|
|
325
|
-
],
|
|
326
|
-
}
|
|
327
|
-
```
|
|
328
|
-
|
|
329
|
-
### Expected Results
|
|
330
|
-
|
|
331
|
-
- **Full build:** ~28KB / 19KB minified
|
|
332
|
-
- **With PurgeCSS:** Typically 2-5KB depending on usage
|
|
333
|
-
|
|
334
|
-
See `purgecss.config.js` in the package for complete safelist patterns.
|
|
335
|
-
|
|
336
266
|
## 🎨 Customization
|
|
337
267
|
|
|
338
268
|
Override CSS custom properties in your own stylesheet:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobergdesign/dot-grid",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"description": "A modern, flexible 12-column CSS Grid system with container queries, fluid layouts, and subgrid support",
|
|
5
5
|
"main": "dist/grid.css",
|
|
6
6
|
"style": "dist/grid.css",
|
|
@@ -19,15 +19,14 @@
|
|
|
19
19
|
"dist",
|
|
20
20
|
"src",
|
|
21
21
|
"README.md",
|
|
22
|
-
"LICENSE"
|
|
23
|
-
"purgecss.config.js",
|
|
24
|
-
".purgecssrc.json"
|
|
22
|
+
"LICENSE"
|
|
25
23
|
],
|
|
26
24
|
"scripts": {
|
|
27
25
|
"build": "npm run build:css && npm run build:min",
|
|
28
26
|
"build:css": "sass src/grid.scss dist/grid.css --no-source-map",
|
|
29
27
|
"build:min": "sass src/grid.scss dist/grid.min.css --no-source-map --style=compressed",
|
|
30
28
|
"watch": "sass src/grid.scss dist/grid.css --watch",
|
|
29
|
+
"release": "npm run build && changelogen --release && npm publish && git push --follow-tags",
|
|
31
30
|
"prepublishOnly": "npm run build",
|
|
32
31
|
"deploy": "npx np --no-tests"
|
|
33
32
|
},
|
|
@@ -59,7 +58,8 @@
|
|
|
59
58
|
"homepage": "https://github.com/lobergdesign/dot-grid#readme",
|
|
60
59
|
"devDependencies": {
|
|
61
60
|
"sass": "^1.80.0",
|
|
62
|
-
"np": "^10.2.0"
|
|
61
|
+
"np": "^10.2.0",
|
|
62
|
+
"changelogen": "^0.6.2"
|
|
63
63
|
},
|
|
64
64
|
"engines": {
|
|
65
65
|
"node": ">=14.0.0"
|
package/.purgecssrc.json
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"content": [
|
|
3
|
-
"./src/**/*.{html,js,jsx,ts,tsx,vue,svelte}",
|
|
4
|
-
"./public/**/*.html"
|
|
5
|
-
],
|
|
6
|
-
"css": ["./node_modules/@lobergdesign/dot-grid/dist/grid.css"],
|
|
7
|
-
"safelist": {
|
|
8
|
-
"standard": ["grid-w", "grid-r", "no-gap", "hidden"],
|
|
9
|
-
"greedy": [
|
|
10
|
-
"/^grid-c-\\d{1,2}$/",
|
|
11
|
-
"/^grid-c-start-\\d{1,2}$/",
|
|
12
|
-
"/^grid-c-(sm|md|lg|xl|xxl)-\\d{1,2}$/",
|
|
13
|
-
"/^grid-c-start-(sm|md|lg|xl|xxl)-\\d{1,2}$/",
|
|
14
|
-
"/^grid-c-vp-(sm|md|lg|xl|xxl)-\\d{1,2}$/",
|
|
15
|
-
"/^grid-c-start-vp-(sm|md|lg|xl|xxl)-\\d{1,2}$/",
|
|
16
|
-
"/^grid-[rc]-subgrid$/",
|
|
17
|
-
"/^grid-r-(fluid-[234]|ram|intrinsic|even|dense|flexible)$/",
|
|
18
|
-
"/^grid-auto-(fit|fill)$/",
|
|
19
|
-
"/^place-[tcb]-[lcr]$/",
|
|
20
|
-
"/^justify-.*$/",
|
|
21
|
-
"/^grid-c-(min|max|fit|auto|fluid)$/",
|
|
22
|
-
"/^(hidden|block|grid|flex)-(sm|md|lg|xl|xxl)$/",
|
|
23
|
-
"/^(hidden|block|grid|flex)-vp-(sm|md|lg|xl|xxl)$/"
|
|
24
|
-
]
|
|
25
|
-
}
|
|
26
|
-
}
|
package/purgecss.config.js
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
// PurgeCSS Configuration for dot-grid
|
|
2
|
-
// This is an example configuration for end-users
|
|
3
|
-
// Copy this to your project root and customize as needed
|
|
4
|
-
|
|
5
|
-
module.exports = {
|
|
6
|
-
content: [
|
|
7
|
-
// Scan your source files for class names
|
|
8
|
-
'./src/**/*.{html,js,jsx,ts,tsx,vue,svelte}',
|
|
9
|
-
'./public/**/*.html',
|
|
10
|
-
// Add more paths as needed
|
|
11
|
-
],
|
|
12
|
-
|
|
13
|
-
css: [
|
|
14
|
-
// Path to your compiled dot-grid CSS
|
|
15
|
-
'./node_modules/@lobergdesign/dot-grid/dist/grid.css',
|
|
16
|
-
// Or if you import the source:
|
|
17
|
-
// './path/to/compiled/css/with/dot-grid.css'
|
|
18
|
-
],
|
|
19
|
-
|
|
20
|
-
// Safelist: patterns that should never be purged
|
|
21
|
-
safelist: {
|
|
22
|
-
// Safelist all dot-grid core classes
|
|
23
|
-
standard: [
|
|
24
|
-
'grid-w',
|
|
25
|
-
'grid-r',
|
|
26
|
-
'no-gap',
|
|
27
|
-
'hidden',
|
|
28
|
-
],
|
|
29
|
-
|
|
30
|
-
// Safelist patterns using regex
|
|
31
|
-
greedy: [
|
|
32
|
-
// Grid column classes: grid-c-1 through grid-c-12
|
|
33
|
-
/^grid-c-\d{1,2}$/,
|
|
34
|
-
|
|
35
|
-
// Grid column start: grid-c-start-1 through grid-c-start-12
|
|
36
|
-
/^grid-c-start-\d{1,2}$/,
|
|
37
|
-
|
|
38
|
-
// Responsive column classes: grid-c-sm-6, grid-c-md-4, etc.
|
|
39
|
-
/^grid-c-(sm|md|lg|xl|xxl)-\d{1,2}$/,
|
|
40
|
-
|
|
41
|
-
// Responsive start: grid-c-start-sm-1, etc.
|
|
42
|
-
/^grid-c-start-(sm|md|lg|xl|xxl)-\d{1,2}$/,
|
|
43
|
-
|
|
44
|
-
// Viewport-based: grid-c-vp-md-6, etc.
|
|
45
|
-
/^grid-c-vp-(sm|md|lg|xl|xxl)-\d{1,2}$/,
|
|
46
|
-
/^grid-c-start-vp-(sm|md|lg|xl|xxl)-\d{1,2}$/,
|
|
47
|
-
|
|
48
|
-
// Subgrid classes
|
|
49
|
-
/^grid-[rc]-subgrid$/,
|
|
50
|
-
|
|
51
|
-
// Fluid row classes
|
|
52
|
-
/^grid-r-(fluid-[234]|ram|intrinsic|even|dense|flexible)$/,
|
|
53
|
-
|
|
54
|
-
// Grid auto classes
|
|
55
|
-
/^grid-auto-(fit|fill)$/,
|
|
56
|
-
|
|
57
|
-
// Placement utilities: place-t-l, place-c-c, etc.
|
|
58
|
-
/^place-[tcb]-[lcr]$/,
|
|
59
|
-
|
|
60
|
-
// Justify utilities
|
|
61
|
-
/^justify-(start|end|center|between|around|evenly|space-).*$/,
|
|
62
|
-
|
|
63
|
-
// Sizing utilities
|
|
64
|
-
/^grid-c-(min|max|fit|auto|fluid)$/,
|
|
65
|
-
|
|
66
|
-
// Display utilities (responsive)
|
|
67
|
-
/^(hidden|block|grid|flex)-(sm|md|lg|xl|xxl)$/,
|
|
68
|
-
/^(hidden|block|grid|flex)-vp-(sm|md|lg|xl|xxl)$/,
|
|
69
|
-
],
|
|
70
|
-
},
|
|
71
|
-
|
|
72
|
-
// Extract dynamic class names from JavaScript strings
|
|
73
|
-
defaultExtractor: (content) => {
|
|
74
|
-
// Match class names in strings, including dynamically generated ones
|
|
75
|
-
return content.match(/[A-Za-z0-9-_:/]+/g) || [];
|
|
76
|
-
},
|
|
77
|
-
};
|