holygrail5 1.0.17 → 1.0.19
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/config.json +12 -0
- package/dist/developer-guide.md +628 -0
- package/dist/guide-styles.css +21 -0
- package/dist/index.html +193 -29
- package/dist/skills.html +656 -0
- package/dist/themes/dutti-demo.html +13 -6
- package/dist/themes/dutti.css +241 -1
- package/package.json +1 -1
- package/src/build/build-orchestrator.js +20 -0
- package/src/build/skills-generator.js +454 -0
- package/src/build/theme-transformer.js +9 -6
- package/src/dev-server.js +67 -31
- package/src/docs-generator/guide-styles.css +21 -1
- package/src/docs-generator/html-generator.js +192 -24
- package/src/skills.html +582 -0
- package/themes/dutti/_buttons.css +4 -5
- package/themes/dutti/_containers.css +174 -0
- package/themes/dutti/theme.css +1 -0
package/config.json
CHANGED
|
@@ -610,6 +610,18 @@
|
|
|
610
610
|
}
|
|
611
611
|
},
|
|
612
612
|
"typo": {
|
|
613
|
+
"title-xxl": {
|
|
614
|
+
"fontFamily": "\"ms-serif\", serif",
|
|
615
|
+
"fontWeight": "300",
|
|
616
|
+
"mobile": {
|
|
617
|
+
"fontSize": "24px",
|
|
618
|
+
"lineHeight": "1"
|
|
619
|
+
},
|
|
620
|
+
"desktop": {
|
|
621
|
+
"fontSize": "24px",
|
|
622
|
+
"lineHeight": "1"
|
|
623
|
+
}
|
|
624
|
+
},
|
|
613
625
|
"h2": {
|
|
614
626
|
"fontFamily": "arial, sans-serif",
|
|
615
627
|
"fontWeight": "900",
|
|
@@ -0,0 +1,628 @@
|
|
|
1
|
+
# HolyGrail 5 — Guía completa de maquetación
|
|
2
|
+
|
|
3
|
+
Referencia completa para desarrolladores que usan HolyGrail 5. Cubre instalación, configuración, y todas las clases CSS disponibles: colores, spacing, tipografía, helpers, grid, aspect ratios y temas.
|
|
4
|
+
|
|
5
|
+
## Instalación en tu proyecto
|
|
6
|
+
|
|
7
|
+
### npm
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install holygrail5
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### Importar el CSS
|
|
14
|
+
|
|
15
|
+
Una vez instalado, importa el CSS generado en tu proyecto. Elige el método según tu stack:
|
|
16
|
+
|
|
17
|
+
**HTML directo:**
|
|
18
|
+
|
|
19
|
+
```html
|
|
20
|
+
<link rel="stylesheet" href="node_modules/holygrail5/dist/output.css">
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
**Bundler (Vite, Webpack, etc.):**
|
|
24
|
+
|
|
25
|
+
```js
|
|
26
|
+
import 'holygrail5/dist/output';
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
**React / Next.js** (en tu layout o _app):
|
|
30
|
+
|
|
31
|
+
```js
|
|
32
|
+
import 'holygrail5/dist/output';
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
**Con tema Dutti** (opcional — importar después del base):
|
|
36
|
+
|
|
37
|
+
```js
|
|
38
|
+
import 'holygrail5/dist/output';
|
|
39
|
+
import 'holygrail5/dist/dutti';
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
**CodePen / JSFiddle / playground online:**
|
|
43
|
+
|
|
44
|
+
```html
|
|
45
|
+
<link rel="stylesheet" href="https://unpkg.com/holygrail5/dist/output.css">
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Con tema Dutti:
|
|
49
|
+
|
|
50
|
+
```html
|
|
51
|
+
<link rel="stylesheet" href="https://unpkg.com/holygrail5/dist/output.css">
|
|
52
|
+
<link rel="stylesheet" href="https://unpkg.com/holygrail5/dist/themes/dutti.css">
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
En CodePen, pega la URL en **Settings → CSS → Add External Stylesheets**.
|
|
56
|
+
|
|
57
|
+
### Generar CSS personalizado
|
|
58
|
+
|
|
59
|
+
Si necesitas personalizar el design system (colores, breakpoints, spacing, etc.), copia el `config.json` a tu proyecto y genera tu propio CSS:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
# Copiar config al proyecto
|
|
63
|
+
cp node_modules/holygrail5/config.json ./hg5-config.json
|
|
64
|
+
|
|
65
|
+
# Editar hg5-config.json con tus valores
|
|
66
|
+
|
|
67
|
+
# Generar CSS personalizado
|
|
68
|
+
npx holygrail5
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Esto genera `dist/output.css` con las clases adaptadas a tu configuración.
|
|
72
|
+
|
|
73
|
+
### Desarrollo en caliente
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
# Watch mode — regenera CSS al cambiar config.json
|
|
77
|
+
npm run dev
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Antes de maquetar
|
|
81
|
+
|
|
82
|
+
Siempre consulta el `config.json` del proyecto antes de maquetar. Todo el CSS se genera desde ese archivo. Las clases disponibles dependen directamente de lo que esté configurado ahí.
|
|
83
|
+
|
|
84
|
+
El prefijo por defecto es `hg`. Todas las clases de helpers usan este prefijo (`.hg-d-flex`), mientras que las clases de spacing no llevan prefijo (`.p-16`, `.m-8`).
|
|
85
|
+
|
|
86
|
+
## Variables CSS
|
|
87
|
+
|
|
88
|
+
HolyGrail 5 genera variables CSS en `:root` que son la base de todo el sistema. Nunca hardcodees valores — usa siempre las variables.
|
|
89
|
+
|
|
90
|
+
### Colores
|
|
91
|
+
|
|
92
|
+
Definidos en `config.colors`. Cada color genera una variable `--hg-color-{nombre}`.
|
|
93
|
+
|
|
94
|
+
```css
|
|
95
|
+
/* Uso en CSS */
|
|
96
|
+
color: var(--hg-color-primary);
|
|
97
|
+
background: var(--hg-color-vanilla);
|
|
98
|
+
border-color: var(--hg-color-error);
|
|
99
|
+
|
|
100
|
+
/* Uso inline en HTML (cuando no hay clase específica) */
|
|
101
|
+
<div style="color: var(--hg-color-dark-grey)">Texto</div>
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Colores disponibles por defecto: `white`, `black`, `dark-grey`, `middle-grey`, `light-grey`, `grey-ultra`, `orange`, `mustard`, `primary`, `error`, `info`, `success`, `warning`, `feel`, `feel-dark`, `special`, `vanilla`, `silver`, `gold`, `platinum`, `charcoal`, `bg-light`, `sk-grey`, `bg-cream`.
|
|
105
|
+
|
|
106
|
+
### Spacing
|
|
107
|
+
|
|
108
|
+
Definido en `config.spacingMap`. Cada valor genera `--hg-spacing-{key}`.
|
|
109
|
+
|
|
110
|
+
```css
|
|
111
|
+
/* Variables de spacing */
|
|
112
|
+
--hg-spacing-0: 0;
|
|
113
|
+
--hg-spacing-4: 0.25rem;
|
|
114
|
+
--hg-spacing-8: 0.5rem;
|
|
115
|
+
--hg-spacing-16: 1rem;
|
|
116
|
+
--hg-spacing-24: 1.5rem;
|
|
117
|
+
--hg-spacing-32: 2rem;
|
|
118
|
+
/* ... hasta 160 */
|
|
119
|
+
|
|
120
|
+
/* Porcentajes */
|
|
121
|
+
--hg-spacing-50-percent: 50%;
|
|
122
|
+
--hg-spacing-100-percent: 100%;
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Los valores px se convierten automáticamente a rem (base 16px).
|
|
126
|
+
|
|
127
|
+
### Tipografía
|
|
128
|
+
|
|
129
|
+
Las variables tipográficas se generan automáticamente y se deduplicam para evitar repeticiones:
|
|
130
|
+
|
|
131
|
+
```css
|
|
132
|
+
--hg-typo-font-family-primary: arial, sans-serif;
|
|
133
|
+
--hg-typo-font-family-secondary: "ms-serif", serif;
|
|
134
|
+
--hg-typo-font-size-12: 0.75rem;
|
|
135
|
+
--hg-typo-font-size-14: 0.875rem;
|
|
136
|
+
--hg-typo-font-size-24: 1.5rem;
|
|
137
|
+
--hg-typo-line-height-1-2: 1.2;
|
|
138
|
+
--hg-typo-line-height-1-5: 1.5;
|
|
139
|
+
--hg-typo-font-weight-100: 100;
|
|
140
|
+
--hg-typo-font-weight-700: 700;
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## Spacing — Clases de padding y margin
|
|
144
|
+
|
|
145
|
+
El generador crea clases de spacing para cada valor en `spacingMap`. Las clases no llevan prefijo `hg-` para mayor brevedad.
|
|
146
|
+
|
|
147
|
+
### Padding
|
|
148
|
+
|
|
149
|
+
| Clase | Propiedad CSS | Ejemplo |
|
|
150
|
+
|-------|--------------|---------|
|
|
151
|
+
| `.p-{key}` | padding (4 lados) | `.p-16` → 1rem |
|
|
152
|
+
| `.pt-{key}` | padding-top | `.pt-24` → 1.5rem |
|
|
153
|
+
| `.pb-{key}` | padding-bottom | `.pb-8` → 0.5rem |
|
|
154
|
+
| `.pl-{key}` | padding-inline-start (left) | `.pl-32` |
|
|
155
|
+
| `.pr-{key}` | padding-inline-end (right) | `.pr-0` |
|
|
156
|
+
| `.hg-px-{key}` | padding-inline (horizontal) | `.hg-px-16` |
|
|
157
|
+
| `.hg-py-{key}` | padding-block (vertical) | `.hg-py-24` |
|
|
158
|
+
|
|
159
|
+
### Margin
|
|
160
|
+
|
|
161
|
+
| Clase | Propiedad CSS | Ejemplo |
|
|
162
|
+
|-------|--------------|---------|
|
|
163
|
+
| `.m-{key}` | margin (4 lados) | `.m-16` |
|
|
164
|
+
| `.mt-{key}` | margin-top | `.mt-32` |
|
|
165
|
+
| `.mb-{key}` | margin-bottom | `.mb-8` |
|
|
166
|
+
| `.ml-{key}` | margin-inline-start (left) | `.ml-0` |
|
|
167
|
+
| `.mr-{key}` | margin-inline-end (right) | `.mr-16` |
|
|
168
|
+
| `.hg-mx-{key}` | margin-inline (horizontal) | `.hg-mx-24` |
|
|
169
|
+
| `.hg-my-{key}` | margin-block (vertical) | `.hg-my-16` |
|
|
170
|
+
|
|
171
|
+
### Variantes responsive
|
|
172
|
+
|
|
173
|
+
Todas las clases de spacing tienen variante desktop con prefijo `md\:`:
|
|
174
|
+
|
|
175
|
+
```html
|
|
176
|
+
<!-- 8px de padding en mobile, 32px en desktop -->
|
|
177
|
+
<div class="p-8 md:p-32">Contenido</div>
|
|
178
|
+
|
|
179
|
+
<!-- Sin margen en mobile, 24px abajo en desktop -->
|
|
180
|
+
<div class="mb-0 md:mb-24">Contenido</div>
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### Variante !important
|
|
184
|
+
|
|
185
|
+
Los keys listados en `spacingImportant` generan clases con `!important`:
|
|
186
|
+
|
|
187
|
+
```html
|
|
188
|
+
<div class="p-0!">Padding 0 con !important</div>
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
## Helpers de layout
|
|
192
|
+
|
|
193
|
+
Todas las clases de helpers llevan el prefijo `hg-`. Se configuran en `config.helpers`. Cada helper puede tener variante responsive `md\:`.
|
|
194
|
+
|
|
195
|
+
### Display
|
|
196
|
+
|
|
197
|
+
```html
|
|
198
|
+
<div class="hg-d-flex">Flex</div>
|
|
199
|
+
<div class="hg-d-block">Block</div>
|
|
200
|
+
<div class="hg-d-none">Oculto</div>
|
|
201
|
+
<div class="hg-d-inline-block">Inline block</div>
|
|
202
|
+
<div class="hg-d-inline-flex">Inline flex</div>
|
|
203
|
+
<div class="hg-d-contents">Contents</div>
|
|
204
|
+
|
|
205
|
+
<!-- Responsive: oculto en mobile, visible en desktop -->
|
|
206
|
+
<div class="hg-d-none md:hg-d-block">Solo desktop</div>
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
### Flexbox
|
|
210
|
+
|
|
211
|
+
```html
|
|
212
|
+
<!-- Dirección -->
|
|
213
|
+
<div class="hg-flex-row">Horizontal</div>
|
|
214
|
+
<div class="hg-flex-column">Vertical</div>
|
|
215
|
+
|
|
216
|
+
<!-- Wrap -->
|
|
217
|
+
<div class="hg-flex-wrap">Wrap</div>
|
|
218
|
+
<div class="hg-flex-nowrap">No wrap</div>
|
|
219
|
+
|
|
220
|
+
<!-- Grow / Shrink -->
|
|
221
|
+
<div class="hg-grow-1">Crece</div>
|
|
222
|
+
<div class="hg-shrink-0">No encoge</div>
|
|
223
|
+
|
|
224
|
+
<!-- Flex shorthand -->
|
|
225
|
+
<div class="hg-flex-1">flex: 1 1 0%</div>
|
|
226
|
+
<div class="hg-flex-auto">flex: 1 1 auto</div>
|
|
227
|
+
<div class="hg-flex-none">flex: none</div>
|
|
228
|
+
|
|
229
|
+
<!-- Basis -->
|
|
230
|
+
<div class="hg-basis-auto">Basis auto</div>
|
|
231
|
+
<div class="hg-basis-full">Basis 100%</div>
|
|
232
|
+
|
|
233
|
+
<!-- Order -->
|
|
234
|
+
<div class="hg-order-1">Orden 1</div>
|
|
235
|
+
<div class="hg-order-first">Primero (-9999)</div>
|
|
236
|
+
<div class="hg-order-last">Último (9999)</div>
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
### Alineación
|
|
240
|
+
|
|
241
|
+
```html
|
|
242
|
+
<!-- Justify content (eje principal) -->
|
|
243
|
+
<div class="hg-d-flex hg-justify-start">Inicio</div>
|
|
244
|
+
<div class="hg-d-flex hg-justify-center">Centro</div>
|
|
245
|
+
<div class="hg-d-flex hg-justify-end">Final</div>
|
|
246
|
+
<div class="hg-d-flex hg-justify-between">Space between</div>
|
|
247
|
+
<div class="hg-d-flex hg-justify-around">Space around</div>
|
|
248
|
+
<div class="hg-d-flex hg-justify-evenly">Space evenly</div>
|
|
249
|
+
|
|
250
|
+
<!-- Align items (eje cruzado) -->
|
|
251
|
+
<div class="hg-d-flex hg-items-start">Arriba</div>
|
|
252
|
+
<div class="hg-d-flex hg-items-center">Centro vertical</div>
|
|
253
|
+
<div class="hg-d-flex hg-items-end">Abajo</div>
|
|
254
|
+
<div class="hg-d-flex hg-items-baseline">Baseline</div>
|
|
255
|
+
<div class="hg-d-flex hg-items-stretch">Stretch</div>
|
|
256
|
+
|
|
257
|
+
<!-- Align content (múltiples líneas) -->
|
|
258
|
+
<div class="hg-d-flex hg-flex-wrap hg-content-center">Centro</div>
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
### Gap (usa spacingMap)
|
|
262
|
+
|
|
263
|
+
```html
|
|
264
|
+
<div class="hg-d-flex hg-gap-8">Gap 8px</div>
|
|
265
|
+
<div class="hg-d-flex hg-gap-16">Gap 16px</div>
|
|
266
|
+
<div class="hg-d-flex hg-gap-24">Gap 24px</div>
|
|
267
|
+
<div class="hg-d-flex hg-gap-y-16">Row gap 16px</div>
|
|
268
|
+
<div class="hg-d-flex hg-gap-x-8">Column gap 8px</div>
|
|
269
|
+
|
|
270
|
+
<!-- Responsive -->
|
|
271
|
+
<div class="hg-d-flex hg-gap-8 md:hg-gap-24">8px mobile, 24px desktop</div>
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
### Dimensiones
|
|
275
|
+
|
|
276
|
+
```html
|
|
277
|
+
<!-- Width -->
|
|
278
|
+
<div class="hg-w-100-percent">100%</div>
|
|
279
|
+
<div class="hg-w-50-percent">50%</div>
|
|
280
|
+
<div class="hg-w-auto">Auto</div>
|
|
281
|
+
<div class="hg-w-fit-content">Fit content</div>
|
|
282
|
+
<div class="hg-w-100vw">100vw</div>
|
|
283
|
+
|
|
284
|
+
<!-- Height -->
|
|
285
|
+
<div class="hg-h-100-percent">100%</div>
|
|
286
|
+
<div class="hg-h-100vh">100vh</div>
|
|
287
|
+
<div class="hg-h-100dvh">100dvh (dynamic)</div>
|
|
288
|
+
<div class="hg-h-auto">Auto</div>
|
|
289
|
+
|
|
290
|
+
<!-- Min height -->
|
|
291
|
+
<div class="hg-min-h-100vh">Min 100vh</div>
|
|
292
|
+
<div class="hg-min-h-100dvh">Min 100dvh</div>
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
### Posicionamiento
|
|
296
|
+
|
|
297
|
+
```html
|
|
298
|
+
<div class="hg-position-relative">Relative</div>
|
|
299
|
+
<div class="hg-position-absolute">Absolute</div>
|
|
300
|
+
<div class="hg-position-fixed">Fixed</div>
|
|
301
|
+
<div class="hg-position-sticky">Sticky</div>
|
|
302
|
+
|
|
303
|
+
<!-- Z-index -->
|
|
304
|
+
<div class="hg-z-10">z-index: 10</div>
|
|
305
|
+
<div class="hg-z-50">z-index: 50</div>
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
### Margin auto (centrado)
|
|
309
|
+
|
|
310
|
+
```html
|
|
311
|
+
<div class="hg-mx-auto">Centrado horizontal (margin: 0 auto)</div>
|
|
312
|
+
<div class="hg-ml-auto">Alinear derecha</div>
|
|
313
|
+
<div class="hg-mr-auto">Alinear izquierda</div>
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
### Texto
|
|
317
|
+
|
|
318
|
+
```html
|
|
319
|
+
<div class="hg-text-left">Izquierda</div>
|
|
320
|
+
<div class="hg-text-center">Centro</div>
|
|
321
|
+
<div class="hg-text-right">Derecha</div>
|
|
322
|
+
<div class="hg-text-justify">Justificado</div>
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
### Overflow
|
|
326
|
+
|
|
327
|
+
```html
|
|
328
|
+
<div class="hg-overflow-hidden">Hidden</div>
|
|
329
|
+
<div class="hg-overflow-auto">Auto</div>
|
|
330
|
+
<div class="hg-overflow-x-auto">Scroll horizontal</div>
|
|
331
|
+
<div class="hg-overflow-y-hidden">Sin scroll vertical</div>
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
### Visibilidad y opacidad
|
|
335
|
+
|
|
336
|
+
```html
|
|
337
|
+
<div class="hg-visibility-hidden">Invisible (ocupa espacio)</div>
|
|
338
|
+
<div class="hg-opacity-0">Transparente</div>
|
|
339
|
+
<div class="hg-opacity-50">50% opacidad</div>
|
|
340
|
+
<div class="hg-opacity-100">Totalmente visible</div>
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
### Cursor e interacción
|
|
344
|
+
|
|
345
|
+
```html
|
|
346
|
+
<div class="hg-cursor-pointer">Pointer</div>
|
|
347
|
+
<div class="hg-cursor-not-allowed">No permitido</div>
|
|
348
|
+
<div class="hg-cursor-grab">Grab</div>
|
|
349
|
+
<div class="hg-pointer-events-none">Sin eventos</div>
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
### Object fit (imágenes)
|
|
353
|
+
|
|
354
|
+
```html
|
|
355
|
+
<img class="hg-object-cover" src="..." alt="">
|
|
356
|
+
<img class="hg-object-contain" src="..." alt="">
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
## Tipografía
|
|
360
|
+
|
|
361
|
+
Las clases tipográficas se generan desde `config.typo`. Cada clase se aplica directamente con el nombre definido en el config, precedido del prefijo.
|
|
362
|
+
|
|
363
|
+
### Clases disponibles
|
|
364
|
+
|
|
365
|
+
```html
|
|
366
|
+
<!-- Títulos -->
|
|
367
|
+
<h2 class="hg-h2">Título principal (18px mobile → 24px desktop)</h2>
|
|
368
|
+
<h3 class="hg-title-l-b">Título bold uppercase (14px)</h3>
|
|
369
|
+
<h3 class="hg-title-l">Título light (14px)</h3>
|
|
370
|
+
<h4 class="hg-title-m">Título medium (12px)</h4>
|
|
371
|
+
<h4 class="hg-title-s">Título small (12px, weight 400)</h4>
|
|
372
|
+
|
|
373
|
+
<!-- Textos -->
|
|
374
|
+
<p class="hg-text-l">Texto large (12px, light)</p>
|
|
375
|
+
<p class="hg-text-m">Texto medium (12→13px responsive)</p>
|
|
376
|
+
<p class="hg-semantic">Semántico (13px)</p>
|
|
377
|
+
<span class="hg-p-tag">Tag pequeño (8px)</span>
|
|
378
|
+
|
|
379
|
+
<!-- Fuente secundaria (serif) -->
|
|
380
|
+
<p class="hg-suisse-1">Suisse 1 (16→20px responsive)</p>
|
|
381
|
+
<p class="hg-suisse-2">Suisse 2 (13→14px)</p>
|
|
382
|
+
<p class="hg-suisse-body">Suisse body (10→12px)</p>
|
|
383
|
+
|
|
384
|
+
<!-- Body variants -->
|
|
385
|
+
<p class="hg-hg-body-m">Body medium (12→13px)</p>
|
|
386
|
+
<p class="hg-hg-body-m-b">Body medium bold (weight 400)</p>
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
### Cómo funciona
|
|
390
|
+
|
|
391
|
+
Las clases son mobile-first. Los valores base aplican a mobile y un media query `@media (min-width: 992px)` sobrescribe para desktop.
|
|
392
|
+
|
|
393
|
+
```css
|
|
394
|
+
/* CSS generado (ejemplo) */
|
|
395
|
+
.hg-h2 {
|
|
396
|
+
font-family: var(--hg-typo-font-family-primary);
|
|
397
|
+
font-weight: var(--hg-typo-font-weight-900);
|
|
398
|
+
font-size: var(--hg-typo-font-size-18); /* mobile */
|
|
399
|
+
line-height: var(--hg-typo-line-height-1-976);
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
@media (min-width: 992px) {
|
|
403
|
+
.hg-h2 {
|
|
404
|
+
font-size: var(--hg-typo-font-size-24); /* desktop */
|
|
405
|
+
line-height: var(--hg-typo-line-height-1-2);
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
## Grid
|
|
411
|
+
|
|
412
|
+
El grid se activa con `grid.enabled: true` en config.json. Genera un sistema de columnas flexbox.
|
|
413
|
+
|
|
414
|
+
### Breakpoints del grid
|
|
415
|
+
|
|
416
|
+
| Breakpoint | Min-width | Columnas |
|
|
417
|
+
|-----------|-----------|----------|
|
|
418
|
+
| xs | 1px | 12 |
|
|
419
|
+
| sm | 768px | 12 |
|
|
420
|
+
| md | 992px | 12 |
|
|
421
|
+
| lg | 1280px | 12 |
|
|
422
|
+
| xl | 1440px | 24 |
|
|
423
|
+
|
|
424
|
+
### Uso básico
|
|
425
|
+
|
|
426
|
+
```html
|
|
427
|
+
<!-- Row como contenedor -->
|
|
428
|
+
<div class="row">
|
|
429
|
+
<div class="col-xs-12 col-md-6">Mitad en desktop</div>
|
|
430
|
+
<div class="col-xs-12 col-md-6">Mitad en desktop</div>
|
|
431
|
+
</div>
|
|
432
|
+
|
|
433
|
+
<!-- 3 columnas en desktop -->
|
|
434
|
+
<div class="row">
|
|
435
|
+
<div class="col-xs-12 col-md-4">Tercio</div>
|
|
436
|
+
<div class="col-xs-12 col-md-4">Tercio</div>
|
|
437
|
+
<div class="col-xs-12 col-md-4">Tercio</div>
|
|
438
|
+
</div>
|
|
439
|
+
|
|
440
|
+
<!-- Sidebar + contenido -->
|
|
441
|
+
<div class="row">
|
|
442
|
+
<aside class="col-xs-12 col-lg-3">Sidebar</aside>
|
|
443
|
+
<main class="col-xs-12 col-lg-9">Contenido</main>
|
|
444
|
+
</div>
|
|
445
|
+
|
|
446
|
+
<!-- XL con 24 columnas -->
|
|
447
|
+
<div class="row">
|
|
448
|
+
<div class="col-xl-8">8 de 24</div>
|
|
449
|
+
<div class="col-xl-16">16 de 24</div>
|
|
450
|
+
</div>
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
### Bleed (sin gutter)
|
|
454
|
+
|
|
455
|
+
```html
|
|
456
|
+
<!-- Eliminar gutter entre columnas -->
|
|
457
|
+
<div class="row bleed">
|
|
458
|
+
<div class="col-md-6">Sin padding lateral</div>
|
|
459
|
+
<div class="col-md-6">Sin padding lateral</div>
|
|
460
|
+
</div>
|
|
461
|
+
```
|
|
462
|
+
|
|
463
|
+
### Propiedades del grid
|
|
464
|
+
|
|
465
|
+
- Gutter: `8px` (padding lateral en cada columna)
|
|
466
|
+
- Container margin: `16px`
|
|
467
|
+
- `.row` usa `display: flex; flex-wrap: wrap;` con márgenes negativos
|
|
468
|
+
|
|
469
|
+
## Aspect Ratios
|
|
470
|
+
|
|
471
|
+
Clases para mantener proporciones en contenedores.
|
|
472
|
+
|
|
473
|
+
### Uso
|
|
474
|
+
|
|
475
|
+
```html
|
|
476
|
+
<!-- Ratio por defecto (2:3 vertical) -->
|
|
477
|
+
<div class="hg-aspect">
|
|
478
|
+
<img class="hg-aspect-image" src="foto.jpg" alt="">
|
|
479
|
+
</div>
|
|
480
|
+
|
|
481
|
+
<!-- 16:9 widescreen -->
|
|
482
|
+
<div class="hg-aspect hg-aspect-16-9">
|
|
483
|
+
<img class="hg-aspect-image" src="video-thumb.jpg" alt="">
|
|
484
|
+
</div>
|
|
485
|
+
|
|
486
|
+
<!-- 1:1 cuadrado -->
|
|
487
|
+
<div class="hg-aspect hg-aspect-1-1">
|
|
488
|
+
<img class="hg-aspect-image" src="avatar.jpg" alt="">
|
|
489
|
+
</div>
|
|
490
|
+
|
|
491
|
+
<!-- Contenido custom posicionado -->
|
|
492
|
+
<div class="hg-aspect hg-aspect-4-3">
|
|
493
|
+
<div class="hg-aspect-content">
|
|
494
|
+
<h3 class="hg-title-l-b">Texto sobre imagen</h3>
|
|
495
|
+
</div>
|
|
496
|
+
</div>
|
|
497
|
+
```
|
|
498
|
+
|
|
499
|
+
### Ratios disponibles
|
|
500
|
+
|
|
501
|
+
| Clase | Ratio | Uso típico |
|
|
502
|
+
|-------|-------|-----------|
|
|
503
|
+
| `.hg-aspect` | 2:3 | Default vertical |
|
|
504
|
+
| `.hg-aspect-1-1` | 1:1 | Avatar, cuadrado |
|
|
505
|
+
| `.hg-aspect-4-3` | 4:3 | Foto tradicional |
|
|
506
|
+
| `.hg-aspect-16-9` | 16:9 | Video, widescreen |
|
|
507
|
+
| `.hg-aspect-2-1` | 2:1 | Banner doble ancho |
|
|
508
|
+
| `.hg-aspect-2-3` | 2:3 | Vertical |
|
|
509
|
+
| `.hg-aspect-3-4` | 3:4 | Vertical |
|
|
510
|
+
| `.hg-aspect-3-1` | 3:1 | Separador XL |
|
|
511
|
+
| `.hg-aspect-7-1` | 7:1 | Separador LG |
|
|
512
|
+
| `.hg-aspect-12-1` | 12:1 | Separador MD |
|
|
513
|
+
| `.hg-aspect-24-1` | 24:1 | Separador SM |
|
|
514
|
+
| `.hg-aspect-9-20` | 9:20 | Vertical móvil |
|
|
515
|
+
| `.hg-aspect-16-4` | 16:4 | Banner |
|
|
516
|
+
|
|
517
|
+
### Clases auxiliares
|
|
518
|
+
|
|
519
|
+
- `.hg-aspect-image` — para `<img>` y `<video>`: aplica `display: block; width: 100%; height: 100%; object-fit: cover;`
|
|
520
|
+
- `.hg-aspect-content` — posiciona contenido con `position: absolute; inset: 0;`
|
|
521
|
+
|
|
522
|
+
## Patrones comunes de maquetación
|
|
523
|
+
|
|
524
|
+
### Card de producto
|
|
525
|
+
|
|
526
|
+
```html
|
|
527
|
+
<div class="row hg-gap-16">
|
|
528
|
+
<div class="col-xs-12 col-md-6">
|
|
529
|
+
<div class="hg-aspect hg-aspect-2-3">
|
|
530
|
+
<img class="hg-aspect-image" src="product.jpg" alt="Producto">
|
|
531
|
+
</div>
|
|
532
|
+
</div>
|
|
533
|
+
<div class="col-xs-12 col-md-6 hg-d-flex hg-flex-column hg-justify-center hg-gap-8">
|
|
534
|
+
<h2 class="hg-title-l-b">Nombre del producto</h2>
|
|
535
|
+
<p class="hg-text-m" style="color: var(--hg-color-dark-grey)">Descripción corta.</p>
|
|
536
|
+
<span class="hg-h2" style="color: var(--hg-color-primary)">49,90 €</span>
|
|
537
|
+
</div>
|
|
538
|
+
</div>
|
|
539
|
+
```
|
|
540
|
+
|
|
541
|
+
### Hero centrado
|
|
542
|
+
|
|
543
|
+
```html
|
|
544
|
+
<section class="hg-d-flex hg-items-center hg-justify-center hg-min-h-100vh hg-text-center p-24">
|
|
545
|
+
<div>
|
|
546
|
+
<h1 class="hg-h2">Bienvenido</h1>
|
|
547
|
+
<p class="hg-suisse-1" style="color: var(--hg-color-dark-grey)">Subtítulo descriptivo</p>
|
|
548
|
+
</div>
|
|
549
|
+
</section>
|
|
550
|
+
```
|
|
551
|
+
|
|
552
|
+
### Grid de cards
|
|
553
|
+
|
|
554
|
+
```html
|
|
555
|
+
<div class="row hg-gap-16">
|
|
556
|
+
<div class="col-xs-12 col-sm-6 col-lg-4 mb-16">
|
|
557
|
+
<div class="hg-aspect hg-aspect-16-9">
|
|
558
|
+
<img class="hg-aspect-image" src="img1.jpg" alt="">
|
|
559
|
+
</div>
|
|
560
|
+
<div class="pt-8">
|
|
561
|
+
<h3 class="hg-title-l-b">Título card</h3>
|
|
562
|
+
<p class="hg-text-m">Descripción breve.</p>
|
|
563
|
+
</div>
|
|
564
|
+
</div>
|
|
565
|
+
<!-- Repetir para más cards -->
|
|
566
|
+
</div>
|
|
567
|
+
```
|
|
568
|
+
|
|
569
|
+
### Navbar sticky
|
|
570
|
+
|
|
571
|
+
```html
|
|
572
|
+
<header class="hg-position-sticky hg-z-50 hg-d-flex hg-justify-between hg-items-center p-16"
|
|
573
|
+
style="top: 0; background: var(--hg-color-white); border-bottom: 1px solid var(--hg-color-sk-grey);">
|
|
574
|
+
<span class="hg-title-l-b">Logo</span>
|
|
575
|
+
<nav class="hg-d-flex hg-gap-24">
|
|
576
|
+
<a class="hg-text-m" href="#">Inicio</a>
|
|
577
|
+
<a class="hg-text-m" href="#">Productos</a>
|
|
578
|
+
<a class="hg-text-m" href="#">Contacto</a>
|
|
579
|
+
</nav>
|
|
580
|
+
</header>
|
|
581
|
+
```
|
|
582
|
+
|
|
583
|
+
### Layout sidebar
|
|
584
|
+
|
|
585
|
+
```html
|
|
586
|
+
<div class="row">
|
|
587
|
+
<aside class="col-xs-12 col-md-3 hg-d-none md:hg-d-block p-16"
|
|
588
|
+
style="border-right: 1px solid var(--hg-color-sk-grey);">
|
|
589
|
+
<nav class="hg-d-flex hg-flex-column hg-gap-8">
|
|
590
|
+
<a class="hg-text-m" href="#">Sección 1</a>
|
|
591
|
+
<a class="hg-text-m" href="#">Sección 2</a>
|
|
592
|
+
</nav>
|
|
593
|
+
</aside>
|
|
594
|
+
<main class="col-xs-12 col-md-9 p-16 md:p-32">
|
|
595
|
+
<h1 class="hg-h2">Contenido principal</h1>
|
|
596
|
+
<p class="hg-text-m">Texto del contenido.</p>
|
|
597
|
+
</main>
|
|
598
|
+
</div>
|
|
599
|
+
```
|
|
600
|
+
|
|
601
|
+
### Footer multicolumna
|
|
602
|
+
|
|
603
|
+
```html
|
|
604
|
+
<footer class="pt-48 pb-24" style="background: var(--hg-color-charcoal); color: var(--hg-color-white);">
|
|
605
|
+
<div class="row hg-px-16 md:hg-px-32 hg-gap-24">
|
|
606
|
+
<div class="col-xs-12 col-md-4">
|
|
607
|
+
<h4 class="hg-title-l-b" style="color: var(--hg-color-white);">Empresa</h4>
|
|
608
|
+
<p class="hg-text-m" style="color: var(--hg-color-middle-grey);">Descripción breve.</p>
|
|
609
|
+
</div>
|
|
610
|
+
<div class="col-xs-6 col-md-4">
|
|
611
|
+
<h4 class="hg-title-l-b" style="color: var(--hg-color-white);">Enlaces</h4>
|
|
612
|
+
</div>
|
|
613
|
+
<div class="col-xs-6 col-md-4">
|
|
614
|
+
<h4 class="hg-title-l-b" style="color: var(--hg-color-white);">Legal</h4>
|
|
615
|
+
</div>
|
|
616
|
+
</div>
|
|
617
|
+
</footer>
|
|
618
|
+
```
|
|
619
|
+
|
|
620
|
+
## Reglas importantes
|
|
621
|
+
|
|
622
|
+
1. **Mobile-first siempre**: las clases base son para mobile, `md:` para desktop
|
|
623
|
+
2. **Nunca hardcodees valores**: usa `var(--hg-color-*)` y `var(--hg-spacing-*)`
|
|
624
|
+
3. **Valida contra config.json**: si un valor no está en spacingMap, no tendrá clase
|
|
625
|
+
4. **RTL-safe**: usa `.hg-px-*`, `.hg-py-*`, `.hg-mx-*`, `.hg-my-*` (usan `inline`/`block`)
|
|
626
|
+
5. **Spacing sin prefijo**: `.p-*`, `.m-*` no llevan `hg-`. Los helpers sí: `.hg-d-flex`
|
|
627
|
+
6. **Grid es flex**: `.row` + `.col-{bp}-{n}`, no CSS Grid nativo
|
|
628
|
+
7. **Ratios con fallback**: usan `aspect-ratio` nativo + `padding-top` para navegadores antiguos
|
package/dist/guide-styles.css
CHANGED
|
@@ -199,6 +199,27 @@ h2 {
|
|
|
199
199
|
color: #000;
|
|
200
200
|
}
|
|
201
201
|
|
|
202
|
+
/* Nav links unificado */
|
|
203
|
+
.guide-nav {
|
|
204
|
+
display: flex;
|
|
205
|
+
gap: 1.5rem;
|
|
206
|
+
align-items: center;
|
|
207
|
+
}
|
|
208
|
+
.guide-nav a {
|
|
209
|
+
font-size: 13px;
|
|
210
|
+
color: #666;
|
|
211
|
+
text-decoration: none;
|
|
212
|
+
transition: color 0.2s;
|
|
213
|
+
white-space: nowrap;
|
|
214
|
+
}
|
|
215
|
+
.guide-nav a:hover {
|
|
216
|
+
color: #000;
|
|
217
|
+
}
|
|
218
|
+
.guide-nav a.active {
|
|
219
|
+
color: #000;
|
|
220
|
+
font-weight: 600;
|
|
221
|
+
}
|
|
222
|
+
|
|
202
223
|
.guide-header-button {
|
|
203
224
|
color: black;
|
|
204
225
|
border: 1px solid #000000;
|