@hiscovega/grisso 2.0.0-rc.2 → 2.0.0-rc.3

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.
Files changed (3) hide show
  1. package/README.md +24 -13
  2. package/package.json +6 -2
  3. package/postcss.cjs +19 -0
package/README.md CHANGED
@@ -250,7 +250,7 @@ Alternativa al uso de clases directamente en HTML. Permite usar clases Grisso de
250
250
  npm install -D postcss
251
251
  ```
252
252
 
253
- **Configuración PostCSS:**
253
+ **Configuración PostCSS (ESM):**
254
254
 
255
255
  ```js
256
256
  // postcss.config.mjs
@@ -261,6 +261,17 @@ export default {
261
261
  };
262
262
  ```
263
263
 
264
+ **Configuración PostCSS (CommonJS):**
265
+
266
+ ```js
267
+ // postcss.config.js
268
+ const grissoApply = require("@hiscovega/grisso/postcss");
269
+
270
+ module.exports = {
271
+ plugins: [grissoApply({ config: "./grisso.config.mjs" })],
272
+ };
273
+ ```
274
+
264
275
  **Uso en CSS Modules:**
265
276
 
266
277
  ```css
@@ -430,19 +441,19 @@ Importa los tokens antes que Grisso en tu CSS global:
430
441
  ### Nomenclatura
431
442
 
432
443
  ```
433
- {breakpoint}-{state}-{propiedad}-{escala}
444
+ {breakpoint}:{state}:{propiedad}-{escala}
434
445
  ```
435
446
 
436
- Ejemplos: `flex`, `tablet-flex`, `p-md`, `hover-bg-1`, `focus-border-1`, `tablet-hover-p-sm`, `desktop-mt-lg`, `w-1/2`
447
+ Ejemplos: `flex`, `tablet:flex`, `p-md`, `hover:bg-1`, `focus:border-1`, `tablet:hover:p-sm`, `desktop:mt-lg`, `w-1/2`
437
448
 
438
449
  ### Breakpoints (mobile-first)
439
450
 
440
451
  | Prefijo | Tamaño |
441
452
  | --------------- | ------- |
442
453
  | _(sin prefijo)_ | 0px+ |
443
- | `tablet-` | 700px+ |
444
- | `desktop-` | 1024px+ |
445
- | `ultrawide-` | 1680px+ |
454
+ | `tablet:` | 700px+ |
455
+ | `desktop:` | 1024px+ |
456
+ | `ultrawide:` | 1680px+ |
446
457
 
447
458
  ### State variants
448
459
 
@@ -450,13 +461,13 @@ Todas las utilidades generan variantes de estado automáticamente. El tree-shaki
450
461
 
451
462
  | Prefijo | Pseudo-clase |
452
463
  | ------------------ | ---------------- |
453
- | `hover-` | `:hover` |
454
- | `focus-` | `:focus` |
455
- | `focus-visible-` | `:focus-visible` |
456
- | `active-` | `:active` |
457
- | `disabled-` | `:disabled` |
464
+ | `hover:` | `:hover` |
465
+ | `focus:` | `:focus` |
466
+ | `focus-visible:` | `:focus-visible` |
467
+ | `active:` | `:active` |
468
+ | `disabled:` | `:disabled` |
458
469
 
459
- Se combinan con breakpoints: `tablet-hover-bg-1`, `desktop-focus-p-sm`.
470
+ Se combinan con breakpoints: `tablet:hover:bg-1`, `desktop:focus:p-sm`.
460
471
 
461
472
  Orden del cascade: base → state → responsive → responsive+state.
462
473
 
@@ -681,7 +692,7 @@ import { simpleClass, complexClass } from "../generators.js";
681
692
  // Clase simple — genera .flex + variantes de estado y responsive
682
693
  simpleClass("flex", "display", "flex", breakpoints, states);
683
694
 
684
- // Clase basada en tokens — genera .p-xs, .hover-p-xs:hover, .tablet-p-xs, etc.
695
+ // Clase basada en tokens — genera .p-xs, .hover\:p-xs:hover, .tablet\:p-xs, etc.
685
696
  complexClass("p-", "padding", spacing, breakpoints, states);
686
697
  ```
687
698
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hiscovega/grisso",
3
3
  "description": "Griddo CSS utility class library",
4
- "version": "2.0.0-rc.2",
4
+ "version": "2.0.0-rc.3",
5
5
  "license": "UNLICENSED",
6
6
  "private": false,
7
7
  "type": "module",
@@ -12,7 +12,10 @@
12
12
  "./build": "./lib/build.js",
13
13
  "./tokens": "./lib/tokens.js",
14
14
  "./config": "./lib/defaults.js",
15
- "./postcss": "./lib/postcss.js",
15
+ "./postcss": {
16
+ "import": "./lib/postcss.js",
17
+ "require": "./postcss.cjs"
18
+ },
16
19
  "./tokens-example.css": "./tokens-example.css"
17
20
  },
18
21
  "engines": {
@@ -24,6 +27,7 @@
24
27
  "files": [
25
28
  "dist/",
26
29
  "lib/",
30
+ "postcss.cjs",
27
31
  "tokens-example.css",
28
32
  "vscode-css-custom-data.json",
29
33
  "README.md"
package/postcss.cjs ADDED
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Wrapper CommonJS del plugin PostCSS de Grisso.
3
+ * Carga dinámicamente el módulo ESM — funciona porque el hook Once es async.
4
+ */
5
+ let _mod;
6
+
7
+ const plugin = (opts) => {
8
+ let delegate;
9
+ return {
10
+ postcssPlugin: "grisso-apply",
11
+ async Once(root, helpers) {
12
+ if (!_mod) _mod = await import("./lib/postcss.js");
13
+ if (!delegate) delegate = _mod.default(opts);
14
+ return delegate.Once(root, helpers);
15
+ },
16
+ };
17
+ };
18
+ plugin.postcss = true;
19
+ module.exports = plugin;