recursero-jekyll-theme 0.1.5 → 0.2.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.
- checksums.yaml +4 -4
- data/README.md +69 -18
- data/_config.yml +77 -0
- data/_data/assets.json +6 -0
- data/_data/en.yml +61 -15
- data/_data/es.yml +64 -15
- data/_data/forms/contacto.yml +2 -2
- data/_data/layouts/about.yml +39 -22
- data/_data/layouts/category.yml +5 -10
- data/_data/layouts/menu.yml +73 -0
- data/_data/layouts/page.yml +7 -7
- data/_data/layouts/place.yml +13 -11
- data/_data/layouts/post.yml +7 -7
- data/_includes/contact.html +8 -5
- data/_includes/floating_alert.html +6 -0
- data/_includes/item.html +38 -0
- data/_includes/menu.html +23 -0
- data/_includes/onboarding.html +37 -0
- data/_includes/pack.html +1 -0
- data/_includes/password.html +1 -0
- data/_includes/picture.html +23 -0
- data/_includes/preload_font.html +1 -0
- data/_includes/search.html +4 -3
- data/_includes/share.html +3 -2
- data/_includes/submit.html +5 -1
- data/_layouts/about.html +1 -1
- data/_layouts/default.html +34 -2
- data/_layouts/page.html +1 -1
- data/_layouts/place.html +1 -1
- data/_layouts/post.html +2 -2
- data/_sass/accessibility.scss +48 -7
- data/_sass/editor.scss +17 -0
- data/_sass/embed.scss +8 -0
- data/_sass/floating_alert.scss +48 -0
- data/_sass/fonts.scss +0 -0
- data/_sass/helpers.scss +327 -31
- data/_sass/menu.scss +36 -0
- data/_sass/snap.scss +60 -0
- data/_sass/toggler.scss +34 -11
- data/assets/css/styles.scss +89 -7
- data/assets/css/styles.scss.orig +3 -0
- data/assets/data/manifest.js +29 -0
- data/assets/fonts/forkawesome-webfont.woff2 +0 -0
- data/assets/js/pack.3cf11284b767fdbbefa6.js +113 -0
- data/assets/js/pack.3cf11284b767fdbbefa6.js.map +1 -0
- data/assets/js/pack.4ced2556b94e5c09e5bc.js +113 -0
- data/assets/js/pack.4ced2556b94e5c09e5bc.js.map +1 -0
- data/assets/js/pack.c42a6f683b2c0c0fa404.js +90 -0
- data/assets/js/pack.c42a6f683b2c0c0fa404.js.map +1 -0
- data/assets/js/pack.d9a353affdca4644a9b2.js +113 -0
- data/assets/js/pack.d9a353affdca4644a9b2.js.map +1 -0
- data/assets/js/sw.3cf11284b767fdbbefa6.js +2 -0
- data/assets/js/sw.3cf11284b767fdbbefa6.js.map +1 -0
- data/assets/templates/alert.html +7 -0
- data/assets/templates/results.html +15 -7
- metadata +96 -45
- data/_includes/navbar.html +0 -53
- data/_sass/share.html +0 -12
- data/_sass/share_box.html +0 -16
- data/assets/js/pack.js +0 -90
- data/assets/js/pack.js.map +0 -1
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
////
|
|
2
|
+
/// Alertas flotantes
|
|
3
|
+
/// @group Alertas flotantes
|
|
4
|
+
////
|
|
5
|
+
|
|
6
|
+
/// Posiciones posibles
|
|
7
|
+
$positions: (top, right, bottom, left);
|
|
8
|
+
|
|
9
|
+
/// Las alertas flotantes son notificaciones emergentes que desaparecen
|
|
10
|
+
/// por su cuenta, como los "Toast" de Android. Tienen opciones de
|
|
11
|
+
/// accesibilidad para que los lectores de pantalla también las
|
|
12
|
+
/// notifiquen.
|
|
13
|
+
/// @link _packs/controllers/notification_controller.js
|
|
14
|
+
/// @link _includes/floating_alert.html
|
|
15
|
+
/// @example html
|
|
16
|
+
/// <div class="floating-alert floating-alert-default floating-alert-bottom">
|
|
17
|
+
/// <div class="floating-alert-content"></div>
|
|
18
|
+
/// </div>
|
|
19
|
+
.floating-alert {
|
|
20
|
+
/// No se puede interactuar
|
|
21
|
+
@extend .pointer-event-none;
|
|
22
|
+
|
|
23
|
+
/// El estilo por defecto las coloca centradas y con una transición al
|
|
24
|
+
/// aparecer o desaparecer. Si no usamos esta clase podemos darle
|
|
25
|
+
/// nuestro propio estilo.
|
|
26
|
+
&.floating-alert-default {
|
|
27
|
+
@extend .d-flex;
|
|
28
|
+
@extend .justify-content-center;
|
|
29
|
+
@extend .w-100;
|
|
30
|
+
@extend .position-fixed;
|
|
31
|
+
@extend .fade;
|
|
32
|
+
@extend .hide;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@each $position in $positions {
|
|
36
|
+
/// Pueden tener una posición fija
|
|
37
|
+
&.floating-alert-#{$position} {
|
|
38
|
+
#{$position}: 2rem;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/// Tienen un borde redondeado y un padding para parecerse a un toast.
|
|
43
|
+
/// El color de fondo se lo da una clase background-*
|
|
44
|
+
.floating-alert-content {
|
|
45
|
+
border-radius: 2rem;
|
|
46
|
+
padding: .5rem 1rem;
|
|
47
|
+
}
|
|
48
|
+
}
|
data/_sass/fonts.scss
ADDED
|
File without changes
|
data/_sass/helpers.scss
CHANGED
|
@@ -1,54 +1,350 @@
|
|
|
1
|
-
|
|
1
|
+
////
|
|
2
|
+
/// @group Utilidades
|
|
3
|
+
////
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
/// Direcciones posibles
|
|
6
|
+
$directions: (top, right, bottom, left);
|
|
7
|
+
|
|
8
|
+
/// Crea una propiedad con prefijos de navegador, cuando no es
|
|
9
|
+
/// soportada por estándares, por ejemplo el guionado de texto.
|
|
7
10
|
@mixin vendor-prefix($property, $definition...) {
|
|
8
11
|
@each $prefix in $vendor-prefixes {
|
|
9
12
|
#{$prefix}$property: $definition;
|
|
10
13
|
}
|
|
11
14
|
}
|
|
12
15
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
@each $breakpoint in map-keys($grid-breakpoints) {
|
|
17
|
+
@include media-breakpoint-up($breakpoint) {
|
|
18
|
+
/// Obtiene el sufijo para cada clase responsive usando mixins de
|
|
19
|
+
/// Bootstrap. Valores posibles:
|
|
20
|
+
/// `""` (nada, aplica a todas las resoluciones), `-xs`, `-sm`,
|
|
21
|
+
/// `-md`, `-lg`, `-xl`.
|
|
22
|
+
$infix: breakpoint-infix($breakpoint, $grid-breakpoints);
|
|
23
|
+
|
|
24
|
+
/// Ocultar la barra de scroll, útil para sliders horizontales.
|
|
25
|
+
///
|
|
26
|
+
/// @example html
|
|
27
|
+
/// <div class="no-scrollbar-md"></div>
|
|
28
|
+
.no-scrollbar#{$infix} {
|
|
29
|
+
scrollbar-width: none;
|
|
30
|
+
-webkit-overflow-scrolling: touch;
|
|
31
|
+
|
|
32
|
+
&::-webkit-scrollbar { display: none; }
|
|
33
|
+
}
|
|
20
34
|
|
|
21
|
-
|
|
22
|
-
|
|
35
|
+
/// Un elemento cuadrado
|
|
36
|
+
///
|
|
37
|
+
/// @example html
|
|
38
|
+
/// <div class="square-lg"></div>
|
|
39
|
+
.square#{$infix} {
|
|
40
|
+
position: relative !important;
|
|
41
|
+
padding-bottom: 100%;
|
|
23
42
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
43
|
+
& > * {
|
|
44
|
+
position: absolute !important;
|
|
45
|
+
top: 0 !important;
|
|
46
|
+
left: 0 !important;
|
|
47
|
+
height: 100% !important;
|
|
48
|
+
}
|
|
28
49
|
}
|
|
29
50
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
51
|
+
/// Cursores
|
|
52
|
+
$cursors: (pointer, none);
|
|
53
|
+
@each $cursor in $cursors {
|
|
54
|
+
/// El elemento va a tener un cursor
|
|
55
|
+
///
|
|
56
|
+
/// @example html
|
|
57
|
+
/// <div class="cursor-pointer"></div>
|
|
58
|
+
.cursor#{$infix}-#{$cursor} {
|
|
59
|
+
cursor: $cursor;
|
|
33
60
|
}
|
|
34
61
|
}
|
|
35
62
|
|
|
36
|
-
|
|
37
|
-
|
|
63
|
+
/// Eventos del cursor
|
|
64
|
+
$events: (none, auto);
|
|
65
|
+
@each $event in $events {
|
|
66
|
+
/// Habilita o deshabilita recibir eventos al tocar o clickear.
|
|
67
|
+
///
|
|
68
|
+
/// @example html
|
|
69
|
+
/// <div class="pointer-event-none"></div>
|
|
70
|
+
.pointer-event#{$infix}-#{$event} {
|
|
71
|
+
pointer-events: $event;
|
|
72
|
+
}
|
|
38
73
|
}
|
|
39
74
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
border-color: var(--#{$color});
|
|
75
|
+
/// Agrega una transición a cualquier modificación de atributos
|
|
76
|
+
.transition#{$infix} {
|
|
77
|
+
@include transition($transition-base);
|
|
44
78
|
}
|
|
45
79
|
|
|
46
|
-
|
|
47
|
-
|
|
80
|
+
/// Valores posibles para la propiedad `object-fit`
|
|
81
|
+
$objects: (contain, cover, fill, none, scale-down);
|
|
82
|
+
@each $object in $objects {
|
|
83
|
+
/// Ajustes de imagen y video con respecto al contenedor
|
|
84
|
+
///
|
|
85
|
+
/// @example html
|
|
86
|
+
/// <img class="object-cover object-lg-contain"/>
|
|
87
|
+
.fit#{$infix}-#{$object} {
|
|
88
|
+
object-fit: #{$object};
|
|
89
|
+
}
|
|
48
90
|
}
|
|
49
91
|
|
|
50
|
-
|
|
51
|
-
|
|
92
|
+
/// _Overflow_, qué hacer cuando el contenido sobrepasa los límites del
|
|
93
|
+
/// contenedor.
|
|
94
|
+
$overflows: (auto, hidden, scroll);
|
|
95
|
+
/// También puede ser solo dentro de un eje
|
|
96
|
+
$overflow-axis: (x, y);
|
|
97
|
+
@each $overflow in $overflows {
|
|
98
|
+
/// Manejar el contenido sobre cualquier eje
|
|
99
|
+
///
|
|
100
|
+
/// @example html
|
|
101
|
+
/// <div class="overflow-hidden overflow-scroll-md"></div>
|
|
102
|
+
.overflow#{$infix}-#{$overflow} {
|
|
103
|
+
overflow: $overflow !important;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
@each $axis in $overflow-axis {
|
|
107
|
+
/// Manejar el contenido sobre un eje particular
|
|
108
|
+
///
|
|
109
|
+
/// @example html
|
|
110
|
+
/// <div class="overflow-hidden-y overflow-scroll-x"></div>
|
|
111
|
+
.overflow-#{$axis}#{$infix}-#{$overflow} {
|
|
112
|
+
overflow-#{$axis}: $overflow !important;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
@each $spacer, $length in $spacers {
|
|
118
|
+
/// Poder aumentar o disminuir el alto de la tipografía. Los
|
|
119
|
+
/// `spacers` están definidos en Bootstrap y pueden ser extendidos
|
|
120
|
+
/// desde styles.scss
|
|
121
|
+
///
|
|
122
|
+
/// @link assets/css/styles.scss
|
|
123
|
+
/// @example html
|
|
124
|
+
/// <h1 class="f-3"></h1>
|
|
125
|
+
.f#{$infix}-#{$spacer} {
|
|
126
|
+
font-size: $length !important;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/// Columnas de texto
|
|
130
|
+
///
|
|
131
|
+
/// @example html
|
|
132
|
+
/// <div class="text-column-1 text-column-md-3"></div>
|
|
133
|
+
.text-column#{$infix}-#{$spacer} {
|
|
134
|
+
column-count: $spacer;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/// Limitar la cantidad de líneas de un bloque de texto,
|
|
138
|
+
/// reemplazando el sobrante por puntos suspensivos. Es útil cuando
|
|
139
|
+
/// el diseño solo pide una cantidad de líneas pero no sabemos cuál
|
|
140
|
+
/// va a ser el largo.
|
|
141
|
+
///
|
|
142
|
+
/// @example html
|
|
143
|
+
/// <h1 class="line-clamp-1"></h1>
|
|
144
|
+
.line-clamp#{$infix}-#{$spacer} {
|
|
145
|
+
overflow: hidden;
|
|
146
|
+
display: -webkit-box;
|
|
147
|
+
-webkit-line-clamp: $spacer;
|
|
148
|
+
-webkit-box-orient: vertical;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
@each $direction in $directions {
|
|
152
|
+
/// Ubicación absoluta, usar con position-*
|
|
153
|
+
///
|
|
154
|
+
/// @example html
|
|
155
|
+
/// <div class="position-absolute top-0 left-3"></div>
|
|
156
|
+
.#{$direction}#{$infix}-#{$spacer} {
|
|
157
|
+
#{$direction}: $length
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/// Anchos y altos en base a `$sizes` definido por Bootstrap. Para
|
|
163
|
+
/// personalizar los tamaños, modificarlos o agregarlos en `styles.scss`
|
|
164
|
+
///
|
|
165
|
+
/// @link assets/css/styles.scss
|
|
166
|
+
@each $prop, $abbrev in (width: w, height: h) {
|
|
167
|
+
@each $size, $length in $sizes {
|
|
168
|
+
.#{$abbrev}#{$infix}-#{$size} { #{$prop}: $length !important; }
|
|
169
|
+
.#{$abbrev}#{$infix}-#{$size} { #{$prop}: $length !important; }
|
|
170
|
+
.min-#{$abbrev}#{$infix}-#{$size} { min-#{$prop}: $length !important; }
|
|
171
|
+
.max-#{$abbrev}#{$infix}-#{$size} { max-#{$prop}: $length !important; }
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/// Tipos de _scroll_ posible
|
|
176
|
+
$scrolls: (auto, smooth);
|
|
177
|
+
@each $scroll in $scrolls {
|
|
178
|
+
/// Poder modificar el tipo de _scroll_ de forma _responsive_
|
|
179
|
+
///
|
|
180
|
+
/// @example html
|
|
181
|
+
/// <div class="scroll-auto scroll-md-smooth"></div>
|
|
182
|
+
.scroll#{$infix}-#{$scroll} {
|
|
183
|
+
scroll-behavior: #{$scroll};
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/// Bordes. Bootstrap no define bordes _responsive_
|
|
188
|
+
///
|
|
189
|
+
/// @link node_modules/bootstrap/scss/utilities/_borders.scss
|
|
190
|
+
/// @example html
|
|
191
|
+
/// <div class="border border-md-top-0"></div>
|
|
192
|
+
.border#{$infix} { border: $border-width solid $border-color !important; }
|
|
193
|
+
.border#{$infix}-0 { border: 0 !important; }
|
|
194
|
+
|
|
195
|
+
@each $direction in $directions {
|
|
196
|
+
.border#{$infix}-#{$direction} { border-#{$direction}: $border-width solid $border-color !important; }
|
|
197
|
+
.border#{$infix}-#{$direction}-0 { border-#{$direction}: 0 !important; }
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
$aligns: (left,center,right);
|
|
201
|
+
@each $align in $aligns {
|
|
202
|
+
/// Alineación _responsive_
|
|
203
|
+
///
|
|
204
|
+
/// @example html
|
|
205
|
+
/// <div class="text-center text-md-right"></div>
|
|
206
|
+
.text#{$infix}-#{$align} { text-align: $align !important; }
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
@each $position in $positions {
|
|
210
|
+
/// Posicionamiento
|
|
211
|
+
///
|
|
212
|
+
/// @example html
|
|
213
|
+
/// <div class="position-relative position-md-absolute"></div>
|
|
214
|
+
.position#{$infix}-#{$position} { position: $position !important; }
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
@each $color, $rgb in $colors {
|
|
218
|
+
/// Colores de fondo. Es raro que usemos versiones _responsive_, pero
|
|
219
|
+
/// no está de más tenerlas.
|
|
220
|
+
///
|
|
221
|
+
/// @link assets/css/styles.scss
|
|
222
|
+
/// @example html
|
|
223
|
+
/// <div class="background-red"></div>
|
|
224
|
+
.background#{$infix}-#{$color} {
|
|
225
|
+
background-color: var(--#{$color});
|
|
226
|
+
|
|
227
|
+
&:focus {
|
|
228
|
+
background-color: var(--#{$color});
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
@each $opacity, $degree in $opacities {
|
|
233
|
+
/// Color de fondo con transparencia (opacidad)
|
|
234
|
+
///
|
|
235
|
+
/// @example html
|
|
236
|
+
/// <div class="background-red-t2"></div>
|
|
237
|
+
.background#{$infix}-#{$color}-t#{$opacity} {
|
|
238
|
+
background-color: scale-color($rgb, $alpha: $degree);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/// Atributos de SVG
|
|
243
|
+
$svg-attributes: (stroke, fill);
|
|
244
|
+
@each $attr in $svg-attributes {
|
|
245
|
+
/// Poder cambiar el relleno o la línea de un SVG
|
|
246
|
+
///
|
|
247
|
+
/// @example html
|
|
248
|
+
/// <div class="stroke-black fill-red">
|
|
249
|
+
/// <svg/>
|
|
250
|
+
/// </div>
|
|
251
|
+
.#{$attr}#{$infix}-#{$color} {
|
|
252
|
+
svg {
|
|
253
|
+
* {
|
|
254
|
+
#{$attr}: var(--#{$color});
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
/// Barras de _scroll_ de colores
|
|
261
|
+
///
|
|
262
|
+
/// @example html
|
|
263
|
+
/// <div class="scrollbar-green"></div>
|
|
264
|
+
.scrollbar#{$infix}-#{$color} {
|
|
265
|
+
scrollbar-color: var(--#{$color}) transparent;
|
|
266
|
+
scrollbar-width: thin;
|
|
267
|
+
|
|
268
|
+
&::-webkit-scrollbar {
|
|
269
|
+
width: 5px;
|
|
270
|
+
height: 8px;
|
|
271
|
+
background-color: transparent;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
&::-webkit-scrollbar-thumb {
|
|
275
|
+
background: var(--#{$color});
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
/// Bordes de color
|
|
280
|
+
///
|
|
281
|
+
/// @example html
|
|
282
|
+
/// <div class="border-red"></div>
|
|
283
|
+
.border#{$infix}-#{$color} {
|
|
284
|
+
border-color: var(--#{$color}) !important;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/// Cambiar el fondo al pasar por encima o hacer foco
|
|
288
|
+
///
|
|
289
|
+
/// @example html
|
|
290
|
+
/// <div class="background-black background-hover-red"></div>
|
|
291
|
+
.background-hover#{$infix}-#{$color} {
|
|
292
|
+
&:hover,
|
|
293
|
+
&:focus-within {
|
|
294
|
+
background-color: var(--#{$color});
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
/// Cambiar el color al pasar por encima o hacer foco
|
|
299
|
+
///
|
|
300
|
+
/// @example html
|
|
301
|
+
/// <div class="black hover-red"></div>
|
|
302
|
+
.hover-#{$color} {
|
|
303
|
+
&:hover,
|
|
304
|
+
&:focus-within {
|
|
305
|
+
color: var(--#{$color});
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
/// Cambiar el color, también aplica a la selección de texto.
|
|
310
|
+
///
|
|
311
|
+
/// @example html
|
|
312
|
+
/// <div class="black hover-red"></div>
|
|
313
|
+
.#{$color} {
|
|
314
|
+
color: var(--#{$color});
|
|
315
|
+
|
|
316
|
+
&:focus {
|
|
317
|
+
color: var(--#{$color});
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
/// Invertir el color en la selección, con el mismo color de fondo y
|
|
321
|
+
/// texto en blanco.
|
|
322
|
+
::-moz-selection,
|
|
323
|
+
::selection {
|
|
324
|
+
background: var(--#{$color});
|
|
325
|
+
color: white;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
/// Si el contenedor tiene un color, también aplica a los bordes de los
|
|
329
|
+
/// elementos de un formulario.
|
|
330
|
+
///
|
|
331
|
+
/// @todo Evaluar si es realmente necesario hacerlo así, porque no
|
|
332
|
+
/// aplica a las sombras.
|
|
333
|
+
.form-control {
|
|
334
|
+
border-color: var(--#{$color});
|
|
335
|
+
color: var(--#{$color});
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
/// Los `<hr/>` también cambian de color.
|
|
339
|
+
///
|
|
340
|
+
/// @example html
|
|
341
|
+
/// <div class="red">
|
|
342
|
+
/// <hr/>
|
|
343
|
+
/// </div>
|
|
344
|
+
hr {
|
|
345
|
+
border-color: var(--#{$color});
|
|
346
|
+
}
|
|
347
|
+
}
|
|
52
348
|
}
|
|
53
349
|
}
|
|
54
350
|
}
|
data/_sass/menu.scss
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/// El menú hamburguesa se expande cuando obtiene el foco y se oculta
|
|
2
|
+
/// cuando lo pierde. Esto nos permite tener un menú dinámico sin
|
|
3
|
+
/// necesidad de JS.
|
|
4
|
+
///
|
|
5
|
+
/// @group Menú
|
|
6
|
+
/// @link _includes/menu.html
|
|
7
|
+
/// @todo En realidad el evento del foco está puesto en toda la navbar
|
|
8
|
+
/// en lugar de solo en el ícono de hamburguesa.
|
|
9
|
+
/// @example html
|
|
10
|
+
/// <nav class="navbar">
|
|
11
|
+
/// <button class="navbar-toggler">
|
|
12
|
+
/// <span class="navbar-toggler-icon"></span>
|
|
13
|
+
/// </button>
|
|
14
|
+
///
|
|
15
|
+
/// <div class="collapse navbar-collapse" id="menu"></div>
|
|
16
|
+
/// </nav>
|
|
17
|
+
.navbar {
|
|
18
|
+
&:focus-within {
|
|
19
|
+
.navbar-collapse {
|
|
20
|
+
@extend .d-block;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.dropdown {
|
|
25
|
+
.dropdown-menu {
|
|
26
|
+
@extend .d-none;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&:hover,
|
|
30
|
+
&:focus-within {
|
|
31
|
+
.dropdown-menu {
|
|
32
|
+
@extend .d-block;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
data/_sass/snap.scss
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
////
|
|
2
|
+
/// @group Snap
|
|
3
|
+
////
|
|
4
|
+
|
|
5
|
+
/// _Snap_ es una forma de hacer que los elementos se alineen
|
|
6
|
+
/// automáticamente a partes de su contenedor durante el _scroll_. Si le
|
|
7
|
+
/// usuarie _scrollea_ hasta la mitad, el navegador continua el _scroll_
|
|
8
|
+
/// hasta que se alinee. Es útil para presentaciones de diapositivas
|
|
9
|
+
/// (como el sitio de Sutty) o _banners_ con navegación horizontal
|
|
10
|
+
/// (_sliders_).
|
|
11
|
+
///
|
|
12
|
+
/// @link https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Scroll_Snap
|
|
13
|
+
$snap-types: (none, mandatory, proximity);
|
|
14
|
+
/// Ejes
|
|
15
|
+
$snap-directions: (y, x);
|
|
16
|
+
/// Puntos de alineación
|
|
17
|
+
$snap-points: (start, end, center, none);
|
|
18
|
+
|
|
19
|
+
@each $breakpoint in map-keys($grid-breakpoints) {
|
|
20
|
+
@include media-breakpoint-up($breakpoint) {
|
|
21
|
+
/// Obtiene el sufijo para cada clase responsive usando mixins de
|
|
22
|
+
/// Bootstrap. Valores posibles:
|
|
23
|
+
/// `""` (nada, aplica a todas las resoluciones), `-xs`, `-sm`,
|
|
24
|
+
/// `-md`, `-lg`, `-xl`.
|
|
25
|
+
$infix: breakpoint-infix($breakpoint, $grid-breakpoints);
|
|
26
|
+
|
|
27
|
+
@each $snap-type in $snap-types {
|
|
28
|
+
@each $snap-direction in $snap-directions {
|
|
29
|
+
/// El contenedor indica la dirección y obligatoriedad del snap
|
|
30
|
+
///
|
|
31
|
+
/// @example html
|
|
32
|
+
/// <div class="snap-mandatory-y snap-proximity-md-y"></div>
|
|
33
|
+
.snap-#{$snap-type}#{$infix}-#{$snap-direction} {
|
|
34
|
+
scroll-snap-points-#{$snap-direction}: repeat(100%);
|
|
35
|
+
scroll-snap-destination: 0 0;
|
|
36
|
+
|
|
37
|
+
@each $prefix in $vendor-prefixes {
|
|
38
|
+
#{$prefix}scroll-snap-type: #{$snap-direction} #{$snap-type};
|
|
39
|
+
#{$prefix}scroll-snap-type: #{$snap-type};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@each $snap-point in $snap-points {
|
|
43
|
+
/// Los elementos que son descendientes directos se alinean a
|
|
44
|
+
/// su contenedor
|
|
45
|
+
///
|
|
46
|
+
/// @example html
|
|
47
|
+
/// <div class="snap-mandatory-y snap-proximity-md-y">
|
|
48
|
+
/// <div class="snap-start"></div>
|
|
49
|
+
/// <div class="snap-center"></div>
|
|
50
|
+
/// <div class="snap-end"></div>
|
|
51
|
+
/// </div>
|
|
52
|
+
& > .snap-#{$snap-point} {
|
|
53
|
+
scroll-snap-align: #{$snap-point};
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
data/_sass/toggler.scss
CHANGED
|
@@ -1,17 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* Inspirado en https://dev.to/cydstumpel/creating-a-fold-out-navigation-with-css-only-4g9k
|
|
5
|
-
*/
|
|
1
|
+
////
|
|
2
|
+
/// @group Toggler
|
|
3
|
+
////
|
|
6
4
|
|
|
7
|
-
|
|
5
|
+
/// Desplegar menúes sin javascript!
|
|
6
|
+
///
|
|
7
|
+
/// Comenzamos con un `<input type="checkbox"/>` con la clase
|
|
8
|
+
/// `.toggler`.
|
|
9
|
+
///
|
|
10
|
+
/// @todo ¿Deprecar? Según el validador de HTML los `<label>` no pueden
|
|
11
|
+
/// contener elementos de bloques, como `<div>`.
|
|
12
|
+
/// @link https://dev.to/cydstumpel/creating-a-fold-out-navigation-with-css-only-4g9k
|
|
13
|
+
///
|
|
14
|
+
/// @example html
|
|
15
|
+
/// <div>
|
|
16
|
+
/// <input type="checkbox" class="toggler" id="toggler" />
|
|
17
|
+
/// <label for="toggler">
|
|
18
|
+
/// Esta es la parte visible, puede contener un ícono. Los
|
|
19
|
+
/// atributos id y for son importantes para que el label se
|
|
20
|
+
/// asocie con el input invisible.
|
|
21
|
+
/// <div class="toggled">
|
|
22
|
+
/// Esta es la parte solo visible cuando el label es tocado.
|
|
23
|
+
/// </div>
|
|
24
|
+
/// </label>
|
|
25
|
+
/// </div>
|
|
8
26
|
input[type="checkbox"].toggler {
|
|
9
|
-
|
|
10
|
-
|
|
27
|
+
/// Por defecto está oculto pero todavía queremos que se le pueda dar
|
|
28
|
+
/// foco con el / teclado
|
|
29
|
+
///
|
|
30
|
+
/// @todo ¿Usar `@extend .sr-only`?
|
|
11
31
|
opacity: 0;
|
|
12
32
|
position: absolute;
|
|
13
33
|
|
|
14
|
-
|
|
34
|
+
/// El `<label>` inmediatamente posterior al `<input>` (`+`) contiene
|
|
35
|
+
/// descendientes con la clase `.toggled` que cambian la visibilidad según
|
|
36
|
+
/// el estado del `<input>`.
|
|
15
37
|
& + label {
|
|
16
38
|
.toggled {
|
|
17
39
|
z-index: 10;
|
|
@@ -19,7 +41,7 @@ input[type="checkbox"].toggler {
|
|
|
19
41
|
}
|
|
20
42
|
}
|
|
21
43
|
|
|
22
|
-
|
|
44
|
+
/// Al tocar el `<input>`, mostramos el elemento oculto.
|
|
23
45
|
&:checked + label {
|
|
24
46
|
.toggled {
|
|
25
47
|
visibility: visible;
|
|
@@ -32,7 +54,8 @@ input[type="checkbox"].toggler {
|
|
|
32
54
|
z-index: 11;
|
|
33
55
|
}
|
|
34
56
|
|
|
35
|
-
|
|
57
|
+
/// Dar una guía visual de que estamos enfocando el `<input>`,
|
|
58
|
+
/// trasladando el mismo estilo a su `<label>`
|
|
36
59
|
&:focus + label {
|
|
37
60
|
outline: 1px dotted grey ;
|
|
38
61
|
}
|