update-base-config 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/README.md +27 -0
- package/package.json +21 -0
- package/src/index.js +153 -0
- package/src/lib.js +144 -0
- package/templates/skills/ids/SKILL.md +40 -0
- package/templates/skills/ids/docs/SKILL_ID_MANAGEMENT.md +438 -0
- package/templates/skills/ids/docs/SKILL_INICIO.txt +124 -0
- package/templates/skills/ids/docs/SKILL_QUICK_START.md +260 -0
- package/templates/skills/ids/docs/SKILL_README.md +230 -0
- package/templates/skills/tailwind/SKILL.md +43 -0
- package/templates/skills/tailwind/docs/SKILL_TAILWIND_BEFORE_AFTER.md +796 -0
- package/templates/skills/tailwind/docs/SKILL_TAILWIND_COPILOT_PROMPT.md +295 -0
- package/templates/skills/tailwind/docs/SKILL_TAILWIND_CUSTOM.md +776 -0
- package/templates/skills/tailwind/docs/SKILL_TAILWIND_INDEX.md +315 -0
- package/templates/skills/tailwind/docs/SKILL_TAILWIND_QUICK_START.md +426 -0
- package/templates/skills/tailwind/docs/SKILL_TAILWIND_SUMMARY.md +436 -0
|
@@ -0,0 +1,796 @@
|
|
|
1
|
+
# Ejemplos: Antes y Después - Tailwind Custom
|
|
2
|
+
|
|
3
|
+
## 📌 Comparación Lado a Lado
|
|
4
|
+
|
|
5
|
+
Estos son ejemplos reales de cómo **transformar código** que no usa los presets correctamente.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 1️⃣ Ejemplo: Hero/Header
|
|
10
|
+
|
|
11
|
+
### ❌ ANTES (Incorrecto)
|
|
12
|
+
|
|
13
|
+
```vue
|
|
14
|
+
<template>
|
|
15
|
+
<header class="bg-blue-600 py-8 px-4">
|
|
16
|
+
<h1 class="text-white text-4xl font-bold">Bienvenido</h1>
|
|
17
|
+
<p class="text-blue-100 mt-2">Descripción</p>
|
|
18
|
+
<div class="bg-blue-500 h-1 w-24 mt-4"></div>
|
|
19
|
+
</header>
|
|
20
|
+
</template>
|
|
21
|
+
|
|
22
|
+
<style scoped>
|
|
23
|
+
/* Estilos inline en Tailwind genérico */
|
|
24
|
+
</style>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**Problemas:**
|
|
28
|
+
|
|
29
|
+
- ❌ `bg-blue-600` - Color genérico, no corporativo
|
|
30
|
+
- ❌ `text-blue-100` - Tonalidad incorrecta
|
|
31
|
+
- ❌ `bg-blue-500` - Línea decorativa con color genérico
|
|
32
|
+
|
|
33
|
+
### ✅ DESPUÉS (Correcto)
|
|
34
|
+
|
|
35
|
+
```vue
|
|
36
|
+
<template>
|
|
37
|
+
<header class="bg-brand py-8 px-4">
|
|
38
|
+
<h1 class="text-white text-4xl font-bold">Bienvenido</h1>
|
|
39
|
+
<p class="text-brand-light mt-2">Descripción</p>
|
|
40
|
+
<div class="bg-brand-light h-1 w-24 mt-4"></div>
|
|
41
|
+
</header>
|
|
42
|
+
</template>
|
|
43
|
+
|
|
44
|
+
<style scoped>
|
|
45
|
+
/* Ahora usa colores corporativos */
|
|
46
|
+
</style>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
**Mejoras:**
|
|
50
|
+
|
|
51
|
+
- ✅ `bg-brand` - Azul corporativo del Banco
|
|
52
|
+
- ✅ `text-brand-light` - Tonalidad clara del brand
|
|
53
|
+
- ✅ `bg-brand-light` - Línea decorativa con color coherente
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## 2️⃣ Ejemplo: Gradiente en Título
|
|
58
|
+
|
|
59
|
+
### ❌ ANTES (Incorrecto)
|
|
60
|
+
|
|
61
|
+
```vue
|
|
62
|
+
<template>
|
|
63
|
+
<h1 class="text-4xl font-bold bg-gradient-to-r from-blue-400 to-blue-600 bg-clip-text text-transparent">
|
|
64
|
+
Charlas Mesa de Dinero
|
|
65
|
+
</h1>
|
|
66
|
+
</template>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
**Problemas:**
|
|
70
|
+
|
|
71
|
+
- ❌ `from-blue-400 to-blue-600` - Gradiente genérico
|
|
72
|
+
- ❌ No usa colores corporativos
|
|
73
|
+
- ❌ No coincide con el design system
|
|
74
|
+
|
|
75
|
+
### ✅ DESPUÉS (Correcto)
|
|
76
|
+
|
|
77
|
+
```vue
|
|
78
|
+
<template>
|
|
79
|
+
<h1 class="text-4xl font-bold bg-gradient-to-r from-brand-light to-primary bg-clip-text text-transparent">
|
|
80
|
+
Charlas Mesa de Dinero
|
|
81
|
+
</h1>
|
|
82
|
+
</template>
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
**Mejoras:**
|
|
86
|
+
|
|
87
|
+
- ✅ `from-brand-light to-primary` - Gradiente corporativo
|
|
88
|
+
- ✅ Usa colores definidos en preset
|
|
89
|
+
- ✅ Coherente con design system del Banco
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## 3️⃣ Ejemplo: Card con Contenido
|
|
94
|
+
|
|
95
|
+
### ❌ ANTES (Incorrecto)
|
|
96
|
+
|
|
97
|
+
```vue
|
|
98
|
+
<template>
|
|
99
|
+
<div class="border-2 border-gray-300 rounded-lg p-6 bg-white">
|
|
100
|
+
<div class="h-12 bg-blue-600 rounded flex items-center justify-center">
|
|
101
|
+
<span class="text-white font-bold">BCH</span>
|
|
102
|
+
</div>
|
|
103
|
+
<h3 class="text-xl font-bold text-blue-900 mt-4">Título</h3>
|
|
104
|
+
<p class="text-gray-600 mt-2">Descripción del card</p>
|
|
105
|
+
<button class="mt-4 bg-blue-500 text-white px-4 py-2 rounded">Ver más</button>
|
|
106
|
+
</div>
|
|
107
|
+
</template>
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
**Problemas:**
|
|
111
|
+
|
|
112
|
+
- ❌ `border-gray-300` - Color genérico
|
|
113
|
+
- ❌ `bg-blue-600` - Azul no corporativo
|
|
114
|
+
- ❌ `text-blue-900` - Tonalidad incorrecta
|
|
115
|
+
- ❌ `bg-blue-500` - Botón con color genérico
|
|
116
|
+
|
|
117
|
+
### ✅ DESPUÉS (Correcto)
|
|
118
|
+
|
|
119
|
+
```vue
|
|
120
|
+
<template>
|
|
121
|
+
<div class="border-2 border-brand-lighter rounded-lg p-6 bg-white">
|
|
122
|
+
<div class="h-12 bg-brand rounded flex items-center justify-center">
|
|
123
|
+
<span class="text-white font-bold">BCH</span>
|
|
124
|
+
</div>
|
|
125
|
+
<h3 class="text-xl font-bold text-brand-dark mt-4">Título</h3>
|
|
126
|
+
<p class="text-gray-600 mt-2">Descripción del card</p>
|
|
127
|
+
<button class="mt-4 bg-primary text-white px-4 py-2 rounded hover:bg-primary-light transition-all">
|
|
128
|
+
Ver más
|
|
129
|
+
</button>
|
|
130
|
+
</div>
|
|
131
|
+
</template>
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
**Mejoras:**
|
|
135
|
+
|
|
136
|
+
- ✅ `border-brand-lighter` - Borde con color corporativo
|
|
137
|
+
- ✅ `bg-brand` - Fondo con azul corporativo
|
|
138
|
+
- ✅ `text-brand-dark` - Texto con tonalidad correcta
|
|
139
|
+
- ✅ `bg-primary` + `hover:bg-primary-light` - Botón interactivo corporativo
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## 4️⃣ Ejemplo: Botón con Estados
|
|
144
|
+
|
|
145
|
+
### ❌ ANTES (Incorrecto)
|
|
146
|
+
|
|
147
|
+
```vue
|
|
148
|
+
<template>
|
|
149
|
+
<button
|
|
150
|
+
class="px-6 py-3 bg-blue-600 text-white rounded-full font-bold hover:bg-blue-700 active:bg-blue-800"
|
|
151
|
+
@click="handleClick"
|
|
152
|
+
>
|
|
153
|
+
Enviar
|
|
154
|
+
</button>
|
|
155
|
+
</template>
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
**Problemas:**
|
|
159
|
+
|
|
160
|
+
- ❌ `bg-blue-600` - Color genérico
|
|
161
|
+
- ❌ `hover:bg-blue-700` - Tonalidad hover genérica
|
|
162
|
+
- ❌ `active:bg-blue-800` - Estados incorrectos
|
|
163
|
+
|
|
164
|
+
### ✅ DESPUÉS (Correcto)
|
|
165
|
+
|
|
166
|
+
```vue
|
|
167
|
+
<template>
|
|
168
|
+
<button
|
|
169
|
+
class="px-6 py-3 bg-primary text-white rounded-full font-bold hover:bg-primary-light active:bg-brand transition-all duration-200"
|
|
170
|
+
@click="handleClick"
|
|
171
|
+
id="cta-enviar-btn"
|
|
172
|
+
>
|
|
173
|
+
Enviar
|
|
174
|
+
</button>
|
|
175
|
+
</template>
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
**Mejoras:**
|
|
179
|
+
|
|
180
|
+
- ✅ `bg-primary` - Color primario corporativo
|
|
181
|
+
- ✅ `hover:bg-primary-light` - Hover con tonalidad clara
|
|
182
|
+
- ✅ `active:bg-brand` - Active con color brand
|
|
183
|
+
- ✅ `transition-all duration-200` - Transición suave
|
|
184
|
+
- ✅ `id="cta-enviar-btn"` - ID para analytics (si es CTA)
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
## 5️⃣ Ejemplo: Gradiente Complejo
|
|
189
|
+
|
|
190
|
+
### ❌ ANTES (Incorrecto)
|
|
191
|
+
|
|
192
|
+
```vue
|
|
193
|
+
<template>
|
|
194
|
+
<section class="bg-gradient-to-br from-blue-50 via-blue-100 to-blue-300 py-12">
|
|
195
|
+
<div class="max-w-6xl mx-auto">
|
|
196
|
+
<h2 class="text-3xl font-bold text-blue-900">Beneficios</h2>
|
|
197
|
+
<div class="grid grid-cols-3 gap-4 mt-6">
|
|
198
|
+
<div class="bg-white border-l-4 border-blue-600 p-4">
|
|
199
|
+
<!-- Contenido -->
|
|
200
|
+
</div>
|
|
201
|
+
</div>
|
|
202
|
+
</div>
|
|
203
|
+
</section>
|
|
204
|
+
</template>
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
**Problemas:**
|
|
208
|
+
|
|
209
|
+
- ❌ Gradiente con tonalidades genéricas de azul
|
|
210
|
+
- ❌ `border-blue-600` - Color genérico
|
|
211
|
+
- ❌ `text-blue-900` - Tonalidad incorrecta
|
|
212
|
+
|
|
213
|
+
### ✅ DESPUÉS (Correcto)
|
|
214
|
+
|
|
215
|
+
```vue
|
|
216
|
+
<template>
|
|
217
|
+
<section class="bg-gradient-to-br from-brand-lighter via-brand-light to-brand py-12">
|
|
218
|
+
<div class="max-w-6xl mx-auto">
|
|
219
|
+
<h2 class="text-3xl font-bold text-brand-dark">Beneficios</h2>
|
|
220
|
+
<div class="grid grid-cols-3 gap-4 mt-6">
|
|
221
|
+
<div class="bg-white border-l-4 border-brand p-4">
|
|
222
|
+
<!-- Contenido -->
|
|
223
|
+
</div>
|
|
224
|
+
</div>
|
|
225
|
+
</div>
|
|
226
|
+
</section>
|
|
227
|
+
</template>
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
**Mejoras:**
|
|
231
|
+
|
|
232
|
+
- ✅ `from-brand-lighter via-brand-light to-brand` - Gradiente corporativo natural
|
|
233
|
+
- ✅ `border-brand` - Borde con color corporativo
|
|
234
|
+
- ✅ `text-brand-dark` - Texto con tonalidad oscura correcta
|
|
235
|
+
|
|
236
|
+
---
|
|
237
|
+
|
|
238
|
+
## 6️⃣ Ejemplo: Componente con Valores Arbitrarios
|
|
239
|
+
|
|
240
|
+
### ❌ ANTES (Incorrecto)
|
|
241
|
+
|
|
242
|
+
```vue
|
|
243
|
+
<template>
|
|
244
|
+
<div
|
|
245
|
+
class="flex flex-col justify-center gap-4 p-5 text-center shadow rounded-lg my-7 bg-blue-100 border-2 border-blue-500"
|
|
246
|
+
>
|
|
247
|
+
<h3 class="text-lg font-bold text-blue-700">Evento Especial</h3>
|
|
248
|
+
<p class="text-gray-600">Detalles del evento</p>
|
|
249
|
+
</div>
|
|
250
|
+
</template>
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
**Problemas:**
|
|
254
|
+
|
|
255
|
+
- ❌ `bg-blue-100` - Fondo genérico
|
|
256
|
+
- ❌ `border-blue-500` - Borde genérico
|
|
257
|
+
- ❌ `text-blue-700` - Texto genérico
|
|
258
|
+
|
|
259
|
+
### ✅ DESPUÉS (Correcto)
|
|
260
|
+
|
|
261
|
+
```vue
|
|
262
|
+
<template>
|
|
263
|
+
<div
|
|
264
|
+
class="flex flex-col justify-center gap-4 p-5 text-center shadow rounded-lg my-7 bg-gradient-to-tl from-brand-dark via-brand to-brand/80"
|
|
265
|
+
>
|
|
266
|
+
<h3 class="text-lg font-bold text-white">Evento Especial</h3>
|
|
267
|
+
<p class="text-brand-light">Detalles del evento</p>
|
|
268
|
+
</div>
|
|
269
|
+
</template>
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
**Mejoras:**
|
|
273
|
+
|
|
274
|
+
- ✅ `bg-gradient-to-tl from-brand-dark via-brand to-brand/80` - Gradiente corporativo dinámico
|
|
275
|
+
- ✅ `text-white` - Contraste alto
|
|
276
|
+
- ✅ `text-brand-light` - Descripción con color corporativo
|
|
277
|
+
|
|
278
|
+
---
|
|
279
|
+
|
|
280
|
+
## 7️⃣ Ejemplo: Tabla con Colores
|
|
281
|
+
|
|
282
|
+
### ❌ ANTES (Incorrecto)
|
|
283
|
+
|
|
284
|
+
```vue
|
|
285
|
+
<template>
|
|
286
|
+
<table class="w-full border-collapse">
|
|
287
|
+
<thead>
|
|
288
|
+
<tr class="bg-blue-600 text-white">
|
|
289
|
+
<th class="p-3 text-left">Columna 1</th>
|
|
290
|
+
<th class="p-3 text-left">Columna 2</th>
|
|
291
|
+
</tr>
|
|
292
|
+
</thead>
|
|
293
|
+
<tbody>
|
|
294
|
+
<tr class="border-b border-gray-200 hover:bg-blue-50">
|
|
295
|
+
<td class="p-3">Dato 1</td>
|
|
296
|
+
<td class="p-3">Dato 2</td>
|
|
297
|
+
</tr>
|
|
298
|
+
</tbody>
|
|
299
|
+
</table>
|
|
300
|
+
</template>
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
**Problemas:**
|
|
304
|
+
|
|
305
|
+
- ❌ `bg-blue-600` - Header con color genérico
|
|
306
|
+
- ❌ `border-gray-200` - Borde genérico
|
|
307
|
+
- ❌ `hover:bg-blue-50` - Hover genérico
|
|
308
|
+
|
|
309
|
+
### ✅ DESPUÉS (Correcto)
|
|
310
|
+
|
|
311
|
+
```vue
|
|
312
|
+
<template>
|
|
313
|
+
<table class="w-full border-collapse">
|
|
314
|
+
<thead>
|
|
315
|
+
<tr class="bg-brand text-white">
|
|
316
|
+
<th class="p-3 text-left">Columna 1</th>
|
|
317
|
+
<th class="p-3 text-left">Columna 2</th>
|
|
318
|
+
</tr>
|
|
319
|
+
</thead>
|
|
320
|
+
<tbody>
|
|
321
|
+
<tr class="border-b border-brand-lighter hover:bg-brand/10">
|
|
322
|
+
<td class="p-3">Dato 1</td>
|
|
323
|
+
<td class="p-3">Dato 2</td>
|
|
324
|
+
</tr>
|
|
325
|
+
</tbody>
|
|
326
|
+
</table>
|
|
327
|
+
</template>
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
**Mejoras:**
|
|
331
|
+
|
|
332
|
+
- ✅ `bg-brand` - Header con color corporativo
|
|
333
|
+
- ✅ `border-brand-lighter` - Borde con color corporativo
|
|
334
|
+
- ✅ `hover:bg-brand/10` - Hover con opacidad corporativa
|
|
335
|
+
|
|
336
|
+
---
|
|
337
|
+
|
|
338
|
+
## 7️⃣ Ejemplo: ERROR COMÚN - Colores Gray con Números
|
|
339
|
+
|
|
340
|
+
### ❌ ANTES (Incorrecto)
|
|
341
|
+
|
|
342
|
+
```vue
|
|
343
|
+
<template>
|
|
344
|
+
<!-- Banner MI PASS -->
|
|
345
|
+
<section class="bg-brand py-7">
|
|
346
|
+
<div class="flex items-center gap-3">
|
|
347
|
+
<!-- Logo con fondo oscuro -->
|
|
348
|
+
<div class="bg-gray-900 rounded-2xl p-4 w-[80px] h-[80px]">
|
|
349
|
+
<span class="text-white font-bold">B</span>
|
|
350
|
+
</div>
|
|
351
|
+
<h2 class="text-7 font-bold text-white">MI PASS</h2>
|
|
352
|
+
</div>
|
|
353
|
+
|
|
354
|
+
<p class="text-gray-800 mt-4">Descripción</p>
|
|
355
|
+
<div class="border border-gray-300 rounded p-4">
|
|
356
|
+
<span class="text-gray-600">Contenido</span>
|
|
357
|
+
</div>
|
|
358
|
+
</section>
|
|
359
|
+
</template>
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
**Problemas:**
|
|
363
|
+
|
|
364
|
+
- ❌ `bg-gray-900` - **Este color NO EXISTE en el preset**
|
|
365
|
+
- ❌ `text-gray-800` - **Este color NO EXISTE en el preset**
|
|
366
|
+
- ❌ `border-gray-300` - **Este color NO EXISTE en el preset**
|
|
367
|
+
- ❌ `text-gray-600` - **Este color NO EXISTE en el preset**
|
|
368
|
+
|
|
369
|
+
**¿Por qué fallan?** El preset NO incluye la escala numérica de grises (100, 200, 300... 900). Solo tiene: `gray-dark`, `gray`, `gray-light`, `gray-lighter`, `gray-background`, `gray-transparent`.
|
|
370
|
+
|
|
371
|
+
### ✅ DESPUÉS (Correcto)
|
|
372
|
+
|
|
373
|
+
```vue
|
|
374
|
+
<template>
|
|
375
|
+
<!-- Banner MI PASS -->
|
|
376
|
+
<section class="bg-brand py-7">
|
|
377
|
+
<div class="flex items-center gap-3">
|
|
378
|
+
<!-- Logo con fondo oscuro -->
|
|
379
|
+
<div class="bg-brand-dark rounded-2xl p-4 w-[80px] h-[80px]">
|
|
380
|
+
<span class="text-white font-bold">B</span>
|
|
381
|
+
</div>
|
|
382
|
+
<h2 class="text-7 font-bold text-white">MI PASS</h2>
|
|
383
|
+
</div>
|
|
384
|
+
|
|
385
|
+
<p class="text-gray-dark mt-4">Descripción</p>
|
|
386
|
+
<div class="border border-gray-lighter rounded p-4">
|
|
387
|
+
<span class="text-gray">Contenido</span>
|
|
388
|
+
</div>
|
|
389
|
+
</section>
|
|
390
|
+
</template>
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
**Mejoras:**
|
|
394
|
+
|
|
395
|
+
- ✅ `bg-brand-dark` - Color oscuro del preset (en lugar de gray-900)
|
|
396
|
+
- ✅ `text-gray-dark` - Gris oscuro del preset (en lugar de gray-800)
|
|
397
|
+
- ✅ `border-gray-lighter` - Gris claro del preset (en lugar de gray-300)
|
|
398
|
+
- ✅ `text-gray` - Gris medio del preset (en lugar de gray-600)
|
|
399
|
+
|
|
400
|
+
**Guía Rápida de Grises:**
|
|
401
|
+
|
|
402
|
+
| ❌ Incorrecto | ✅ Usar en su lugar | Uso |
|
|
403
|
+
| -------------- | ------------------- | -------------------- |
|
|
404
|
+
| `gray-900/800` | `brand-dark` | Fondos muy oscuros |
|
|
405
|
+
| `gray-700/600` | `gray-dark` | Textos oscuros |
|
|
406
|
+
| `gray-500/400` | `gray` | Textos/bordes medios |
|
|
407
|
+
| `gray-300/200` | `gray-lighter` | Bordes claros |
|
|
408
|
+
| `gray-100/50` | `gray-background` | Fondos claros |
|
|
409
|
+
|
|
410
|
+
---
|
|
411
|
+
|
|
412
|
+
## 🎯 Resumen de Transformaciones
|
|
413
|
+
|
|
414
|
+
| Elemento | ❌ Incorrecto | ✅ Correcto |
|
|
415
|
+
| --------------------- | --------------------------- | -------------------------------- |
|
|
416
|
+
| **Fondo principal** | `bg-blue-600` | `bg-brand` |
|
|
417
|
+
| **Fondo claro** | `bg-blue-100` | `bg-brand-light` |
|
|
418
|
+
| **Fondo oscuro** | `bg-blue-900` | `bg-brand-dark` |
|
|
419
|
+
| **Gradiente** | `from-blue-400 to-blue-600` | `from-brand-light to-primary` |
|
|
420
|
+
| **Texto** | `text-blue-700` | `text-brand-dark` |
|
|
421
|
+
| **Borde** | `border-blue-500` | `border-brand` |
|
|
422
|
+
| **Hover** | `hover:bg-blue-700` | `hover:bg-primary-light` |
|
|
423
|
+
| **Opacidad** | `bg-[rgba(0,128,192,0.5)]` | `bg-brand/50` |
|
|
424
|
+
| **Gris oscuro (900)** | `bg-gray-900` | `bg-brand-dark` o `bg-gray-dark` |
|
|
425
|
+
| **Gris texto (700)** | `text-gray-700` | `text-gray-dark` |
|
|
426
|
+
| **Gris borde (300)** | `border-gray-300` | `border-gray-lighter` |
|
|
427
|
+
| **Gris fondo (100)** | `bg-gray-100` | `bg-gray-background` |
|
|
428
|
+
|
|
429
|
+
---
|
|
430
|
+
|
|
431
|
+
## 8️⃣ Ejemplo: Espaciado Incorrecto
|
|
432
|
+
|
|
433
|
+
### ❌ ANTES (Incorrecto)
|
|
434
|
+
|
|
435
|
+
```vue
|
|
436
|
+
<template>
|
|
437
|
+
<div class="p-8 m-10 gap-12">
|
|
438
|
+
<h2 class="mb-8">Título</h2>
|
|
439
|
+
<div class="grid grid-cols-3 gap-15">
|
|
440
|
+
<!-- Contenido -->
|
|
441
|
+
</div>
|
|
442
|
+
</div>
|
|
443
|
+
</template>
|
|
444
|
+
```
|
|
445
|
+
|
|
446
|
+
**Problemas:**
|
|
447
|
+
|
|
448
|
+
- ❌ `p-8` - NO existe en preset (escala solo 1-7)
|
|
449
|
+
- ❌ `m-10` - NO existe en preset
|
|
450
|
+
- ❌ `gap-12` - NO existe en preset
|
|
451
|
+
- ❌ `mb-8` - NO existe en preset
|
|
452
|
+
- ❌ `gap-15` - NO existe en preset
|
|
453
|
+
|
|
454
|
+
### ✅ DESPUÉS (Correcto)
|
|
455
|
+
|
|
456
|
+
```vue
|
|
457
|
+
<template>
|
|
458
|
+
<div class="p-7 m-[40px] gap-[48px]">
|
|
459
|
+
<h2 class="mb-[32px]">Título</h2>
|
|
460
|
+
<div class="grid grid-cols-3 gap-6">
|
|
461
|
+
<!-- Contenido -->
|
|
462
|
+
</div>
|
|
463
|
+
</div>
|
|
464
|
+
</template>
|
|
465
|
+
```
|
|
466
|
+
|
|
467
|
+
**Mejoras:**
|
|
468
|
+
|
|
469
|
+
- ✅ `p-7` - Máximo del preset (40px)
|
|
470
|
+
- ✅ `m-[40px]` - Valor arbitrario para 40px (equivalente a m-7)
|
|
471
|
+
- ✅ `gap-[48px]` - Valor arbitrario para valores > 40px
|
|
472
|
+
- ✅ `mb-[32px]` - Valor arbitrario (o usar `mb-6` = 32px)
|
|
473
|
+
- ✅ `gap-6` - Dentro de escala del preset (32px)
|
|
474
|
+
|
|
475
|
+
**Nota**: También puedes usar `mb-6` en lugar de `mb-[32px]`, ya que 32px = escala 6.
|
|
476
|
+
|
|
477
|
+
---
|
|
478
|
+
|
|
479
|
+
## 9️⃣ Ejemplo: Tipografía Fuera de Escala
|
|
480
|
+
|
|
481
|
+
### ❌ ANTES (Incorrecto)
|
|
482
|
+
|
|
483
|
+
```vue
|
|
484
|
+
<template>
|
|
485
|
+
<div>
|
|
486
|
+
<h1 class="text-5xl font-black">Título Principal</h1>
|
|
487
|
+
<h2 class="text-9xl font-heavy">Subtítulo Enorme</h2>
|
|
488
|
+
<p class="text-xxs">Texto muy pequeño</p>
|
|
489
|
+
</div>
|
|
490
|
+
</template>
|
|
491
|
+
```
|
|
492
|
+
|
|
493
|
+
**Problemas:**
|
|
494
|
+
|
|
495
|
+
- ❌ `text-5xl` - Existe, pero mejor usar alias del preset (`text-8` = `text-4xl`)
|
|
496
|
+
- ❌ `font-black` - NO existe en preset (máximo `font-extrabold` = 800)
|
|
497
|
+
- ❌ `text-9xl` - NO existe en preset (máximo `text-8` = 40px)
|
|
498
|
+
- ❌ `font-heavy` - NO existe
|
|
499
|
+
- ❌ `text-xxs` - NO existe
|
|
500
|
+
|
|
501
|
+
### ✅ DESPUÉS (Correcto)
|
|
502
|
+
|
|
503
|
+
```vue
|
|
504
|
+
<template>
|
|
505
|
+
<div>
|
|
506
|
+
<h1 class="text-8 font-extrabold">Título Principal</h1>
|
|
507
|
+
<!-- O: text-4xl font-extrabold (equivalente) -->
|
|
508
|
+
|
|
509
|
+
<h2 class="text-[56px] font-extrabold leading-[64px]">Subtítulo Enorme</h2>
|
|
510
|
+
<!-- Valor arbitrario para tamaños > 40px -->
|
|
511
|
+
|
|
512
|
+
<p class="text-1">Texto muy pequeño</p>
|
|
513
|
+
<!-- O: text-xs (equivalente) -->
|
|
514
|
+
</div>
|
|
515
|
+
</template>
|
|
516
|
+
```
|
|
517
|
+
|
|
518
|
+
**Mejoras:**
|
|
519
|
+
|
|
520
|
+
- ✅ `text-8` - Máximo del preset (40px), alias de `text-4xl`
|
|
521
|
+
- ✅ `font-extrabold` - Peso máximo del preset (800)
|
|
522
|
+
- ✅ `text-[56px]` - Valor arbitrario para tamaños > 40px
|
|
523
|
+
- ✅ `leading-[64px]` - Line height arbitrario para equilibrar
|
|
524
|
+
- ✅ `text-1` o `text-xs` - Mínimo del preset (12px)
|
|
525
|
+
|
|
526
|
+
---
|
|
527
|
+
|
|
528
|
+
## 🔟 Ejemplo: Breakpoints Incorrectos (Modyo 8 vs Modyo 9)
|
|
529
|
+
|
|
530
|
+
### ❌ ANTES (Incorrecto - Modyo 8)
|
|
531
|
+
|
|
532
|
+
```vue
|
|
533
|
+
<template>
|
|
534
|
+
<div class="grid grid-cols-1 md:grid-cols-2">
|
|
535
|
+
<!-- Asume md = 770px (Modyo 8) -->
|
|
536
|
+
<div class="p-4 md:p-6">Contenido</div>
|
|
537
|
+
</div>
|
|
538
|
+
</template>
|
|
539
|
+
|
|
540
|
+
<style>
|
|
541
|
+
/* O peor: media queries manuales */
|
|
542
|
+
@media (min-width: 770px) {
|
|
543
|
+
.custom-layout {
|
|
544
|
+
display: grid;
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
</style>
|
|
548
|
+
```
|
|
549
|
+
|
|
550
|
+
**Problemas:**
|
|
551
|
+
|
|
552
|
+
- ❌ Asume `md:` = 770px (Modyo 8)
|
|
553
|
+
- ❌ Puede causar inconsistencias en layouts
|
|
554
|
+
- ❌ Media queries manuales en vez de Tailwind
|
|
555
|
+
|
|
556
|
+
### ✅ DESPUÉS (Correcto - Modyo 9)
|
|
557
|
+
|
|
558
|
+
```vue
|
|
559
|
+
<template>
|
|
560
|
+
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4">
|
|
561
|
+
<!-- md = 768px, lg = 1024px, xl = 1280px (Modyo 9) -->
|
|
562
|
+
<div class="p-4 md:p-5 lg:p-6">Contenido</div>
|
|
563
|
+
</div>
|
|
564
|
+
</template>
|
|
565
|
+
```
|
|
566
|
+
|
|
567
|
+
**Mejoras:**
|
|
568
|
+
|
|
569
|
+
- ✅ Usa breakpoints correctos de Modyo 9 (md = 768px)
|
|
570
|
+
- ✅ Layout progresivo para todos los tamaños
|
|
571
|
+
- ✅ Espaciado adaptativo con escala del preset (4, 5, 6 = 16px, 24px, 32px)
|
|
572
|
+
|
|
573
|
+
---
|
|
574
|
+
|
|
575
|
+
## 1️⃣1️⃣ Ejemplo: Animaciones y Transiciones
|
|
576
|
+
|
|
577
|
+
### ❌ ANTES (Incorrecto)
|
|
578
|
+
|
|
579
|
+
```vue
|
|
580
|
+
<template>
|
|
581
|
+
<div class="opacity-0 hover:opacity-100">Sin transición</div>
|
|
582
|
+
|
|
583
|
+
<div class="transform scale-100 hover:scale-110">Sin suavizado</div>
|
|
584
|
+
|
|
585
|
+
<div class="skeleton-loader">
|
|
586
|
+
<div class="bg-gray-200 h-20 rounded pulse-animation"></div>
|
|
587
|
+
</div>
|
|
588
|
+
</template>
|
|
589
|
+
|
|
590
|
+
<style>
|
|
591
|
+
@keyframes pulse-animation {
|
|
592
|
+
0%,
|
|
593
|
+
100% {
|
|
594
|
+
opacity: 1;
|
|
595
|
+
}
|
|
596
|
+
50% {
|
|
597
|
+
opacity: 0.5;
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
.pulse-animation {
|
|
601
|
+
animation: pulse-animation 2s infinite;
|
|
602
|
+
}
|
|
603
|
+
</style>
|
|
604
|
+
```
|
|
605
|
+
|
|
606
|
+
**Problemas:**
|
|
607
|
+
|
|
608
|
+
- ❌ No usa transiciones del preset
|
|
609
|
+
- ❌ Define animaciones manualmente en CSS
|
|
610
|
+
- ❌ No aprovecha `animate-*` del preset
|
|
611
|
+
- ❌ `duration-*` o `ease-*` ausentes
|
|
612
|
+
|
|
613
|
+
### ✅ DESPUÉS (Correcto)
|
|
614
|
+
|
|
615
|
+
```vue
|
|
616
|
+
<template>
|
|
617
|
+
<!-- Transición suave con preset -->
|
|
618
|
+
<div class="opacity-0 hover:opacity-100 transition-opacity duration-500 ease-emphasized">Con transición suave</div>
|
|
619
|
+
|
|
620
|
+
<!-- Transform con transición -->
|
|
621
|
+
<div class="scale-100 hover:scale-110 transition-transform duration-300 ease-out">Con suavizado</div>
|
|
622
|
+
|
|
623
|
+
<!-- Skeleton loader con animación predefinida -->
|
|
624
|
+
<div class="skeleton-loader">
|
|
625
|
+
<div class="bg-gray-lighter h-20 rounded animate-skeleton"></div>
|
|
626
|
+
</div>
|
|
627
|
+
|
|
628
|
+
<!-- Entrada gradual -->
|
|
629
|
+
<div class="animate-fadeInUp">Elemento que entra desde abajo</div>
|
|
630
|
+
|
|
631
|
+
<!-- Spinner de carga -->
|
|
632
|
+
<i class="icos-loading animate-spin text-brand"></i>
|
|
633
|
+
</template>
|
|
634
|
+
```
|
|
635
|
+
|
|
636
|
+
**Mejoras:**
|
|
637
|
+
|
|
638
|
+
- ✅ `transition-opacity duration-500 ease-emphasized` - Transición del preset
|
|
639
|
+
- ✅ `transition-transform duration-300 ease-out` - Timing function del preset
|
|
640
|
+
- ✅ `animate-skeleton` - Animación predefinida para skeleton loaders
|
|
641
|
+
- ✅ `animate-fadeInUp` - Animación de entrada del preset
|
|
642
|
+
- ✅ `animate-spin` - Spinner del preset
|
|
643
|
+
- ✅ NO requiere CSS manual
|
|
644
|
+
|
|
645
|
+
---
|
|
646
|
+
|
|
647
|
+
## 1️⃣2️⃣ Ejemplo: Bordes y Sombras
|
|
648
|
+
|
|
649
|
+
### ❌ ANTES (Incorrecto)
|
|
650
|
+
|
|
651
|
+
```vue
|
|
652
|
+
<template>
|
|
653
|
+
<div class="border-4 border-blue-500 rounded-3xl shadow-2xl">Card con bordes genéricos</div>
|
|
654
|
+
|
|
655
|
+
<button class="rounded-[20px] shadow-lg border-[3px] border-gray-400">Botón con valores inconsistentes</button>
|
|
656
|
+
</template>
|
|
657
|
+
```
|
|
658
|
+
|
|
659
|
+
**Problemas:**
|
|
660
|
+
|
|
661
|
+
- ❌ `border-4` - NO existe en preset (solo border, border-2)
|
|
662
|
+
- ❌ `border-blue-500` - Color genérico
|
|
663
|
+
- ❌ `rounded-3xl` - NO existe en preset (máximo `rounded-3` = 16px)
|
|
664
|
+
- ❌ `shadow-2xl` - Existe, pero puede preferir `shadow-xl` del preset
|
|
665
|
+
- ❌ `rounded-[20px]` - Valor arbitrario innecesario
|
|
666
|
+
- ❌ `border-[3px]` - NO existe grosor 3px en preset
|
|
667
|
+
|
|
668
|
+
### ✅ DESPUÉS (Correcto)
|
|
669
|
+
|
|
670
|
+
```vue
|
|
671
|
+
<template>
|
|
672
|
+
<div class="border-2 border-brand rounded-3 shadow-md">Card con bordes corporativos</div>
|
|
673
|
+
|
|
674
|
+
<button class="rounded-full shadow-controls border border-brand-light">Botón consistente</button>
|
|
675
|
+
|
|
676
|
+
<!-- Si realmente necesitas valores específicos -->
|
|
677
|
+
<div class="border-[3px] border-brand rounded-[20px] shadow-xl">Card con valores arbitrarios específicos</div>
|
|
678
|
+
</template>
|
|
679
|
+
```
|
|
680
|
+
|
|
681
|
+
**Mejoras:**
|
|
682
|
+
|
|
683
|
+
- ✅ `border-2` - Grosor disponible en preset
|
|
684
|
+
- ✅ `border-brand` - Color corporativo
|
|
685
|
+
- ✅ `rounded-3` - Radio máximo del preset (16px)
|
|
686
|
+
- ✅ `shadow-md`, `shadow-controls` - Sombras del preset
|
|
687
|
+
- ✅ `rounded-full` - Para botones completamente redondos
|
|
688
|
+
- ✅ Valores arbitrarios solo cuando son requerimientos específicos de diseño
|
|
689
|
+
|
|
690
|
+
---
|
|
691
|
+
|
|
692
|
+
## 🎯 Resumen Ampliado de Transformaciones
|
|
693
|
+
|
|
694
|
+
| Categoría | ❌ Incorrecto | ✅ Correcto |
|
|
695
|
+
| --------------------- | --------------------------- | ------------------------------------- |
|
|
696
|
+
| **Colores** | `bg-blue-600` | `bg-brand` |
|
|
697
|
+
| **Gradientes** | `from-blue-400 to-blue-600` | `from-brand-light to-primary` |
|
|
698
|
+
| **Espaciado > 40px** | `p-8`, `m-10` | `p-[48px]`, `m-[80px]` (arbitrarios) |
|
|
699
|
+
| **Espaciado ≤ 40px** | - | `p-1` a `p-7` (4px a 40px) |
|
|
700
|
+
| **Tipografía > 40px** | `text-5xl`, `text-9xl` | `text-[48px]`, `text-[64px]` |
|
|
701
|
+
| **Tipografía ≤ 40px** | - | `text-1` a `text-8` (12px a 40px) |
|
|
702
|
+
| **Font Weight** | `font-black` (900) | `font-extrabold` (800 - máximo) |
|
|
703
|
+
| **Breakpoints** | md = 770px (Modyo 8) | md = 768px (Modyo 9) |
|
|
704
|
+
| **Border Width** | `border-4` | `border-2` o `border-[4px]` |
|
|
705
|
+
| **Border Radius** | `rounded-3xl` | `rounded-3` (16px) o `rounded-[20px]` |
|
|
706
|
+
| **Animaciones** | CSS manual | `animate-fadeIn`, `animate-skeleton` |
|
|
707
|
+
| **Transiciones** | Sin especificar | `duration-300 ease-out` |
|
|
708
|
+
| **Sombras** | - | `shadow-md`, `shadow-controls` |
|
|
709
|
+
|
|
710
|
+
---
|
|
711
|
+
|
|
712
|
+
## 💡 Proceso de Conversión Ampliado
|
|
713
|
+
|
|
714
|
+
## 💡 Proceso de Conversión Ampliado
|
|
715
|
+
|
|
716
|
+
Cuando recibas código incorrecto:
|
|
717
|
+
|
|
718
|
+
1. **Identifica** problemas:
|
|
719
|
+
|
|
720
|
+
- Colores genéricos (blue-X, gray-X, red-X, etc)
|
|
721
|
+
- Espaciado fuera de rango (p-8, m-10, gap-12)
|
|
722
|
+
- Tipografía fuera de escala (text-5xl, text-9xl)
|
|
723
|
+
- Pesos de fuente inexistentes (font-black)
|
|
724
|
+
- Breakpoints de Modyo 8 (770px)
|
|
725
|
+
- Animaciones/transiciones manuales en CSS
|
|
726
|
+
|
|
727
|
+
2. **Reemplaza** con equivalentes del preset:
|
|
728
|
+
|
|
729
|
+
- **Colores**: `blue-*` → `brand` o `primary`
|
|
730
|
+
- **Espaciado**:
|
|
731
|
+
- Si ≤ 40px → Usar escala 1-7
|
|
732
|
+
- Si > 40px → Usar arbitrarios: `p-[48px]`
|
|
733
|
+
- **Tipografía**:
|
|
734
|
+
- Si ≤ 40px → Usar `text-1` a `text-8`
|
|
735
|
+
- Si > 40px → Usar arbitrarios: `text-[48px]`
|
|
736
|
+
- **Font Weight**: Máximo `font-extrabold` (800)
|
|
737
|
+
- **Breakpoints**: md = 768px (NO 770px)
|
|
738
|
+
- **Animaciones**: Usar `animate-*` predefinidas
|
|
739
|
+
|
|
740
|
+
3. **Verifica** uso correcto:
|
|
741
|
+
|
|
742
|
+
- Gradientes usen colores preset
|
|
743
|
+
- Transiciones incluyan `duration-*` y `ease-*`
|
|
744
|
+
- Bordes usen valores disponibles o arbitrarios
|
|
745
|
+
- Sombras usen tokens del preset
|
|
746
|
+
|
|
747
|
+
4. **Agrega** valores arbitrarios SOLO si:
|
|
748
|
+
- No existe valor equivalente en preset
|
|
749
|
+
- Es un requerimiento específico de diseño
|
|
750
|
+
- Se documenta el motivo (comentario en código)
|
|
751
|
+
|
|
752
|
+
---
|
|
753
|
+
|
|
754
|
+
## 🚀 Checklist Final Ampliado
|
|
755
|
+
|
|
756
|
+
Antes de considerar una maqueta "lista":
|
|
757
|
+
|
|
758
|
+
### Colores
|
|
759
|
+
|
|
760
|
+
- [ ] ¿Todos los fondos usan `brand` o variantes?
|
|
761
|
+
- [ ] ¿Los gradientes combinan colores corporativos?
|
|
762
|
+
- [ ] ¿Los textos usan tonalidades coherentes?
|
|
763
|
+
- [ ] ¿Los bordes usan colores del preset?
|
|
764
|
+
|
|
765
|
+
### Espaciado y Tipografía
|
|
766
|
+
|
|
767
|
+
- [ ] ¿El espaciado usa escala 1-7 (4px-40px)?
|
|
768
|
+
- [ ] ¿Valores > 40px usan arbitrarios: `p-[48px]`?
|
|
769
|
+
- [ ] ¿La tipografía usa `text-1` a `text-8`?
|
|
770
|
+
- [ ] ¿Tamaños > 40px usan arbitrarios: `text-[48px]`?
|
|
771
|
+
- [ ] ¿Font weights no exceden `font-extrabold` (800)?
|
|
772
|
+
|
|
773
|
+
### Responsive
|
|
774
|
+
|
|
775
|
+
- [ ] ¿Los breakpoints usan valores de Modyo 9 (md = 768px)?
|
|
776
|
+
- [ ] ¿El layout es progresivo (sm, md, lg, xl)?
|
|
777
|
+
- [ ] ¿El espaciado se adapta por breakpoint?
|
|
778
|
+
|
|
779
|
+
### Interactividad
|
|
780
|
+
|
|
781
|
+
- [ ] ¿Los estados (hover, active, focus) tienen transiciones?
|
|
782
|
+
- [ ] ¿Las transiciones usan `duration-*` y `ease-*` del preset?
|
|
783
|
+
- [ ] ¿Las animaciones usan `animate-*` predefinidas?
|
|
784
|
+
- [ ] ¿Los skeleton loaders usan `animate-skeleton` o `animate-pulse`?
|
|
785
|
+
|
|
786
|
+
### Bordes y Sombras
|
|
787
|
+
|
|
788
|
+
- [ ] ¿Los bordes usan `border` o `border-2`?
|
|
789
|
+
- [ ] ¿Los radios usan `rounded-1/2/3` o `rounded-full`?
|
|
790
|
+
- [ ] ¿Las sombras usan tokens del preset?
|
|
791
|
+
|
|
792
|
+
### Consistencia
|
|
793
|
+
|
|
794
|
+
- [ ] ¿Hay consistencia visual con otras páginas?
|
|
795
|
+
- [ ] ¿Los IDs están presentes en elementos interactivos? (analytics)
|
|
796
|
+
- [ ] ¿Los valores arbitrarios están documentados?
|