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,776 @@
|
|
|
1
|
+
# SKILL - Tailwind CSS Custom Configuration (tw-blue & tw-green)
|
|
2
|
+
|
|
3
|
+
## 📌 Problema Identificado
|
|
4
|
+
|
|
5
|
+
Cuando se solicita crear maquetas, existe un conflicto entre:
|
|
6
|
+
|
|
7
|
+
- **Documentación de Tailwind v3** (valores por defecto)
|
|
8
|
+
- **Configuración Custom del Proyecto** (presets personalizados: `tw-blue`, `tw-green`)
|
|
9
|
+
|
|
10
|
+
Copilot y otros asistentes tienden a usar la documentación estándar de Tailwind v3 sin considerar los presets personalizados del proyecto.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## 🎯 Solución: Presets Personalizados
|
|
15
|
+
|
|
16
|
+
### ¿Qué son los Presets?
|
|
17
|
+
|
|
18
|
+
Los presets son configuraciones de colores, espaciados y otros valores que **extienden** la configuración base de Tailwind. En este proyecto usamos:
|
|
19
|
+
|
|
20
|
+
- **`tw-blue`**: Preset principal con la paleta de colores del Banco de Chile (azul corporativo)
|
|
21
|
+
- **`tw-green`**: Preset secundario para variantes de diseño
|
|
22
|
+
|
|
23
|
+
### Configuración Actual
|
|
24
|
+
|
|
25
|
+
**Archivo: `tailwind.config.js`**
|
|
26
|
+
|
|
27
|
+
```javascript
|
|
28
|
+
import twBlue from "tw-blue";
|
|
29
|
+
|
|
30
|
+
export default {
|
|
31
|
+
content: [
|
|
32
|
+
"./index.html",
|
|
33
|
+
"./src/**/*.{html,vue,js}",
|
|
34
|
+
"./node_modules/@exdbch/components-lib/dist/bch-components-lib.js",
|
|
35
|
+
],
|
|
36
|
+
presets: [twBlue], // ← Aquí se aplica el preset personalizado
|
|
37
|
+
safelist: [
|
|
38
|
+
{
|
|
39
|
+
pattern: /bg-+/, // Incluye todos los bg de colores disponibles
|
|
40
|
+
},
|
|
41
|
+
"rounded-bl-[44px]",
|
|
42
|
+
"rounded-br-[44px]",
|
|
43
|
+
],
|
|
44
|
+
};
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## 🎨 Colores Disponibles (tw-blue)
|
|
50
|
+
|
|
51
|
+
### Paleta de Colores Principal
|
|
52
|
+
|
|
53
|
+
Estos colores están definidos en el preset `tw-blue` y están **automáticamente disponibles** en todas las clases Tailwind:
|
|
54
|
+
|
|
55
|
+
| Token | Uso | Ejemplo |
|
|
56
|
+
| --------------- | ---------------------------------- | ---------------------------------------- |
|
|
57
|
+
| `brand` | Color principal (azul corporativo) | `bg-brand`, `text-brand`, `border-brand` |
|
|
58
|
+
| `brand-light` | Versión clara del brand | `from-brand-light`, `text-brand-light` |
|
|
59
|
+
| `brand-dark` | Versión oscura del brand | `bg-brand-dark`, `via-brand-dark` |
|
|
60
|
+
| `brand-lighter` | Versión aún más clara | `bg-brand-lighter` |
|
|
61
|
+
| `primary` | Color primario (gradientes) | `to-primary`, `bg-primary` |
|
|
62
|
+
| `primary-light` | Variante clara del primario | `from-primary-light` |
|
|
63
|
+
| `secondary` | Color secundario | `bg-secondary` |
|
|
64
|
+
| `accent` | Color de acento | `text-accent` |
|
|
65
|
+
|
|
66
|
+
### Variantes Disponibles
|
|
67
|
+
|
|
68
|
+
Todos los colores soportan:
|
|
69
|
+
|
|
70
|
+
- Opacidad: `bg-brand/80`, `text-brand/50`
|
|
71
|
+
- Estados: `hover:bg-brand`, `focus:border-brand`
|
|
72
|
+
- Breakpoints: `md:bg-brand`, `lg:text-brand`
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## 📐 Tipografía (Font System)
|
|
77
|
+
|
|
78
|
+
### Tamaños de Fuente (fontSize)
|
|
79
|
+
|
|
80
|
+
El preset define una escala de fuentes personalizada con **aliases numéricos** (1-8) y sus equivalentes semánticos:
|
|
81
|
+
|
|
82
|
+
| Clase Tailwind | Alias Numérico | Tamaño | Line Height | Uso |
|
|
83
|
+
| -------------- | -------------- | ------ | ----------- | ------------------- |
|
|
84
|
+
| `text-xs` | `text-1` | 12px | 24px | Textos muy pequeños |
|
|
85
|
+
| `text-sm` | `text-2` | 14px | 24px | Textos secundarios |
|
|
86
|
+
| `text-base` | `text-3` | 16px | 24px | Texto base/párrafos |
|
|
87
|
+
| `text-lg` | `text-4` | 20px | 24px | Subtítulos |
|
|
88
|
+
| `text-xl` | `text-5` | 24px | 32px | Títulos H3 |
|
|
89
|
+
| `text-2xl` | `text-6` | 26px | 32px | Títulos H2 |
|
|
90
|
+
| `text-3xl` | `text-7` | 32px | 40px | Títulos H1 |
|
|
91
|
+
| `text-4xl` | `text-8` | 40px | 48px | Héroes / Destacados |
|
|
92
|
+
|
|
93
|
+
**Ejemplos:**
|
|
94
|
+
|
|
95
|
+
```vue
|
|
96
|
+
<!-- Puedes usar alias semántico o numérico -->
|
|
97
|
+
<h1 class="text-3xl font-bold">Título Principal</h1>
|
|
98
|
+
<h1 class="text-7 font-bold">Título Principal (equivalente)</h1>
|
|
99
|
+
|
|
100
|
+
<p class="text-base">Texto de párrafo</p>
|
|
101
|
+
<p class="text-3">Texto de párrafo (equivalente)</p>
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Font Family
|
|
105
|
+
|
|
106
|
+
El preset usa **Nunito Sans** como fuente principal:
|
|
107
|
+
|
|
108
|
+
```vue
|
|
109
|
+
<!-- Ya está aplicada por defecto -->
|
|
110
|
+
<p class="font-sans">Texto con Nunito Sans</p>
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Font Weight
|
|
114
|
+
|
|
115
|
+
| Clase | Peso | Uso |
|
|
116
|
+
| ---------------- | ---- | ----------------------- |
|
|
117
|
+
| `font-light` | 300 | Textos ligeros |
|
|
118
|
+
| `font-normal` | 400 | Texto normal |
|
|
119
|
+
| `font-medium` | 500 | Texto medianamente bold |
|
|
120
|
+
| `font-semibold` | 600 | Subtítulos |
|
|
121
|
+
| `font-bold` | 700 | Títulos, énfasis |
|
|
122
|
+
| `font-extrabold` | 800 | Títulos muy destacados |
|
|
123
|
+
|
|
124
|
+
### Line Height
|
|
125
|
+
|
|
126
|
+
| Clase | Valor | Uso |
|
|
127
|
+
| ---------------- | ----- | ----------------------- |
|
|
128
|
+
| `leading-normal` | 1.5 | Default |
|
|
129
|
+
| `leading-tight` | 1.25 | Títulos compactos |
|
|
130
|
+
| `leading-1` | 16px | Line height fijo (16px) |
|
|
131
|
+
| `leading-2` | 24px | Line height fijo (24px) |
|
|
132
|
+
| `leading-3` | 32px | Line height fijo (32px) |
|
|
133
|
+
| `leading-4` | 40px | Line height fijo (40px) |
|
|
134
|
+
| `leading-5` | 48px | Line height fijo (48px) |
|
|
135
|
+
|
|
136
|
+
### Letter Spacing
|
|
137
|
+
|
|
138
|
+
| Clase | Valor | Uso |
|
|
139
|
+
| ----------------- | ----- | ----------------------- |
|
|
140
|
+
| `tracking-normal` | 0 | Default |
|
|
141
|
+
| `tracking-wide` | 0.4px | Texto espaciado |
|
|
142
|
+
| `tracking-wider` | 1px | Más espaciado |
|
|
143
|
+
| `tracking-widest` | 3px | Muy espaciado (títulos) |
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## 📏 Espaciado (Spacing)
|
|
148
|
+
|
|
149
|
+
**IMPORTANTE**: El preset usa una escala de espaciado **diferente** a Tailwind estándar.
|
|
150
|
+
|
|
151
|
+
### Escala de Spacing (1-7)
|
|
152
|
+
|
|
153
|
+
| Clase | Valor | Uso |
|
|
154
|
+
| --------------------- | ----- | ----------------------- |
|
|
155
|
+
| `p-1`, `m-1`, `gap-1` | 4px | Espaciado mínimo |
|
|
156
|
+
| `p-2`, `m-2`, `gap-2` | 8px | Espaciado pequeño |
|
|
157
|
+
| `p-3`, `m-3`, `gap-3` | 12px | Espaciado medio-pequeño |
|
|
158
|
+
| `p-4`, `m-4`, `gap-4` | 16px | Espaciado medio |
|
|
159
|
+
| `p-5`, `m-5`, `gap-5` | 24px | Espaciado grande |
|
|
160
|
+
| `p-6`, `m-6`, `gap-6` | 32px | Espaciado muy grande |
|
|
161
|
+
| `p-7`, `m-7`, `gap-7` | 40px | Espaciado extra grande |
|
|
162
|
+
|
|
163
|
+
**❗ Diferencias con Tailwind estándar:**
|
|
164
|
+
|
|
165
|
+
| Tailwind Estándar | tw-blue Preset | Diferencia |
|
|
166
|
+
| ----------------- | -------------- | ------------ |
|
|
167
|
+
| `p-1` = 4px | `p-1` = 4px | ✅ Igual |
|
|
168
|
+
| `p-2` = 8px | `p-2` = 8px | ✅ Igual |
|
|
169
|
+
| `p-3` = 12px | `p-3` = 12px | ✅ Igual |
|
|
170
|
+
| `p-4` = 16px | `p-4` = 16px | ✅ Igual |
|
|
171
|
+
| `p-5` = 20px | `p-5` = 24px | ❌ DIFERENTE |
|
|
172
|
+
| `p-6` = 24px | `p-6` = 32px | ❌ DIFERENTE |
|
|
173
|
+
| `p-7` = 28px | `p-7` = 40px | ❌ DIFERENTE |
|
|
174
|
+
|
|
175
|
+
**Ejemplos:**
|
|
176
|
+
|
|
177
|
+
```vue
|
|
178
|
+
<!-- Padding -->
|
|
179
|
+
<div class="p-5">Padding de 24px</div>
|
|
180
|
+
<div class="px-4 py-2">Padding horizontal 16px, vertical 8px</div>
|
|
181
|
+
|
|
182
|
+
<!-- Margin -->
|
|
183
|
+
<h1 class="mb-5">Margen inferior de 24px</h1>
|
|
184
|
+
<div class="mx-auto mt-6">Centrado con margen top 32px</div>
|
|
185
|
+
|
|
186
|
+
<!-- Gap (Flexbox/Grid) -->
|
|
187
|
+
<div class="flex gap-3">Gap de 12px entre elementos</div>
|
|
188
|
+
<div class="grid gap-5">Gap de 24px en grid</div>
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
## 📱 Breakpoints (Screens)
|
|
194
|
+
|
|
195
|
+
El preset usa breakpoints **Modyo 9** (diferentes a Modyo 8):
|
|
196
|
+
|
|
197
|
+
| Breakpoint | Tamaño | Uso |
|
|
198
|
+
| ---------- | ------ | ----------------------- |
|
|
199
|
+
| `sm:` | 640px | Teléfonos horizontales |
|
|
200
|
+
| `md:` | 768px | Tablets |
|
|
201
|
+
| `lg:` | 1024px | Desktop pequeño |
|
|
202
|
+
| `xl:` | 1280px | Desktop grande |
|
|
203
|
+
| `2xl:` | 1536px | Pantallas extra grandes |
|
|
204
|
+
|
|
205
|
+
**Ejemplos:**
|
|
206
|
+
|
|
207
|
+
```vue
|
|
208
|
+
<!-- Texto responsivo -->
|
|
209
|
+
<h1 class="text-5 md:text-6 lg:text-7">
|
|
210
|
+
Título que crece en pantallas grandes
|
|
211
|
+
</h1>
|
|
212
|
+
|
|
213
|
+
<!-- Layout responsivo -->
|
|
214
|
+
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
|
|
215
|
+
<div>Item 1</div>
|
|
216
|
+
<div>Item 2</div>
|
|
217
|
+
<div>Item 3</div>
|
|
218
|
+
</div>
|
|
219
|
+
|
|
220
|
+
<!-- Colores responsivos -->
|
|
221
|
+
<div class="bg-brand md:bg-brand-light lg:bg-primary">
|
|
222
|
+
Fondo que cambia según pantalla
|
|
223
|
+
</div>
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
## 📦 Container
|
|
229
|
+
|
|
230
|
+
El container está configurado con:
|
|
231
|
+
|
|
232
|
+
- **Center**: Centrado automáticamente
|
|
233
|
+
- **Padding**: 15px lateral
|
|
234
|
+
|
|
235
|
+
```vue
|
|
236
|
+
<div class="container">
|
|
237
|
+
<!-- Contenido centrado con padding lateral de 15px -->
|
|
238
|
+
</div>
|
|
239
|
+
|
|
240
|
+
<!-- En pantallas sm-md (640px-768px), max-width es 90% -->
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
---
|
|
244
|
+
|
|
245
|
+
## 🎨 Bordes (Borders)
|
|
246
|
+
|
|
247
|
+
### Border Width
|
|
248
|
+
|
|
249
|
+
| Clase | Valor | Uso |
|
|
250
|
+
| ---------- | ----- | --------------------- |
|
|
251
|
+
| `border-0` | 0 | Sin borde |
|
|
252
|
+
| `border` | 1px | Borde default |
|
|
253
|
+
| `border-1` | 1px | Borde 1px (explícito) |
|
|
254
|
+
| `border-2` | 2px | Borde 2px |
|
|
255
|
+
|
|
256
|
+
### Border Radius
|
|
257
|
+
|
|
258
|
+
| Clase | Valor | Uso |
|
|
259
|
+
| -------------- | ------ | ---------------------- |
|
|
260
|
+
| `rounded-0` | 0 | Sin bordes redondeados |
|
|
261
|
+
| `rounded-1` | 4px | Redondeado pequeño |
|
|
262
|
+
| `rounded-sm` | 4px | Alias de rounded-1 |
|
|
263
|
+
| `rounded-2` | 8px | Redondeado medio |
|
|
264
|
+
| `rounded` | 8px | Default |
|
|
265
|
+
| `rounded-md` | 8px | Alias de rounded-2 |
|
|
266
|
+
| `rounded-3` | 16px | Redondeado grande |
|
|
267
|
+
| `rounded-lg` | 16px | Alias de rounded-3 |
|
|
268
|
+
| `rounded-full` | 9999px | Completamente redondo |
|
|
269
|
+
|
|
270
|
+
**Ejemplos:**
|
|
271
|
+
|
|
272
|
+
```vue
|
|
273
|
+
<!-- Cards -->
|
|
274
|
+
<div class="border border-brand-light rounded-2 p-4">
|
|
275
|
+
Card con borde de 1px y radio de 8px
|
|
276
|
+
</div>
|
|
277
|
+
|
|
278
|
+
<!-- Botones -->
|
|
279
|
+
<button class="rounded-full px-6 py-2 bg-brand">
|
|
280
|
+
Botón con bordes completamente redondeados
|
|
281
|
+
</button>
|
|
282
|
+
|
|
283
|
+
<!-- Border específico -->
|
|
284
|
+
<div class="border-2 border-primary rounded-3">
|
|
285
|
+
Borde grueso (2px) con radio de 16px
|
|
286
|
+
</div>
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
---
|
|
290
|
+
|
|
291
|
+
## 🌑 Sombras (Box Shadow)
|
|
292
|
+
|
|
293
|
+
El preset define sombras personalizadas:
|
|
294
|
+
|
|
295
|
+
| Clase | Uso |
|
|
296
|
+
| ----------------- | -------------------------------- |
|
|
297
|
+
| `shadow-sm` | Sombra pequeña (controles) |
|
|
298
|
+
| `shadow` | Sombra default |
|
|
299
|
+
| `shadow-md` | Sombra media |
|
|
300
|
+
| `shadow-lg` | Sombra grande |
|
|
301
|
+
| `shadow-xl` | Sombra extra grande |
|
|
302
|
+
| `shadow-controls` | Sombra específica para controles |
|
|
303
|
+
| `shadow-neutral` | Sombra neutral |
|
|
304
|
+
| `shadow-min` | Sombra mínima |
|
|
305
|
+
| `shadow-tiny` | Sombra diminuta |
|
|
306
|
+
|
|
307
|
+
**Ejemplos:**
|
|
308
|
+
|
|
309
|
+
```vue
|
|
310
|
+
<!-- Cards -->
|
|
311
|
+
<div class="bg-white rounded-2 shadow-md p-5">
|
|
312
|
+
Card con sombra media
|
|
313
|
+
</div>
|
|
314
|
+
|
|
315
|
+
<!-- Botones elevados -->
|
|
316
|
+
<button class="bg-brand text-white px-4 py-2 rounded shadow-controls">
|
|
317
|
+
Botón con sombra de control
|
|
318
|
+
</button>
|
|
319
|
+
|
|
320
|
+
<!-- Modales -->
|
|
321
|
+
<div class="bg-white rounded-3 shadow-xl p-6">
|
|
322
|
+
Modal con sombra grande
|
|
323
|
+
</div>
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
---
|
|
327
|
+
|
|
328
|
+
## 🎬 Animaciones
|
|
329
|
+
|
|
330
|
+
El preset incluye **múltiples animaciones predefinidas** basadas en animate.css:
|
|
331
|
+
|
|
332
|
+
### Animaciones Disponibles
|
|
333
|
+
|
|
334
|
+
| Clase | Descripción | Duración |
|
|
335
|
+
| --------------------- | ------------------------------- | -------- |
|
|
336
|
+
| `animate-fadeIn` | Aparición gradual | 1s |
|
|
337
|
+
| `animate-fadeOut` | Desaparición gradual | 1s |
|
|
338
|
+
| `animate-fadeInUp` | Aparición desde abajo | 1s |
|
|
339
|
+
| `animate-fadeInDown` | Aparición desde arriba | 1s |
|
|
340
|
+
| `animate-fadeInLeft` | Aparición desde izquierda | 1s |
|
|
341
|
+
| `animate-fadeInRight` | Aparición desde derecha | 1s |
|
|
342
|
+
| `animate-heartBeat` | Latido de corazón | 1s |
|
|
343
|
+
| `animate-wiggle` | Movimiento de vaivén | 1s |
|
|
344
|
+
| `animate-bounce` | Rebote (Tailwind estándar) | 1s |
|
|
345
|
+
| `animate-pulse` | Pulsación de opacidad | 2s |
|
|
346
|
+
| `animate-spin` | Rotación continua | 1s |
|
|
347
|
+
| `animate-swing` | Columpio | 1s |
|
|
348
|
+
| `animate-wobble` | Tambaleo | 1s |
|
|
349
|
+
| `animate-rubberBand` | Estiramiento elástico | 1s |
|
|
350
|
+
| `animate-flash` | Parpadeo | 1s |
|
|
351
|
+
| `animate-jello` | Gelatina | 1s |
|
|
352
|
+
| `animate-skeleton` | Pulsación para skeleton loaders | 2s |
|
|
353
|
+
|
|
354
|
+
**Ejemplos:**
|
|
355
|
+
|
|
356
|
+
```vue
|
|
357
|
+
<!-- Loading -->
|
|
358
|
+
<div class="animate-pulse bg-gray-lighter h-4 w-full rounded"></div>
|
|
359
|
+
|
|
360
|
+
<!-- Icono de carga -->
|
|
361
|
+
<i class="animate-spin icos-loading"></i>
|
|
362
|
+
|
|
363
|
+
<!-- Entrada de elemento -->
|
|
364
|
+
<div class="animate-fadeInUp">
|
|
365
|
+
Contenido que aparece desde abajo
|
|
366
|
+
</div>
|
|
367
|
+
|
|
368
|
+
<!-- Botón con efecto -->
|
|
369
|
+
<button class="bg-brand text-white px-4 py-2 hover:animate-heartBeat">
|
|
370
|
+
¡Click aquí!
|
|
371
|
+
</button>
|
|
372
|
+
|
|
373
|
+
<!-- Skeleton loader -->
|
|
374
|
+
<div class="animate-skeleton bg-gray-lighter h-20 rounded"></div>
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
---
|
|
378
|
+
|
|
379
|
+
## ⏱️ Transiciones
|
|
380
|
+
|
|
381
|
+
### Transition Duration
|
|
382
|
+
|
|
383
|
+
El preset extiende las duraciones de transición:
|
|
384
|
+
|
|
385
|
+
| Clase | Valor | Uso |
|
|
386
|
+
| --------------- | ------ | --------------------- |
|
|
387
|
+
| `duration-50` | 50ms | Muy rápida |
|
|
388
|
+
| `duration-100` | 100ms | Rápida |
|
|
389
|
+
| `duration-200` | 200ms | Normal |
|
|
390
|
+
| `duration-300` | 300ms | Media |
|
|
391
|
+
| `duration-500` | 500ms | Lenta |
|
|
392
|
+
| `duration-700` | 700ms | Muy lenta |
|
|
393
|
+
| `duration-1000` | 1000ms | Extra lenta (default) |
|
|
394
|
+
| `duration-2000` | 2000ms | Súper lenta |
|
|
395
|
+
| `duration-3000` | 3000ms | Ultra lenta |
|
|
396
|
+
|
|
397
|
+
### Transition Timing Function
|
|
398
|
+
|
|
399
|
+
| Clase | Curva | Uso |
|
|
400
|
+
| ---------------------------- | ------------------------------------ | ------------------------- |
|
|
401
|
+
| `ease-linear` | linear | Velocidad constante |
|
|
402
|
+
| `ease-in` | cubic-bezier(0, 0, 0.3, 1) | Acelera al inicio |
|
|
403
|
+
| `ease-out` | cubic-bezier(0.4, 0.14, 1, 1) | Desacelera al final |
|
|
404
|
+
| `ease-in-out` | cubic-bezier(0.4, 0.14, 0.3, 1) | Acelera y desacelera |
|
|
405
|
+
| `ease-standard` | cubic-bezier(0.2, 0, 0, 1) (default) | Estándar Material Design |
|
|
406
|
+
| `ease-emphasized` | cubic-bezier(0.2, 0, 0, 1) | Énfasis |
|
|
407
|
+
| `ease-emphasized-decelerate` | cubic-bezier(0.05, 0.7, 0.1, 1.0) | Desaceleración enfatizada |
|
|
408
|
+
|
|
409
|
+
**Ejemplos:**
|
|
410
|
+
|
|
411
|
+
```vue
|
|
412
|
+
<!-- Botón con transición -->
|
|
413
|
+
<button class="bg-brand hover:bg-brand-dark transition-all duration-300 ease-out">
|
|
414
|
+
Botón con transición suave
|
|
415
|
+
</button>
|
|
416
|
+
|
|
417
|
+
<!-- Card con hover effect -->
|
|
418
|
+
<div class="bg-white shadow-md hover:shadow-xl transition-shadow duration-500">
|
|
419
|
+
Card con efecto de sombra
|
|
420
|
+
</div>
|
|
421
|
+
|
|
422
|
+
<!-- Menú desplegable -->
|
|
423
|
+
<div class="opacity-0 hover:opacity-100 transition-opacity duration-700 ease-in-out">
|
|
424
|
+
Menú que aparece gradualmente
|
|
425
|
+
</div>
|
|
426
|
+
|
|
427
|
+
<!-- Transform con transición -->
|
|
428
|
+
<div class="scale-100 hover:scale-110 transition-transform duration-300 ease-emphasized">
|
|
429
|
+
Elemento que crece al hover
|
|
430
|
+
</div>
|
|
431
|
+
```
|
|
432
|
+
|
|
433
|
+
---
|
|
434
|
+
|
|
435
|
+
## ✨ Ejemplos de Uso Correcto
|
|
436
|
+
|
|
437
|
+
### 1. **Gradientes (Lo más común en diseños)**
|
|
438
|
+
|
|
439
|
+
```vue
|
|
440
|
+
<!-- ❌ INCORRECTO - Usa colores por defecto de Tailwind -->
|
|
441
|
+
<h1 class="bg-gradient-to-r from-blue-500 to-blue-700">Título</h1>
|
|
442
|
+
|
|
443
|
+
<!-- ✅ CORRECTO - Usa colores del preset tw-blue -->
|
|
444
|
+
<h1 class="text-transparent bg-clip-text bg-gradient-to-r from-brand-light to-primary">
|
|
445
|
+
Charlas Mesa de Dinero
|
|
446
|
+
</h1>
|
|
447
|
+
|
|
448
|
+
<div class="bg-gradient-to-tl from-brand-dark via-brand to-brand/80">
|
|
449
|
+
Contenedor especial
|
|
450
|
+
</div>
|
|
451
|
+
|
|
452
|
+
<button class="bg-gradient-to-t from-primary to-primary-light">
|
|
453
|
+
CTA Button
|
|
454
|
+
</button>
|
|
455
|
+
```
|
|
456
|
+
|
|
457
|
+
### 2. **Fondos Sólidos**
|
|
458
|
+
|
|
459
|
+
```vue
|
|
460
|
+
<!-- ❌ INCORRECTO -->
|
|
461
|
+
<div class="bg-blue-600">Contenido</div>
|
|
462
|
+
|
|
463
|
+
<!-- ✅ CORRECTO -->
|
|
464
|
+
<div class="bg-brand">Contenido</div>
|
|
465
|
+
<header class="bg-brand-dark">Encabezado</header>
|
|
466
|
+
```
|
|
467
|
+
|
|
468
|
+
### 3. **Bordes y Textos**
|
|
469
|
+
|
|
470
|
+
```vue
|
|
471
|
+
<!-- ❌ INCORRECTO -->
|
|
472
|
+
<div class="border-blue-400 text-blue-500">Elemento</div>
|
|
473
|
+
|
|
474
|
+
<!-- ✅ CORRECTO -->
|
|
475
|
+
<div class="border-brand text-brand-light">Elemento</div>
|
|
476
|
+
```
|
|
477
|
+
|
|
478
|
+
### 4. **Combinaciones Responsivas**
|
|
479
|
+
|
|
480
|
+
```vue
|
|
481
|
+
<div class="bg-brand md:bg-brand-light lg:bg-primary">
|
|
482
|
+
Fondo adaptativo
|
|
483
|
+
</div>
|
|
484
|
+
|
|
485
|
+
<!-- Con opacidad -->
|
|
486
|
+
<div class="bg-brand/80 hover:bg-brand/100 transition-all">
|
|
487
|
+
Botón interactivo
|
|
488
|
+
</div>
|
|
489
|
+
```
|
|
490
|
+
|
|
491
|
+
---
|
|
492
|
+
|
|
493
|
+
## 🔧 ¿Qué hacer cuando necesitas un valor NO disponible en tw-blue?
|
|
494
|
+
|
|
495
|
+
### Opción 1: Valores Arbitrarios (Recomendado)
|
|
496
|
+
|
|
497
|
+
Si necesitas un valor que **no existe** en los presets, usa **valores arbitrarios** de Tailwind:
|
|
498
|
+
|
|
499
|
+
```vue
|
|
500
|
+
<!-- Color específico no en preset -->
|
|
501
|
+
<div class="bg-[#FF5733]">Fondo custom</div>
|
|
502
|
+
|
|
503
|
+
<!-- Tamaño específico -->
|
|
504
|
+
<button class="py-[14px] px-7">Botón con padding custom</button>
|
|
505
|
+
|
|
506
|
+
<!-- Padding específico -->
|
|
507
|
+
<div class="rounded-bl-[44px] rounded-br-[44px]">
|
|
508
|
+
Esquinas redondeadas custom
|
|
509
|
+
</div>
|
|
510
|
+
|
|
511
|
+
<!-- Width específica -->
|
|
512
|
+
<span class="w-[157px] h-[4px]">Línea separadora custom</span>
|
|
513
|
+
```
|
|
514
|
+
|
|
515
|
+
**Ventaja**: Es explícito y no contamina la configuración.
|
|
516
|
+
|
|
517
|
+
### Opción 2: Extender el Preset (Menos común)
|
|
518
|
+
|
|
519
|
+
Si necesitas agregar colores permanentes, modifica `tailwind.config.js`:
|
|
520
|
+
|
|
521
|
+
```javascript
|
|
522
|
+
import twBlue from 'tw-blue';
|
|
523
|
+
|
|
524
|
+
export default {
|
|
525
|
+
content: [...],
|
|
526
|
+
presets: [twBlue],
|
|
527
|
+
theme: {
|
|
528
|
+
extend: {
|
|
529
|
+
colors: {
|
|
530
|
+
'custom-red': '#FF5733',
|
|
531
|
+
'custom-purple': '#9B59B6',
|
|
532
|
+
},
|
|
533
|
+
},
|
|
534
|
+
},
|
|
535
|
+
};
|
|
536
|
+
```
|
|
537
|
+
|
|
538
|
+
---
|
|
539
|
+
|
|
540
|
+
## 📋 Checklist para Crear Maquetas
|
|
541
|
+
|
|
542
|
+
Cuando crees un nuevo componente o página, sigue esta lista:
|
|
543
|
+
|
|
544
|
+
- [ ] **Verificar colores disponibles**: ¿Uso `brand`, `brand-light`, `primary`?
|
|
545
|
+
- [ ] **Preferir preset**: Antes de arbitrarios, intenta usar colores del preset
|
|
546
|
+
- [ ] **Gradientes**: Combina colores del preset: `from-brand-light to-primary`
|
|
547
|
+
- [ ] **Opacidad**: Usa la sintaxis `color/opacity`: `bg-brand/80`
|
|
548
|
+
- [ ] **Responsivos**: Aplica breakpoints: `md:bg-brand lg:bg-primary`
|
|
549
|
+
- [ ] **Valores custom**: Solo si realmente no existen en el preset → `bg-[#FF5733]`
|
|
550
|
+
- [ ] **Safelist**: Valores arbitrarios comunes ya están en safelist (ej: `rounded-bl-[44px]`)
|
|
551
|
+
|
|
552
|
+
---
|
|
553
|
+
|
|
554
|
+
## 🚀 Ejemplos Reales del Proyecto
|
|
555
|
+
|
|
556
|
+
### Header/Hero con Gradiente
|
|
557
|
+
|
|
558
|
+
```vue
|
|
559
|
+
<h1 class="text-transparent bg-clip-text bg-gradient-to-r from-brand-light to-primary">
|
|
560
|
+
{{ title }}
|
|
561
|
+
</h1>
|
|
562
|
+
|
|
563
|
+
<!-- Línea decorativa -->
|
|
564
|
+
<div class="w-3/6 h-1 bg-gradient-to-r from-brand-light via-brand-light to-primary"></div>
|
|
565
|
+
```
|
|
566
|
+
|
|
567
|
+
### Card con Fondo Degradado
|
|
568
|
+
|
|
569
|
+
```vue
|
|
570
|
+
<div class="flex flex-col gap-4 p-5 text-center rounded-3 bg-gradient-to-tl from-brand-dark via-brand to-brand/80">
|
|
571
|
+
<span class="text-white">Contenido destacado</span>
|
|
572
|
+
</div>
|
|
573
|
+
```
|
|
574
|
+
|
|
575
|
+
### Tabla Header
|
|
576
|
+
|
|
577
|
+
```vue
|
|
578
|
+
<h2 class="py-5 text-white bg-brand px-5">
|
|
579
|
+
Título de Tabla
|
|
580
|
+
</h2>
|
|
581
|
+
```
|
|
582
|
+
|
|
583
|
+
### Botón CTA
|
|
584
|
+
|
|
585
|
+
```vue
|
|
586
|
+
<button
|
|
587
|
+
class="py-[14px] px-7 rounded-full text-white bg-gradient-to-t from-primary to-primary-light hover:bg-primary-light transition-all"
|
|
588
|
+
>
|
|
589
|
+
Más información
|
|
590
|
+
</button>
|
|
591
|
+
```
|
|
592
|
+
|
|
593
|
+
---
|
|
594
|
+
|
|
595
|
+
## 🎓 Instrucciones para Copilot/IA
|
|
596
|
+
|
|
597
|
+
Cuando se solicite crear una maqueta o componente:
|
|
598
|
+
|
|
599
|
+
> **⚠️ IMPORTANTE**: Este proyecto usa **Tailwind CSS v3 CON PRESETS PERSONALIZADOS** (`tw-blue`).
|
|
600
|
+
>
|
|
601
|
+
> **Variables customizadas del preset:**
|
|
602
|
+
>
|
|
603
|
+
> ### Colores
|
|
604
|
+
>
|
|
605
|
+
> - `brand`, `brand-light`, `brand-dark`, `brand-lighter`
|
|
606
|
+
> - `primary`, `primary-light`
|
|
607
|
+
> - `secondary`, `accent`
|
|
608
|
+
> - `gray`, `gray-light`, `gray-dark`, `gray-lighter`, `gray-background`
|
|
609
|
+
> - `success`, `warning`, `error` (con sus variantes)
|
|
610
|
+
>
|
|
611
|
+
> ### Tipografía
|
|
612
|
+
>
|
|
613
|
+
> - **Tamaños**: `text-1` a `text-8` (12px a 40px) o `text-xs` a `text-4xl`
|
|
614
|
+
> - **Font**: `font-sans` (Nunito Sans)
|
|
615
|
+
> - **Weights**: `font-light` (300) a `font-extrabold` (800)
|
|
616
|
+
>
|
|
617
|
+
> ### Espaciado
|
|
618
|
+
>
|
|
619
|
+
> - **Escala**: `1` a `7` = 4px a 40px (NO usar valores mayores a 7)
|
|
620
|
+
> - Ejemplos: `p-5` = 24px, `gap-3` = 12px, `m-6` = 32px
|
|
621
|
+
>
|
|
622
|
+
> ### Breakpoints
|
|
623
|
+
>
|
|
624
|
+
> - `sm:` 640px | `md:` 768px | `lg:` 1024px | `xl:` 1280px | `2xl:` 1536px
|
|
625
|
+
>
|
|
626
|
+
> ### Bordes
|
|
627
|
+
>
|
|
628
|
+
> - **Width**: `border` (1px), `border-2` (2px)
|
|
629
|
+
> - **Radius**: `rounded-1/sm` (4px), `rounded-2/md` (8px), `rounded-3/lg` (16px), `rounded-full`
|
|
630
|
+
>
|
|
631
|
+
> ### Sombras
|
|
632
|
+
>
|
|
633
|
+
> - `shadow-sm`, `shadow-controls`, `shadow-neutral`, `shadow-min`, `shadow-md`, `shadow-lg`, `shadow-xl`
|
|
634
|
+
>
|
|
635
|
+
> ### Animaciones
|
|
636
|
+
>
|
|
637
|
+
> - `animate-fadeIn`, `animate-fadeInUp`, `animate-pulse`, `animate-heartBeat`, `animate-skeleton`, etc.
|
|
638
|
+
>
|
|
639
|
+
> ### Transiciones
|
|
640
|
+
>
|
|
641
|
+
> - **Duraciones**: `duration-50` a `duration-3000` (50ms a 3s)
|
|
642
|
+
> - **Easing**: `ease-standard`, `ease-emphasized`, `ease-in-out`, etc.
|
|
643
|
+
>
|
|
644
|
+
> **Instrucciones clave**:
|
|
645
|
+
>
|
|
646
|
+
> 1. **Colores**: Usar SIEMPRE los del preset (NO `blue-500`, `gray-700`)
|
|
647
|
+
> 2. **Tipografía**: Preferir `text-1` a `text-8` sobre valores arbitrarios
|
|
648
|
+
> 3. **Espaciado**: SOLO usar escala 1-7 (valores como `p-8`, `m-10` NO existen)
|
|
649
|
+
> 4. **Breakpoints**: Usar los customizados (md = 768px, NO 770px)
|
|
650
|
+
> 5. **Gradientes**: Combinar colores del preset: `from-brand-light to-primary`
|
|
651
|
+
> 6. **Animaciones**: Usar las predefinidas cuando sea posible
|
|
652
|
+
> 7. **Valores arbitrarios**: Solo si NO existe equivalente en preset
|
|
653
|
+
> 8. Verificar ejemplos en `src/pages/Charlas/Charlas.vue` o `src/pages/ValeVista/sections/BeneficiosSlider.vue`
|
|
654
|
+
|
|
655
|
+
---
|
|
656
|
+
|
|
657
|
+
## 📚 Archivos de Referencia
|
|
658
|
+
|
|
659
|
+
- **Configuración**: [`tailwind.config.js`](tailwind.config.js)
|
|
660
|
+
- **Ejemplos de uso**:
|
|
661
|
+
- [`src/pages/Charlas/Charlas.vue`](src/pages/Charlas/Charlas.vue) - Gradientes y colores brand
|
|
662
|
+
- [`src/pages/ValeVista/sections/BeneficiosSlider.vue`](src/pages/ValeVista/sections/BeneficiosSlider.vue) - Botones con gradientes
|
|
663
|
+
- [`src/pages/TasasTarifasComisiones/components/BchBanner.vue`](src/pages/TasasTarifasComisiones/components/BchBanner.vue) - Banners con brand
|
|
664
|
+
|
|
665
|
+
---
|
|
666
|
+
|
|
667
|
+
## ❓ Preguntas Frecuentes
|
|
668
|
+
|
|
669
|
+
### P: ¿Por qué no puedo usar `bg-blue-500`?
|
|
670
|
+
|
|
671
|
+
**R**: Porque el proyecto usa un preset personalizado (`tw-blue`) que define su propia paleta. Los colores estándar de Tailwind están ocultos por el preset.
|
|
672
|
+
|
|
673
|
+
### P: ¿Puedo agregar nuevos colores al preset?
|
|
674
|
+
|
|
675
|
+
**R**: Técnicamente sí (extendiendo `theme.extend.colors`), pero primero verifica si existe en el preset. Para valores puntuales, usa arbitrarios.
|
|
676
|
+
|
|
677
|
+
### P: ¿Qué diferencia hay entre `brand` y `primary`?
|
|
678
|
+
|
|
679
|
+
**R**: Son colores diferentes en el preset. `brand` es el azul corporativo (más oscuro), `primary` es otra variante. Úsalos según el diseño.
|
|
680
|
+
|
|
681
|
+
### P: ¿Los valores arbitrarios se compilan en el CSS final?
|
|
682
|
+
|
|
683
|
+
**R**: Sí, pero solo si se usan. Tailwind los genera dinámicamente. Algunos como `rounded-bl-[44px]` están en `safelist` para asegurar su inclusión.
|
|
684
|
+
|
|
685
|
+
### P: ¿Por qué `p-8` o `m-10` no funcionan?
|
|
686
|
+
|
|
687
|
+
**R**: El preset define una escala de espaciado customizada que **solo va de 1 a 7** (4px a 40px). Para valores mayores, usa arbitrarios: `p-[48px]` o `m-[80px]`.
|
|
688
|
+
|
|
689
|
+
### P: ¿Puedo usar `text-5xl` o `text-9xl`?
|
|
690
|
+
|
|
691
|
+
**R**: No. El preset define tamaños de fuente solo hasta `text-4xl` (o `text-8`). Para tamaños mayores, usa valores arbitrarios: `text-[48px]`.
|
|
692
|
+
|
|
693
|
+
### P: ¿`text-3` y `text-base` son lo mismo?
|
|
694
|
+
|
|
695
|
+
**R**: Sí. El preset define **aliases numéricos** (1-8) que corresponden a los semánticos (xs, sm, base, lg, xl, 2xl, 3xl, 4xl). Puedes usar cualquiera.
|
|
696
|
+
|
|
697
|
+
### P: ¿Por qué `duration-400` no existe?
|
|
698
|
+
|
|
699
|
+
**R**: El preset define duraciones específicas. Si necesitas 400ms, usa: `duration-[400ms]`. Las duraciones disponibles son: 50, 100, 150, 200, 250, 300, 350, 400, 450, 500, 550, 600, 700, 800, 900, 1000, 2000, 3000.
|
|
700
|
+
|
|
701
|
+
### P: ¿Cómo sé si debo usar `animate-fadeIn` o `transition-opacity`?
|
|
702
|
+
|
|
703
|
+
**R**:
|
|
704
|
+
|
|
705
|
+
- **`animate-fadeIn`**: Animación automática de 1s que se ejecuta al cargar/mostrar el elemento.
|
|
706
|
+
- **`transition-opacity`**: Transición suave controlada por estados (hover, focus, etc.). Requiere cambiar la opacidad manualmente.
|
|
707
|
+
|
|
708
|
+
### P: ¿El preset cambia los breakpoints? Antes usaba md:770px
|
|
709
|
+
|
|
710
|
+
**R**: Sí. El proyecto migró de **Modyo 8** a **Modyo 9**. Los breakpoints ahora son estándar de Tailwind v3:
|
|
711
|
+
|
|
712
|
+
- **Antes (Modyo 8)**: md: 770px, lg: 992px
|
|
713
|
+
- **Ahora (Modyo 9)**: md: 768px, lg: 1024px (los del preset tw-blue)
|
|
714
|
+
|
|
715
|
+
---
|
|
716
|
+
|
|
717
|
+
## ✅ Resumen de Variables del Preset
|
|
718
|
+
|
|
719
|
+
| Categoría | Situación | Acción |
|
|
720
|
+
| ---------------- | ---------------------------------------- | ------------------------------------------------------------ |
|
|
721
|
+
| **Colores** | Necesito un color corporativo | Usa `brand`, `brand-light`, `brand-dark`, `primary` |
|
|
722
|
+
| | Necesito un gradiente | Combina: `from-brand-light to-primary` |
|
|
723
|
+
| | Necesito un color NO disponible | Usa arbitrario: `bg-[#FF5733]` |
|
|
724
|
+
| **Tipografía** | Necesito un tamaño de fuente | Usa `text-1` a `text-8` (o `text-xs` a `text-4xl`) |
|
|
725
|
+
| | Necesito un tamaño > 40px | Usa arbitrario: `text-[48px]` |
|
|
726
|
+
| | Necesito cambiar peso de fuente | Usa `font-light` (300) a `font-extrabold` (800) |
|
|
727
|
+
| **Espaciado** | Necesito padding/margin/gap | Usa escala 1-7: `p-5` (24px), `gap-3` (12px) |
|
|
728
|
+
| | Necesito spacing > 40px | Usa arbitrario: `p-[48px]`, `m-[80px]` |
|
|
729
|
+
| | ¿Cuánto es `p-5`? | 24px (NO 20px como en Tailwind estándar) |
|
|
730
|
+
| **Responsive** | Necesito adaptar diseño a pantallas | Usa: `sm:` 640px, `md:` 768px, `lg:` 1024px, `xl:` 1280px |
|
|
731
|
+
| | ¿md es 768px o 770px? | **768px** (Modyo 9) - el preset usa Tailwind v3 estándar |
|
|
732
|
+
| **Bordes** | Necesito bordes redondeados | Usa `rounded-1` (4px), `rounded-2` (8px), `rounded-3` (16px) |
|
|
733
|
+
| | Necesito bordes completamente redondos | Usa `rounded-full` |
|
|
734
|
+
| | Necesito grosor de borde | Usa `border` (1px) o `border-2` (2px) |
|
|
735
|
+
| **Sombras** | Necesito sombra en card/botón | Usa `shadow-md`, `shadow-controls`, `shadow-neutral` |
|
|
736
|
+
| | Necesito sombra grande para modal | Usa `shadow-xl` |
|
|
737
|
+
| **Animaciones** | Necesito entrada gradual de elemento | Usa `animate-fadeIn`, `animate-fadeInUp` |
|
|
738
|
+
| | Necesito skeleton loader | Usa `animate-skeleton` o `animate-pulse` |
|
|
739
|
+
| | Necesito spinner de carga | Usa `animate-spin` |
|
|
740
|
+
| **Transiciones** | Necesito transición en hover/focus | Usa `transition-all duration-300 ease-out` |
|
|
741
|
+
| | Necesito transición lenta | Usa `duration-1000`, `duration-2000`, `duration-3000` |
|
|
742
|
+
| | Necesito curva de aceleración específica | Usa `ease-standard`, `ease-emphasized`, `ease-in-out` |
|
|
743
|
+
| **General** | Dudo si existe en preset | Revisa documentación o usa arbitrario: `[valor]` |
|
|
744
|
+
| | Quiero ver ejemplos reales | Revisa `src/pages/Charlas/` o `src/pages/ValeVista/` |
|
|
745
|
+
|
|
746
|
+
---
|
|
747
|
+
|
|
748
|
+
## 🎯 Quick Reference
|
|
749
|
+
|
|
750
|
+
```vue
|
|
751
|
+
<!-- Colores -->
|
|
752
|
+
<div class="bg-brand text-white">Color corporativo</div>
|
|
753
|
+
<h1 class="text-transparent bg-clip-text bg-gradient-to-r from-brand-light to-primary">Gradiente</h1>
|
|
754
|
+
|
|
755
|
+
<!-- Tipografía -->
|
|
756
|
+
<h1 class="text-7 font-bold">Título grande (32px)</h1>
|
|
757
|
+
<p class="text-3 font-normal leading-2">Párrafo (16px, line-height 24px)</p>
|
|
758
|
+
|
|
759
|
+
<!-- Espaciado -->
|
|
760
|
+
<div class="p-5 m-3 gap-4">Padding 24px, margin 12px, gap 16px</div>
|
|
761
|
+
|
|
762
|
+
<!-- Responsive -->
|
|
763
|
+
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3">Layout adaptativo</div>
|
|
764
|
+
|
|
765
|
+
<!-- Bordes y sombras -->
|
|
766
|
+
<div class="rounded-2 border border-brand-light shadow-md">Card estilizada</div>
|
|
767
|
+
|
|
768
|
+
<!-- Animaciones -->
|
|
769
|
+
<div class="animate-fadeInUp">Entrada desde abajo</div>
|
|
770
|
+
<div class="animate-skeleton h-20 rounded">Skeleton loader</div>
|
|
771
|
+
|
|
772
|
+
<!-- Transiciones -->
|
|
773
|
+
<button class="bg-brand hover:bg-brand-dark transition-all duration-300 ease-out">
|
|
774
|
+
Botón con transición suave
|
|
775
|
+
</button>
|
|
776
|
+
```
|