radios-comunitarias-jekyll-theme 0.3.0rc0 → 0.3.0rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +69 -18
  3. data/_config.yml +85 -0
  4. data/_data/actions.yml +9 -0
  5. data/_data/activity_pub.yml +8 -0
  6. data/_data/components.yml +10 -0
  7. data/_data/en.yml +159 -23
  8. data/_data/es.yml +159 -22
  9. data/_data/full_width_components.yml +2 -0
  10. data/_data/layouts/menu.yml +72 -0
  11. data/_data/layouts/post.yml +11 -11
  12. data/_data/layouts/radio.yml +80 -0
  13. data/_data/layouts/theme.yml +291 -0
  14. data/_data/manifest.json +1340 -0
  15. data/_data/theme.yml +142 -0
  16. data/_includes/activity_pub/actor.html +11 -0
  17. data/_includes/activity_pub/actor_mention.html +28 -0
  18. data/_includes/activity_pub/button.html +22 -0
  19. data/_includes/activity_pub/button_bar.html +16 -0
  20. data/_includes/activity_pub/cards.html +28 -0
  21. data/_includes/activity_pub/fediverse_interactions.html +2 -0
  22. data/_includes/activity_pub/generic_modal.html +55 -0
  23. data/_includes/activity_pub/image_modal.html +27 -0
  24. data/_includes/activity_pub/interactions.html +78 -0
  25. data/_includes/activity_pub/login_modal.html +70 -0
  26. data/_includes/activity_pub/reaction.html +45 -0
  27. data/_includes/activity_pub/reactions.html +17 -0
  28. data/_includes/activity_pub/replying_to.html +23 -0
  29. data/_includes/activity_pub/text_modal.html +16 -0
  30. data/_includes/activity_pub/toot_card.html +95 -0
  31. data/_includes/activity_pub/url.html +8 -0
  32. data/_includes/activity_pub/video_modal.html +20 -0
  33. data/_includes/boolean.html +9 -1
  34. data/_includes/bootstrap/custom_select.html +18 -0
  35. data/_includes/buttons/button.html +9 -0
  36. data/_includes/buttons/copy.html +28 -0
  37. data/_includes/buttons/generic.html +15 -0
  38. data/_includes/buttons/link.html +14 -0
  39. data/_includes/contact.html +6 -8
  40. data/_includes/content.html +9 -1
  41. data/_includes/device_detector.html +30 -0
  42. data/_includes/email.html +9 -1
  43. data/_includes/embed_responsive.html +16 -0
  44. data/_includes/external_link.html +15 -0
  45. data/_includes/fa.html +11 -0
  46. data/_includes/file.html +9 -1
  47. data/_includes/floating_alert.html +6 -0
  48. data/_includes/footer.html +1 -12
  49. data/_includes/headings/generic.html +14 -0
  50. data/_includes/headings/h1.html +9 -0
  51. data/_includes/headings/h2.html +9 -0
  52. data/_includes/headings/h3.html +9 -0
  53. data/_includes/headings/with_link.html +15 -0
  54. data/_includes/image.html +9 -1
  55. data/_includes/input.html +34 -7
  56. data/_includes/item.html +38 -0
  57. data/_includes/logo.html +1 -0
  58. data/_includes/markdown_content.html +9 -1
  59. data/_includes/menu.html +27 -0
  60. data/_includes/navbar.html +5 -1
  61. data/_includes/notification.html +5 -0
  62. data/_includes/number.html +9 -1
  63. data/_includes/pack.html +10 -0
  64. data/_includes/password.html +10 -0
  65. data/_includes/picture.html +25 -0
  66. data/_includes/post.html +18 -7
  67. data/_includes/predefined_array.html +10 -2
  68. data/_includes/preload_font.html +1 -0
  69. data/_includes/reproductor.html +29 -12
  70. data/_includes/script.html +5 -0
  71. data/_includes/search.html +25 -0
  72. data/_includes/share.html +8 -8
  73. data/_includes/share_box.html +41 -12
  74. data/_includes/social_networks.html +6 -0
  75. data/_includes/stretched_link.html +15 -0
  76. data/_includes/string.html +10 -1
  77. data/_includes/submit.html +13 -1
  78. data/_includes/svg/copy-icon.svg +1 -0
  79. data/_includes/svg/done-icon.svg +1 -0
  80. data/_includes/svg/menu.svg +9 -0
  81. data/_includes/svg/x.svg +3 -0
  82. data/_includes/tel.html +9 -1
  83. data/_includes/text.html +9 -1
  84. data/_includes/theme/button_with_copy.html +1 -0
  85. data/_includes/theme/button_with_link.html +5 -0
  86. data/_includes/theme/buttons.html +33 -0
  87. data/_includes/theme/colors.html +14 -0
  88. data/_includes/theme/content.html +41 -0
  89. data/_includes/theme/embed_responsive.html +10 -0
  90. data/_includes/theme/font_sizes.html +18 -0
  91. data/_includes/theme/footer.html +1 -0
  92. data/_includes/theme/letter_spacing.html +3 -0
  93. data/_includes/theme/picture.html +5 -0
  94. data/_includes/toggler/toggler.html +21 -0
  95. data/_includes/toggler/toggler_label.html +21 -0
  96. data/_includes/toggler/toggler_related.html +23 -0
  97. data/_includes/url.html +9 -1
  98. data/_layouts/default.html +50 -22
  99. data/_layouts/home.html +7 -5
  100. data/_layouts/page.html +5 -0
  101. data/_layouts/theme.html +60 -0
  102. data/_sass/accessibility.scss +40 -7
  103. data/_sass/content.scss +28 -0
  104. data/_sass/editor.scss +17 -0
  105. data/_sass/embed.scss +8 -0
  106. data/_sass/floating_alert.scss +48 -0
  107. data/_sass/fonts.scss +29 -0
  108. data/_sass/menu.scss +36 -0
  109. data/_sass/snap.scss +60 -0
  110. data/_sass/toggler.scss +15 -34
  111. data/_sass/utilities.scss +527 -0
  112. data/assets/css/styles.scss +15 -16
  113. data/assets/data/site.json +10 -0
  114. data/assets/fonts/forkawesome-webfont.woff2 +0 -0
  115. data/assets/fonts/roboto/v27/KFOjCnqEu92Fr1Mu51TzBhc9-subset.woff2 +0 -0
  116. data/assets/fonts/roboto/v27/KFOkCnqEu92Fr1MmgWxP-subset.woff2 +0 -0
  117. data/assets/fonts/roboto/v27/KFOkCnqEu92Fr1Mu52xP-subset.woff2 +0 -0
  118. data/assets/fonts/roboto/v27/KFOlCnqEu92Fr1MmWUlvAw-subset.woff2 +0 -0
  119. data/assets/fonts/roboto/v27/KFOmCnqEu92Fr1Me5Q-subset.woff2 +0 -0
  120. data/assets/js/env.js +8 -0
  121. data/assets/js/pack.L3BFF2IJ.js +40 -0
  122. data/assets/js/pack.L3BFF2IJ.js.map +7 -0
  123. metadata +285 -21
  124. data/_data/forms/contacto.yml +0 -40
  125. data/_sass/helpers.scss +0 -54
  126. data/_sass/share.html +0 -12
  127. data/_sass/share_box.html +0 -16
  128. data/assets/js/script.js +0 -82
@@ -0,0 +1,21 @@
1
+ {% comment %}
2
+ Este label puede usarse para abrir y cerrar un elemento asociado a
3
+ toggler.html
4
+
5
+ Mientras compartan la misma ID puede colocarse el label en cualquier
6
+ lado del HTML.
7
+
8
+ @see toggler.html
9
+ @param :id [String] La ID del elemento
10
+ @param :class [String] CSS
11
+ @param :content [String] Contenido
12
+ {% endcomment %}
13
+ <label
14
+ data-controller="label"
15
+ tabindex="0"
16
+ aria-hidden="true"
17
+ id="{{ include.id }}-label"
18
+ for="{{ include.id }}"
19
+ class="{{ include.class }}">
20
+ {{ include.content }}
21
+ </label>
@@ -0,0 +1,23 @@
1
+ {% comment %}
2
+ Este label puede usarse para abrir y cerrar un elemento asociado a
3
+ toggler.html
4
+
5
+ Similar a toggler_label.html pero no comparte la misma ID, se puede
6
+ usar para botones de cierre o relacionados, pero que no aportan
7
+ descripción al elemento que se abre y cierra (especialmente para
8
+ lectores de pantalla).
9
+
10
+ @see togger_label.html
11
+ @param :id [String] La ID del elemento
12
+ @param :class [String] CSS
13
+ @param :content [HTML] Contenido
14
+ {% endcomment %}
15
+ <label
16
+ data-controller="label"
17
+ tabindex="0"
18
+ aria-hidden="true"
19
+ id="{{ include.id }}-label-related"
20
+ for="{{ include.id }}"
21
+ class="{{ include.class }}">
22
+ {{ include.content }}
23
+ </label>
data/_includes/url.html CHANGED
@@ -1 +1,9 @@
1
- {% include input.html field=field %}
1
+ {%- comment -%}
2
+
3
+ Form: type url
4
+
5
+ @param :field [Integer] El campo del formulario
6
+ @param :input_class [String] Las clases del componente
7
+ {%- endcomment -%}
8
+
9
+ {% include input.html field=field input_class=include.input_class %}
@@ -9,14 +9,59 @@
9
9
  <meta name="color-scheme" content="light"/>
10
10
  <meta name="referrer" content="strict-origin-when-cross-origin"/>
11
11
 
12
- <link href="assets/css/styles.css" rel="stylesheet">
13
- <script defer type="text/javascript" src="assets/js/script.js"></script>
12
+ {% comment %}
13
+ No tenemos forma de hashear SASS aún, por lo que renovamos la caché
14
+ aplicando la hora de compilación del sitio. Es importante que los
15
+ CSS se renueven cuando se regenera el sitio, porque pueden contener
16
+ variables dinámicas (como personalización de colores y tipografía) o
17
+ minificarse distinto dependiendo del contenido.
18
+ {% endcomment %}
19
+ <link href="assets/css/styles.css?{{ site.time | date: '%s' }}" rel="stylesheet" data-turbo-track="reload">
20
+
21
+ {% include_cached pack.html %}
22
+
23
+ {% comment %}
24
+ Agregar otras tipografías. Esto hace que las tipografías se carguen
25
+ lo más rápido posible y minimizar el tiempo en que se ven las del
26
+ navegador. En Firefox todavía no está soportado.
27
+
28
+ Fork Awesome lleva la hora de generación para poder renovarlo si
29
+ agregamos íconos nuevos, de lo contrario puede quedar cacheado para
30
+ siempre y les visitantes van a ver íconos rotos.
31
+ {% endcomment %}
32
+ {% include_cached preload_font.html font='assets/fonts/forkawesome-webfont.woff2' %}
33
+
34
+ <link rel="icon" type="image/svg+xml" href="public/favicon.svg">
35
+ <link rel="alternate icon" href="public/favicon.ico">
36
+ <link rel="mask-icon" href="public/favicon.svg" color="white">
14
37
 
15
38
  {% seo %}
16
39
  {% feed_meta %}
17
40
 
41
+ {% if page.url == '/' %}
42
+ {% for locale in site.locales %}
43
+ <link rel="alternate" hreflang="{{ locale }}" href="../{{ locale }}/" />
44
+ {% endfor %}
45
+
46
+ <link rel="alternate" hreflang="x-default" href="../{{ site.default_locale }}/" />
47
+ {% else %}
48
+ {% for locale in page.locales %}
49
+ <link rel="alternate" hreflang="{{ locale.collection }}" href="../{{ locale.url }}" />
50
+
51
+ {% if locale.collection == site.default_locale %}
52
+ <link rel="alternate" hreflang="x-default" href="../{{ locale.url }}" />
53
+ {% endif %}
54
+ {% endfor %}
55
+
56
+ {% if site.locale == site.default_locale %}
57
+ <link rel="alternate" hreflang="x-default" href="../{{ page.url }}" />
58
+ {% endif %}
59
+ {% endif %}
60
+
61
+ {% include_cached social_networks.html %}
62
+
18
63
  {%- if page.activity -%}
19
- <link href="{{ page.activity.url | absolute_url }}" rel="alternate" type="application/activity+json" />
64
+ <link href="{{ page.activity.id | absolute_url }}" rel="alternate" type="application/activity+json" />
20
65
  {%- endif -%}
21
66
 
22
67
  {%- if site.activity_pub_profile -%}
@@ -24,24 +69,7 @@
24
69
  {%- endif -%}
25
70
 
26
71
  {%- if site.actor -%}
27
- <link rel="me" href="{{ site.actor.url | absolute_url }}" />
28
- {%- endif -%}
29
-
30
- {%- if page.locales -%}
31
- {% for locale in page.locales %}
32
- <link
33
- rel="alternate"
34
- hreflang="{{ locale.collection }}"
35
- href="{{ site.url }}{{ locale.collection }}/{{ locale.url }}" />
36
- {% endfor %}
37
- {%- else -%}
38
- {% for locale in site.locales %}
39
- {% if locale == site.locale %}{% continue %}{% endif %}
40
- <link
41
- rel="alternate"
42
- hreflang="{{ locale }}"
43
- href="{{ site.url }}{{ locale }}/" />
44
- {% endfor %}
72
+ <link rel="me" href="{{ site.actor.id | absolute_url }}" />
45
73
  {%- endif -%}
46
74
  </head>
47
75
  {% comment %}
@@ -57,7 +85,7 @@
57
85
  El espacio principal se expande para ocupar todo el alto
58
86
  disponible y empuja el pie al fondo.
59
87
  {% endcomment %}
60
- <main class="flex-grow-1">
88
+ <main tabindex="-1" role="main" id="content" class="flex-grow-1">
61
89
  <div class="row no-gutters align-items-center justify-content-center d-print-block">
62
90
  <div class="col-10">
63
91
  {{ content }}
data/_layouts/home.html CHANGED
@@ -13,17 +13,19 @@ layout: default
13
13
 
14
14
  {% include_cached post.html page=post %}
15
15
 
16
- <footer>
16
+ <footer class="mt-5">
17
17
  <div class="row no-gutters">
18
18
  <div class="col-12 col-md-6">
19
19
  <h2>{{ site.i18n.other_posts }}</h2>
20
20
  <div>
21
21
  {% for post in posts offset: 1 %}
22
- <h3>
23
- <a href="{{ post.url }}">{{ post.title }}</a>
24
- </h3>
22
+ <article class="content">
23
+ <h3>
24
+ <a href="{{ post.url }}">{{ post.title }}</a>
25
+ </h3>
25
26
 
26
- <p class="lead">{{ post.description }}</p>
27
+ <p class="lead">{{ post.description }}</p>
28
+ </article>
27
29
  {% endfor %}
28
30
  </div>
29
31
  </div>
@@ -0,0 +1,5 @@
1
+ ---
2
+ layout: default
3
+ ---
4
+
5
+ {{ content }}
@@ -0,0 +1,60 @@
1
+ ---
2
+ layout: default
3
+ ---
4
+
5
+ {% capture components %}
6
+ {% for component in site.data.components %}
7
+ {% assign component_include = "theme/" | append: component | append: ".html" %}
8
+ {% assign title = component | replace: "_", " " | capitalize %}
9
+
10
+ <section id="{{ component | replace: "_", "-" }}" class="mb-5">
11
+ <header>
12
+ {% include headings/with_link.html level=1 text=title %}
13
+ </header>
14
+
15
+ {% include {{ component_include }} %}
16
+ </section>
17
+ {% endfor %}
18
+ {% endcapture %}
19
+
20
+ {% capture full_width_components %}
21
+ {% for component in site.data.full_width_components %}
22
+ {% assign component_include = "theme/" | append: component | append: ".html" %}
23
+ {% assign title = component | replace: "_", " " | capitalize %}
24
+
25
+ <section id="{{ component | replace: "_", "-" }}" class="mb-5">
26
+ <header>
27
+ {% include headings/with_link.html level=1 text=title %}
28
+ </header>
29
+
30
+ {% include {{ component_include }} %}
31
+ </section>
32
+ {% endfor %}
33
+ {% endcapture %}
34
+
35
+ <div class="container-fluid">
36
+ <div class="row">
37
+ <aside class="col-12 col-md-3">
38
+ <ol class="list-unstyled">
39
+ {%- assign toc_full_width = full_width_components | table_of_contents: 1 -%}
40
+ {%- assign toc = components | table_of_contents: 1 | concat: toc_full_width -%}
41
+
42
+ {% for item in toc %}
43
+ <li>
44
+ <a href="#{{ item.id }}" data-turbo="false">
45
+ {{- item.title -}}
46
+ </a>
47
+ </li>
48
+ {% endfor %}
49
+ </ol>
50
+ </aside>
51
+
52
+ <section class="col-12 col-md">
53
+ {{ components }}
54
+ </section>
55
+ </div>
56
+ </div>
57
+
58
+ <section class="w-100">
59
+ {{ full_width_components }}
60
+ </section>
@@ -1,13 +1,46 @@
1
- * {
2
- scroll-behavior: smooth;
3
- }
1
+ ////
2
+ /// Accesibilidad
3
+ /// @group Accesibilidad
4
+ ////
4
5
 
5
- /*
6
- * Deshabilita animaciones si la usuaria las tiene deshabilitadas
7
- */
6
+ /// Aquí se aplica la opción `prefers-reduced-motion: reduce`, pero
7
+ /// SassDoc no la estaría mostrando.
8
8
  @media (prefers-reduced-motion: reduce) {
9
+ /// Si les usuaries prefirieron reducir las animaciones de los sitios,
10
+ /// deshabilitamos la navegación suavizada y las animaciones.
9
11
  * {
10
- scroll-behavior: auto;
12
+ scroll-behavior: auto !important;
11
13
  animation: none !important;
12
14
  }
13
15
  }
16
+
17
+ /// Utilizamos Axe para poder marcarnos cuáles elementos no cumplen con
18
+ /// parámetros de accesibilidad durante el desarrollo. Esta clase
19
+ /// muestra un borde rojo alrededor de los elementos inaccesibles y al
20
+ /// obtener el foco, muestra los mensajes de error generados por Axe.js.
21
+ ///
22
+ /// @link _packs/entry.js
23
+ .inaccesible {
24
+ outline: $red 1px solid;
25
+
26
+ @extend .position-relative;
27
+
28
+ &:focus::after {
29
+ @extend .position-fixed;
30
+ @extend .background-red;
31
+ @extend .white;
32
+ @extend .p-3;
33
+
34
+ left: 0;
35
+ bottom: 0;
36
+ width: 100vw;
37
+ font-size: 1rem;
38
+
39
+ word-wrap: normal;
40
+ line-break: auto;
41
+ white-space: pre-line;
42
+
43
+ /// El contenido se trae desde el ariaLabel del elemento.
44
+ content: attr(aria-label);
45
+ }
46
+ }
@@ -0,0 +1,28 @@
1
+ .content {
2
+ p { min-height: $font-size-base * $line-height-base; }
3
+ h1 { min-height: $h1-font-size * $headings-line-height; }
4
+ h2 { min-height: $h2-font-size * $headings-line-height; }
5
+ h3 { min-height: $h3-font-size * $headings-line-height; }
6
+ h4 { min-height: $h4-font-size * $headings-line-height; }
7
+ h5 { min-height: $h5-font-size * $headings-line-height; }
8
+ h6 { min-height: $h6-font-size * $headings-line-height; }
9
+
10
+ iframe { border: 0; }
11
+
12
+ audio { width: 100%; }
13
+
14
+ img,
15
+ video,
16
+ iframe {
17
+ @extend .img-fluid;
18
+ height: auto;
19
+ }
20
+
21
+ & > * {
22
+ margin-bottom: 1rem;
23
+
24
+ &:last-child {
25
+ margin-bottom: 0;
26
+ }
27
+ }
28
+ }
data/_sass/editor.scss ADDED
@@ -0,0 +1,17 @@
1
+ ////
2
+ /// Estilos del editor de Sutty
3
+ /// @group Editor
4
+ ///
5
+
6
+ /// Alineaciones soportadas. No soportamos justificado porque es
7
+ /// difícil que quede bien en web.
8
+ $aligns: (left,center,right);
9
+
10
+ /// Recorrer las alineaciones.
11
+ /// @name Alineaciones
12
+ @each $align in $aligns {
13
+ /// El editor coloca la alineación en un atributo data-align,
14
+ /// recorriendo cada una de las alineaciones disponibles.
15
+ /// @todo Lograr que SassDoc muestre el código completo.
16
+ div[data-align="#{$align}"] { text-align: $align; }
17
+ }
data/_sass/embed.scss CHANGED
@@ -1,3 +1,11 @@
1
+ ////
2
+ /// Recursos externos
3
+ /// @group Recursos externos
4
+ ///
5
+
6
+ /// Los `<iframe>` ocupan todo el ancho del contenedor y tienen un alto
7
+ /// mínimo de 480px.
8
+ /// @link jekyll-embed-urls
1
9
  iframe {
2
10
  border: 0;
3
11
  width: 100%;
@@ -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
@@ -0,0 +1,29 @@
1
+ // https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,400;0,700;1,400;1,700&display=swap
2
+ @font-face {
3
+ font-family: 'Roboto';
4
+ font-style: italic;
5
+ font-weight: 400;
6
+ font-display: swap;
7
+ src: url(../fonts/roboto/v27/KFOkCnqEu92Fr1Mu52xP-subset.woff2) format('woff2');
8
+ }
9
+ @font-face {
10
+ font-family: 'Roboto';
11
+ font-style: italic;
12
+ font-weight: 700;
13
+ font-display: swap;
14
+ src: url(../fonts/roboto/v27/KFOjCnqEu92Fr1Mu51TzBhc9-subset.woff2) format('woff2');
15
+ }
16
+ @font-face {
17
+ font-family: 'Roboto';
18
+ font-style: normal;
19
+ font-weight: 400;
20
+ font-display: swap;
21
+ src: url(../fonts/roboto/v27/KFOmCnqEu92Fr1Me5Q-subset.woff2) format('woff2');
22
+ }
23
+ @font-face {
24
+ font-family: 'Roboto';
25
+ font-style: normal;
26
+ font-weight: 700;
27
+ font-display: swap;
28
+ src: url(../fonts/roboto/v27/KFOlCnqEu92Fr1MmWUlvAw-subset.woff2) format('woff2');
29
+ }
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,39 +1,20 @@
1
- /*
2
- * Desplegar menúes sin javascript!
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
- // Comenzamos con un input checkbox con la clase toggler
8
- input[type="checkbox"].toggler {
9
- // Lo ocultamos pero todavía queremos que se le pueda dar foco con el
10
- // teclado
11
- opacity: 0;
12
- position: absolute;
13
-
14
- // Ocultamos el elemento colapsable
15
- & ~ label {
16
- .toggled {
17
- z-index: 10;
18
- visibility: hidden;
19
- }
20
- }
21
-
22
- // Al tildar el input, mostramos el elemento
23
- &:checked ~ label {
24
- .toggled {
25
- visibility: visible;
26
- }
27
- }
28
-
29
- & + label {
30
- border: none;
31
- outline: none;
32
- z-index: 11;
5
+ /// Desplegar menúes sin javascript!
6
+ ///
7
+ /// Comenzamos con un `<input type="checkbox"/>` con la clase
8
+ /// `.toggler`.
9
+ ///
10
+ /// @link https://dev.to/cydstumpel/creating-a-fold-out-navigation-with-css-only-4g9k
11
+ /// @see toggler.html
12
+ .toggler {
13
+ & + .toggled {
14
+ visibility: hidden;
33
15
  }
34
16
 
35
- // Dar una guía visual de que estamos enfocando el input
36
- &:focus + label {
37
- outline: 1px dotted grey ;
17
+ &:checked + .toggled {
18
+ visibility: visible;
38
19
  }
39
20
  }