editorial-autogestiva-jekyll-theme 0.2.7 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (131) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +0 -2
  3. data/_config.yml +73 -0
  4. data/_data/en.yml +129 -27
  5. data/_data/es.yml +111 -31
  6. data/_data/forms/billing_address.yml +71 -0
  7. data/_data/forms/contacto.yml +2 -2
  8. data/_data/forms/shipping_address.yml +76 -0
  9. data/_data/forms/user.yml +11 -0
  10. data/_data/layouts/book.yml +82 -93
  11. data/_data/layouts/cart.yml +198 -0
  12. data/_data/layouts/confirmation.yml +68 -0
  13. data/_data/layouts/menu.yml +65 -0
  14. data/_data/layouts/payment.yml +114 -0
  15. data/_data/layouts/post.yml +0 -1
  16. data/_data/layouts/shipment.yml +126 -0
  17. data/_includes/boolean.html +30 -0
  18. data/_includes/cart.svg +1 -0
  19. data/_includes/cart_add.html +8 -0
  20. data/_includes/cart_controller.html +10 -0
  21. data/_includes/contact.html +6 -5
  22. data/_includes/content.html +1 -0
  23. data/_includes/country.html +53 -0
  24. data/_includes/editorial.html +24 -30
  25. data/_includes/email.html +1 -0
  26. data/_includes/file.html +35 -0
  27. data/_includes/floating_alert.html +6 -0
  28. data/_includes/footer.html +10 -8
  29. data/_includes/form/boolean.html +1 -0
  30. data/_includes/form/content.html +1 -0
  31. data/_includes/form/email.html +1 -0
  32. data/_includes/form/file.html +1 -0
  33. data/_includes/form/hidden.html +1 -0
  34. data/_includes/form/image.html +1 -0
  35. data/_includes/form/input.html +1 -0
  36. data/_includes/form/markdown_content.html +1 -0
  37. data/_includes/form/number.html +1 -0
  38. data/_includes/form/predefined_array.html +1 -0
  39. data/_includes/form/section.html +1 -0
  40. data/_includes/form/separator.html +1 -0
  41. data/_includes/form/string.html +1 -0
  42. data/_includes/form/submit.html +1 -0
  43. data/_includes/form/tel.html +1 -0
  44. data/_includes/form/text.html +1 -0
  45. data/_includes/form/url.html +1 -0
  46. data/_includes/hidden.html +5 -0
  47. data/_includes/image.html +32 -0
  48. data/_includes/input.html +45 -0
  49. data/_includes/item.html +38 -0
  50. data/_includes/markdown_content.html +1 -0
  51. data/_includes/menu.html +27 -0
  52. data/_includes/navbar.html +29 -25
  53. data/_includes/notification.html +5 -0
  54. data/_includes/number.html +1 -0
  55. data/_includes/password.html +1 -0
  56. data/_includes/picture.html +23 -0
  57. data/_includes/postal_code.html +45 -0
  58. data/_includes/predefined_array.html +39 -0
  59. data/_includes/preload_font.html +1 -0
  60. data/_includes/search.html +25 -0
  61. data/_includes/section.html +1 -0
  62. data/_includes/separator.html +1 -0
  63. data/_includes/share.html +22 -0
  64. data/_includes/share_box.html +16 -0
  65. data/_includes/state.html +53 -0
  66. data/_includes/string.html +3 -0
  67. data/_includes/submit.html +1 -0
  68. data/_includes/tel.html +1 -0
  69. data/_includes/text.html +32 -0
  70. data/_includes/url.html +1 -0
  71. data/_layouts/book.html +42 -84
  72. data/_layouts/cart.html +72 -0
  73. data/_layouts/confirmation.html +17 -0
  74. data/_layouts/default.html +30 -10
  75. data/_layouts/home.html +23 -13
  76. data/_layouts/payment.html +21 -0
  77. data/_layouts/post.html +5 -5
  78. data/_layouts/shipment.html +52 -0
  79. data/_sass/accessibility.scss +37 -0
  80. data/_sass/editor.scss +8 -0
  81. data/_sass/embed.scss +5 -0
  82. data/_sass/floating_alert.scss +10 -0
  83. data/_sass/helpers.scss +318 -0
  84. data/_sass/logic.scss +17 -0
  85. data/_sass/menu.scss +20 -0
  86. data/_sass/share.html +12 -0
  87. data/_sass/share_box.html +16 -0
  88. data/_sass/share_box.scss +26 -0
  89. data/_sass/snap.scss +58 -0
  90. data/_sass/toggler.scss +39 -0
  91. data/assets/css/styles.scss +41 -5
  92. data/assets/data/site.json +24 -0
  93. data/assets/fonts/forkawesome-webfont.woff2 +0 -0
  94. data/assets/js/pack.js +16 -0
  95. data/assets/js/pack.js.map +1 -0
  96. data/assets/js/script.js +44 -0
  97. data/assets/templates/alert.html +7 -0
  98. data/assets/templates/cart.html +65 -0
  99. data/assets/templates/payment_methods.html +41 -0
  100. data/assets/templates/recover_order.html +11 -0
  101. data/assets/templates/results.html +17 -0
  102. data/assets/templates/shipping_methods.html +36 -0
  103. metadata +231 -33
  104. data/README.md.orig +0 -118
  105. data/_includes/boolean.html +0 -1
  106. data/_includes/contact.html.orig +0 -55
  107. data/_includes/email.html +0 -1
  108. data/_includes/form/boolean.html +0 -30
  109. data/_includes/form/email.html +0 -1
  110. data/_includes/form/hidden.html +0 -5
  111. data/_includes/form/input.html +0 -33
  112. data/_includes/form/number.html +0 -1
  113. data/_includes/form/predefined_array.html +0 -39
  114. data/_includes/form/section.html +0 -1
  115. data/_includes/form/separator.html +0 -1
  116. data/_includes/form/string.html +0 -3
  117. data/_includes/form/submit.html +0 -1
  118. data/_includes/form/text.html +0 -32
  119. data/_includes/form/url.html +0 -1
  120. data/_includes/hidden.html +0 -1
  121. data/_includes/input.html +0 -1
  122. data/_includes/navbar.html.orig +0 -44
  123. data/_includes/number.html +0 -1
  124. data/_includes/predefined_array.html +0 -1
  125. data/_includes/section.html +0 -1
  126. data/_includes/separator.html +0 -1
  127. data/_includes/string.html +0 -1
  128. data/_includes/submit.html +0 -1
  129. data/_includes/text.html +0 -1
  130. data/_includes/url.html +0 -1
  131. data/_sass/home.scss +0 -22
@@ -0,0 +1,72 @@
1
+ ---
2
+ layout: default
3
+ ---
4
+
5
+ <section>
6
+ <h1>{{ page.title }}</h1>
7
+ <div class="content">
8
+ {{ content | replace: '<img ', '<img loading="lazy" ' | replace: '<iframe ', '<iframe loading="lazy" ' }}
9
+ </div>
10
+
11
+ <div
12
+ data-controller="order"
13
+ data-order-item-template="assets/templates/cart.html">
14
+
15
+ <div class="row no-gutters align-items-center font-weight-bold justify-content-center">
16
+ <div class="d-none d-lg-block col-lg-4 p-3">
17
+ <h4 class="m-0">{{ page.product }}</h4>
18
+ </div>
19
+
20
+ <div class="d-none d-lg-block col-lg-8">
21
+ <div class="row no-gutters align-items-center">
22
+ <div class="col-lg p-3">
23
+ <h4 class="m-0">{{ page.price }}</h4>
24
+ </div>
25
+
26
+ <div class="col-lg p-3">
27
+ <h4 class="m-0">{{ page.quantity }}</h4>
28
+ </div>
29
+
30
+ <div class="col-lg p-3">
31
+ <h4 class="m-0">{{ page.subtotal }}</h4>
32
+ </div>
33
+
34
+ <div class="col-lg-2 p-3">
35
+ <h4 class="m-0 sr-only">{{ page.remove }}</h4>
36
+ </div>
37
+ </div>
38
+ </div>
39
+
40
+ <div class="col-12" data-target="order.cart">
41
+ </div>
42
+ </div>
43
+
44
+ <div class="row no-gutters align-items-end">
45
+ <div class="order-last order-md-first col-12 col-md-6 col-lg-4 mt-3 mt-md-0">
46
+ <a href="?" class="btn btn-transparent black border text-uppercase">
47
+ {{ page.back }}
48
+ </a>
49
+ </div>
50
+
51
+ <div class="col-12 col-md-6 col-lg-8">
52
+ <div class="row no-gutters align-items-center">
53
+ <div class="col-lg"></div>
54
+
55
+ <div class="col-6 col-lg text-right">
56
+ <p class="font-weight-bold">{{ page.subtotal }}</p>
57
+ </div>
58
+
59
+ <div class="col-6 col-lg text-center">
60
+ <p class="font-weight-bold" data-target="order.subtotal">0</p>
61
+ </div>
62
+
63
+ <div class="col-lg-2"></div>
64
+
65
+ <div class="col-12">
66
+ <a href="{{ site.shipment.url }}" class="btn btn-block btn-primary text-uppercase">{{ site.shipment.title }}</a>
67
+ </div>
68
+ </div>
69
+ </div>
70
+ </div>
71
+ </div>
72
+ </section>
@@ -0,0 +1,17 @@
1
+ ---
2
+ layout: default
3
+ ---
4
+
5
+ <section data-controller="cart-confirmation" data-clear="true">
6
+ <header>
7
+ <h1>{{ page.title }}</h1>
8
+ </header>
9
+
10
+ <div class="content">
11
+ {{ content }}
12
+ </div>
13
+
14
+ <p data-controller="cart-paypal-confirmation"></p>
15
+
16
+ <a href="?" class="btn btn-primary text-uppercase">{{ page.back }}</a>
17
+ </section>
@@ -7,37 +7,57 @@
7
7
  <meta content="width=device-width, initial-scale=1.0" name="viewport">
8
8
  <meta name="theme-color" content="white"/>
9
9
  <meta name="color-scheme" content="light"/>
10
+ <meta name="referrer" content="strict-origin-when-cross-origin"/>
10
11
 
11
12
  <link href="assets/css/styles.css" rel="stylesheet">
12
13
 
14
+ {% comment %}
15
+ Webpack. La configuración se pasa por variables de entorno, en
16
+ desarrollo hay que evitar el archivo .env (copiarlo de .env.example
17
+ si no existe.
18
+ {% endcomment %}
19
+ <link rel="preload" as="script" type="text/javascript" href="env.js" />
20
+ <script type="text/javascript" src="env.js"></script>
21
+ <script defer type="text/javascript" src="assets/js/pack.js"></script>
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
+ {% endcomment %}
28
+ {% include_cached preload_font.html font='assets/fonts/forkawesome-webfont.woff2' %}
29
+
30
+ <link rel="icon" type="image/svg+xml" href="public/favicon.svg">
31
+ <link rel="alternate icon" href="public/favicon.ico">
32
+ <link rel="mask-icon" href="public/favicon.svg" color="white">
33
+
13
34
  {% seo %}
14
35
  {% feed_meta %}
15
36
  </head>
16
37
  <body>
38
+ <div id="header" data-turbolinks-permanent>
39
+ {%- include_cached notification.html -%}
40
+ </div>
41
+
17
42
  {% comment %}
18
43
  Como los libros nunca salen en el menú, podemos cachearlo
19
44
  {% endcomment %}
20
-
21
45
  {%- if page.layout == 'book' -%}
22
46
  {% include_cached navbar.html %}
23
47
  {%- else %}
24
48
  {% include navbar.html %}
25
49
  {%- endif -%}
26
50
 
27
- <main class="container">
51
+ <main data-controller="stock" class="container mb-3">
28
52
  <div class="row justify-content-center d-print-block">
29
53
  <div class="col">
30
54
  {{ content }}
31
55
  </div>
32
56
  </div>
33
-
34
- {%- if page.layout == 'editorial' -%}
35
- {%- assign footer = false -%}
36
- {%- else -%}
37
- {%- assign footer = true -%}
38
- {%- endif -%}
39
-
40
- {% include_cached footer.html footer=footer %}
41
57
  </main>
58
+
59
+ {%- assign footer = page.layout | not: 'editorial' -%}
60
+ {% include_cached footer.html footer=footer %}
61
+ {% include floating_alert.html %}
42
62
  </body>
43
63
  </html>
data/_layouts/home.html CHANGED
@@ -2,20 +2,30 @@
2
2
  layout: default
3
3
  ---
4
4
 
5
- <div class="row books">
6
- {% assign books = site.posts | where: 'layout', 'book' %}
5
+ {% assign books = site.posts | where: 'layout', 'book' %}
6
+
7
+ <div class="row books row-cols-1 row-cols-md-3 row-cols-lg-4">
7
8
  {%- for book in books -%}
8
- <a href="{{ book.url }}">
9
- <div class="col book">
10
- <img
11
- src="{{ book.image.path | thumbnail: 212, 300 }}"
12
- alt="{{ book.image.description | default: book.title }}"
13
- loading="lazy"
14
- />
9
+ <article
10
+ {% include_cached cart_controller.html product=book extra=book.author %}
11
+ class="col book mb-3">
12
+ <header class="position-relative">
13
+ <div class="text-center">
14
+ <img
15
+ class="img-fluid"
16
+ src="{{ book.image.path | thumbnail: nil, 300 }}"
17
+ alt="{{ book.image.description | default: book.title }}"
18
+ loading="lazy" />
19
+ </div>
20
+
21
+ <h1 class="f-4 mt-3">{{ book.title }}</h1>
22
+
23
+ <a class="stretched-link" href="{{ book.url }}"></a>
24
+ </header>
25
+
26
+ <p>{{ book.author | join: ', ' }}</p>
15
27
 
16
- <h2>{{ book.title }}</h2>
17
- <p>{{ book.author | join: ', ' }}</p>
18
- </div>
19
- </a>
28
+ {%- include_cached cart_add.html product=book -%}
29
+ </article>
20
30
  {%- endfor %}
21
31
  </div>
@@ -0,0 +1,21 @@
1
+ ---
2
+ layout: default
3
+ ---
4
+
5
+ <section class="">
6
+ <header class="">
7
+ <h1>{{ page.title }}</h1>
8
+ </header>
9
+
10
+ <div class="content">
11
+ {{ content }}
12
+ </div>
13
+
14
+ <div
15
+ id="cart-payment-methods"
16
+ data-controller="cart-payment-methods"
17
+ data-cart-payment-methods-next-url="{{ site.confirmation.url }}"
18
+ data-cart-payment-methods-back-url="{{ site.shipment.url }}"
19
+ data-cart-payment-methods-template="assets/templates/payment_methods.html">
20
+ </div>
21
+ </section>
data/_layouts/post.html CHANGED
@@ -4,10 +4,10 @@ layout: default
4
4
 
5
5
  <article class="h-entry" itemscope itemtype="http://schema.org/Article">
6
6
  <header>
7
- <h1 class="p-name" itemprop="name headline">{{ page.title | escape }}</h1>
7
+ <h1 class="p-name" itemprop="name headline">{{ page.title | default: '' | escape }}</h1>
8
8
 
9
9
  {%- if page.description -%}
10
- <p class="lead p-summary" itemprop="description">{{ page.description | escape }}</p>
10
+ <p class="lead p-summary" itemprop="description">{{ page.description | default: '' | escape }}</p>
11
11
  {%- endif -%}
12
12
 
13
13
  {%- if page.image.path -%}
@@ -22,14 +22,14 @@ layout: default
22
22
 
23
23
  <p>
24
24
  <time class="dt-published" datetime="{{ page.date | date_to_xmlschema }}" itemprop="datePublished">
25
- {%- assign date_format = site.i18n.date | default: "%b %-d, %Y" -%}
26
- {{ page.date | date: date_format }}
25
+ {%- assign date_format = site.i18n.date.format | default: "%b %-d, %Y" -%}
26
+ {{ page.date | date_local: date_format }}
27
27
  </time>
28
28
  {%- for author in page.author -%}
29
29
 
30
30
  <span itemprop="author" itemscope itemtype="http://schema.org/Person">
31
31
  <span class="p-author h-card" itemprop="name">
32
- {{ author | escape }}
32
+ {{ author | default: '' | escape }}
33
33
  </span>
34
34
  </span>
35
35
  {%- endfor -%}
@@ -0,0 +1,52 @@
1
+ ---
2
+ layout: default
3
+ ---
4
+
5
+ <section>
6
+ <header>
7
+ <h1>{{ page.title }}</h1>
8
+ </header>
9
+
10
+ <div class="content">
11
+ {{ content }}
12
+ </div>
13
+
14
+ <div id="user" data-controller="cart-contact">
15
+ <h2>{{ page.user }}</h2>
16
+
17
+ <form data-target="cart-contact.form">
18
+ {% for field in site.data.forms.user %}
19
+ {% assign template = field[1].type | append: '.html' %}
20
+ {% include {{ template }} field=field form='user' %}
21
+ {% endfor %}
22
+ </form>
23
+ </div>
24
+
25
+ <div
26
+ id="shipping-address"
27
+ class="mt-3"
28
+ data-controller="cart-shipping"
29
+ data-scroll-to="cart-shipping"
30
+ data-cart-shipping-next="{{ site.payment.url }}"
31
+ data-cart-shipping-template="assets/templates/shipping_methods.html">
32
+
33
+ <h2>{{ page.shipping_address }}</h2>
34
+
35
+ <form
36
+ data-target="cart-shipping.form"
37
+ data-action="cart-shipping#rates">
38
+ {% for field in site.data.forms.shipping_address %}
39
+ {% assign template = field[1].type | append: '.html' %}
40
+ {% include {{ template }} field=field %}
41
+ {% endfor %}
42
+ </form>
43
+
44
+ <div id="cart-shipping">
45
+ <h2 class="mt-3">{{ page.shipping_methods }}</h2>
46
+
47
+ <div data-target="cart-shipping.methods">
48
+ {{ page.shipping_methods_help | markdownify }}
49
+ </div>
50
+ </div>
51
+ </div>
52
+ </section>
@@ -0,0 +1,37 @@
1
+ * {
2
+ scroll-behavior: smooth;
3
+ }
4
+
5
+ /*
6
+ * Deshabilita animaciones si la usuaria las tiene deshabilitadas
7
+ */
8
+ @media (prefers-reduced-motion: reduce) {
9
+ * {
10
+ scroll-behavior: auto;
11
+ animation: none !important;
12
+ }
13
+ }
14
+
15
+ .inaccesible {
16
+ outline: $red 1px solid;
17
+
18
+ @extend .position-relative;
19
+
20
+ &:focus::after {
21
+ @extend .position-fixed;
22
+ @extend .background-red;
23
+ @extend .white;
24
+ @extend .p-3;
25
+
26
+ left: 0;
27
+ bottom: 0;
28
+ width: 100vw;
29
+ font-size: 1rem;
30
+
31
+ word-wrap: normal;
32
+ line-break: auto;
33
+ white-space: pre-line;
34
+
35
+ content: attr(aria-label);
36
+ }
37
+ }
data/_sass/editor.scss ADDED
@@ -0,0 +1,8 @@
1
+ /*
2
+ * Estilos del editor de Sutty
3
+ */
4
+
5
+ // Alineación
6
+ div[data-align="left"] { text-align: left; }
7
+ div[data-align="center"] { text-align: center; }
8
+ div[data-align="right"] { text-align: right; }
data/_sass/embed.scss ADDED
@@ -0,0 +1,5 @@
1
+ iframe {
2
+ border: 0;
3
+ width: 100%;
4
+ min-height: 480px;
5
+ }
@@ -0,0 +1,10 @@
1
+ .floating-alert {
2
+ &.floating-alert-bottom {
3
+ bottom: 2rem;
4
+ }
5
+
6
+ .floating-alert-content {
7
+ border-radius: 2rem;
8
+ padding: .5rem 1rem;
9
+ }
10
+ }
@@ -0,0 +1,318 @@
1
+ // En este archivo colocamos todos las herramientas que nos hagan falta,
2
+ // de forma que podamos generar clases específicas que sean combinables
3
+ // con otras, en lugar de escribir clases específicas para cada
4
+ // elemento.
5
+ //
6
+ // Cada clase tiene su versión responsive de acuerdo a los parámetros de
7
+ // Bootstrap.
8
+
9
+ // Ocultar la barra de scroll, útil para sliders horizontales.
10
+ .no-scrollbar {
11
+ scrollbar-width: none;
12
+ -webkit-overflow-scrolling: touch;
13
+
14
+ &::-webkit-scrollbar { display: none; }
15
+ }
16
+
17
+ // Mismo alto que ancho
18
+ .square {
19
+ @extend .position-relative;
20
+ padding-bottom: 100%;
21
+
22
+ & > * {
23
+ @extend .position-absolute;
24
+ @extend .top-0;
25
+ @extend .left-0;
26
+ @extend .h-100;
27
+ }
28
+ }
29
+
30
+ // Eventos del cursor
31
+ @each $event in (none, auto) {
32
+ .pointer-event-#{$event} {
33
+ pointer-events: $event;
34
+ }
35
+
36
+ @each $grid-breakpoint, $_ in $grid-breakpoints {
37
+ @include media-breakpoint-up($grid-breakpoint) {
38
+ .pointer-event-#{$grid-breakpoint}-#{$event} {
39
+ pointer-events: $event;
40
+ }
41
+ }
42
+ }
43
+ }
44
+
45
+ // Agrega una transición a cualquier modificación de atributos
46
+ .transition {
47
+ @include transition($transition-base);
48
+ }
49
+
50
+ // Ajustes de imagen y video con respecto al contenedor
51
+ @each $keyword in (contain, cover, fill, none, scale-down) {
52
+ .fit-#{$keyword} {
53
+ object-fit: #{$keyword};
54
+ }
55
+
56
+ @each $grid-breakpoint, $_ in $grid-breakpoints {
57
+ @include media-breakpoint-up($grid-breakpoint) {
58
+ .fit-#{$grid-breakpoint}-#{$keyword} {
59
+ object-fit: #{$keyword};
60
+ }
61
+ }
62
+ }
63
+ }
64
+
65
+ // Cursores
66
+ @each $cursor in (pointer none) {
67
+ .cursor-#{$cursor} {
68
+ cursor: $cursor;
69
+ }
70
+ }
71
+
72
+ // Overflow
73
+ @each $value in (auto, hidden, scroll) {
74
+ .overflow-#{$value} {
75
+ overflow: $value !important;
76
+ }
77
+
78
+ @each $axis in (y, x) {
79
+ .overflow-#{$axis}-#{$value} {
80
+ overflow-#{$axis}: $value !important;
81
+ }
82
+ }
83
+
84
+ @each $grid-breakpoint, $_ in $grid-breakpoints {
85
+ @include media-breakpoint-up($grid-breakpoint) {
86
+ .overflow-#{$grid-breakpoint}-#{$value} {
87
+ overflow: $value !important;
88
+ }
89
+
90
+ @each $axis in (y, x) {
91
+ .overflow-#{$grid-breakpoint}-#{$axis}-#{$value} {
92
+ overflow-#{$axis}: $value !important;
93
+ }
94
+ }
95
+ }
96
+ }
97
+ }
98
+
99
+ @each $spacer, $length in $spacers {
100
+ // Poder aumentar o disminuir el alto de la tipografía
101
+ .f-#{$spacer} {
102
+ font-size: $length !important;
103
+ }
104
+
105
+ // Columnas de texto
106
+ .text-column-#{$spacer} {
107
+ column-count: $spacer;
108
+ }
109
+
110
+ // Limitar la cantidad de líneas de un bloque de texto
111
+ .line-clamp-#{$spacer} {
112
+ overflow: hidden;
113
+ display: -webkit-box;
114
+ -webkit-line-clamp: $spacer;
115
+ -webkit-box-orient: vertical;
116
+ }
117
+
118
+ // Ubicación absoluta, usar con position-*
119
+ @each $direction in (top, right, bottom, left) {
120
+ .#{$direction}-#{$spacer} {
121
+ #{$direction}: $length
122
+ }
123
+ }
124
+
125
+ @each $grid-breakpoint, $_ in $grid-breakpoints {
126
+ @include media-breakpoint-up($grid-breakpoint) {
127
+ // Poder aumentar o disminuir el alto de la tipografía
128
+ .f-#{$grid-breakpoint}-#{$spacer} {
129
+ font-size: $length !important;
130
+ }
131
+
132
+ // Columnas de texto
133
+ .text-column-#{$grid-breakpoint}-#{$spacer} {
134
+ column-count: $spacer;
135
+ }
136
+
137
+ // Limitar la cantidad de líneas de un bloque de texto
138
+ .line-clamp-#{$grid-breakpoint}-#{$spacer} {
139
+ overflow: hidden;
140
+ display: -webkit-box;
141
+ -webkit-line-clamp: $spacer;
142
+ -webkit-box-orient: vertical;
143
+ }
144
+
145
+ // Ubicación absoluta, usar con position-*
146
+ @each $direction in (top, right, bottom, left) {
147
+ .#{$direction}-#{$grid-breakpoint}-#{$spacer} {
148
+ #{$direction}: $length
149
+ }
150
+ }
151
+ }
152
+ }
153
+ }
154
+
155
+ // anchos y altos
156
+ @each $prop, $abbrev in (width: w, height: h) {
157
+ @each $size, $length in $sizes {
158
+ .#{$abbrev}-#{$size} { #{$prop}: $length; }
159
+ .#{$abbrev}-#{$size} { #{$prop}: $length; }
160
+ .min-#{$abbrev}-#{$size} { min-#{$prop}: $length; }
161
+ .max-#{$abbrev}-#{$size} { max-#{$prop}: $length; }
162
+
163
+ @each $grid-breakpoint, $_ in $grid-breakpoints {
164
+ @include media-breakpoint-up($grid-breakpoint) {
165
+ .#{$abbrev}-#{$grid-breakpoint}-#{$size} { #{$prop}: $length; }
166
+ .min-#{$abbrev}-#{$grid-breakpoint}-#{$size} { min-#{$prop}: $length; }
167
+ .max-#{$abbrev}-#{$grid-breakpoint}-#{$size} { max-#{$prop}: $length; }
168
+ }
169
+ }
170
+ }
171
+ }
172
+
173
+ @each $scroll in (auto, smooth) {
174
+ .scroll-#{$scroll} {
175
+ scroll-behavior: #{$scroll};
176
+ }
177
+
178
+ @each $grid-breakpoint, $_ in $grid-breakpoints {
179
+ @include media-breakpoint-up($grid-breakpoint) {
180
+ .scroll-#{$grid-breakpoint}-#{$scroll} {
181
+ scroll-behavior: #{$scroll};
182
+ }
183
+ }
184
+ }
185
+ }
186
+
187
+ // Versiones responsive de utilidades Bootstrap
188
+ @each $grid-breakpoint, $_ in $grid-breakpoints {
189
+ @include media-breakpoint-up($grid-breakpoint) {
190
+ // Bordes
191
+ // node_modules/bootstrap/scss/utilities/_borders.scss
192
+ .border-#{$grid-breakpoint} { border: $border-width solid $border-color !important; }
193
+ .border-#{$grid-breakpoint}-top { border-top: $border-width solid $border-color !important; }
194
+ .border-#{$grid-breakpoint}-right { border-right: $border-width solid $border-color !important; }
195
+ .border-#{$grid-breakpoint}-bottom { border-bottom: $border-width solid $border-color !important; }
196
+ .border-#{$grid-breakpoint}-left { border-left: $border-width solid $border-color !important; }
197
+ .border-#{$grid-breakpoint}-0 { border: 0 !important; }
198
+ .border-#{$grid-breakpoint}-top-0 { border-top: 0 !important; }
199
+ .border-#{$grid-breakpoint}-right-0 { border-right: 0 !important; }
200
+ .border-#{$grid-breakpoint}-bottom-0 { border-bottom: 0 !important; }
201
+ .border-#{$grid-breakpoint}-left-0 { border-left: 0 !important; }
202
+
203
+ // Alineación
204
+ .text-#{$grid-breakpoint}-left { text-align: left !important; }
205
+ .text-#{$grid-breakpoint}-right { text-align: right !important; }
206
+ .text-#{$grid-breakpoint}-center { text-align: center !important; }
207
+
208
+ // Posicionamiento
209
+ @each $position in $positions {
210
+ .position-#{$grid-breakpoint}-#{$position} { position: $position !important; }
211
+ }
212
+
213
+ // Anchos y altos
214
+ @each $prop, $abbrev in (width: w, height: h) {
215
+ @each $size, $length in $sizes {
216
+ .#{$abbrev}-#{$grid-breakpoint}-#{$size} { #{$prop}: $length !important; }
217
+ .min-#{$abbrev}-#{$grid-breakpoint}-#{$size} { min-#{$prop}: $length !important; }
218
+ }
219
+ }
220
+ }
221
+ }
222
+
223
+ // Crea una propiedad con prefijos de navegador
224
+ @mixin vendor-prefix($property, $definition...) {
225
+ @each $prefix in $vendor-prefixes {
226
+ #{$prefix}$property: $definition;
227
+ }
228
+ }
229
+
230
+ // Colores
231
+ @each $color, $rgb in $colors {
232
+ .background-#{$color} {
233
+ background-color: var(--#{$color});
234
+
235
+ &:focus {
236
+ background-color: var(--#{$color});
237
+ }
238
+ }
239
+
240
+ @each $opacity, $degree in $opacities {
241
+ .background-#{$color}-t#{$opacity} {
242
+ background-color: scale-color($rgb, $alpha: $degree);
243
+ }
244
+ }
245
+
246
+ @each $attr in (stroke, fill) {
247
+ .#{$attr}-#{$color} {
248
+ svg {
249
+ * {
250
+ #{$attr}: var(--#{$color});
251
+ }
252
+ }
253
+ }
254
+ }
255
+
256
+ // Barras de scroll de colores
257
+ .scrollbar-#{$color} {
258
+ scrollbar-color: var(--#{$color}) transparent;
259
+ scrollbar-width: thin;
260
+
261
+ &::-webkit-scrollbar {
262
+ width: 5px;
263
+ height: 8px;
264
+ background-color: transparent;
265
+ }
266
+
267
+ &::-webkit-scrollbar-thumb {
268
+ background: var(--#{$color});
269
+ }
270
+ }
271
+
272
+ // Bordes
273
+ .border-#{$color} {
274
+ border-color: var(--#{$color}) !important;
275
+ }
276
+
277
+ // Cambiar el fondo al pasar por encima o hacer foco
278
+ .hover-bg-#{$color} {
279
+ &:hover,
280
+ &:focus-within {
281
+ background-color: var(--#{$color});
282
+ }
283
+ }
284
+
285
+ // Cambiar el color al pasar por encima o hacer foco
286
+ .hover-#{$color} {
287
+ &:hover,
288
+ &:focus-within {
289
+ color: var(--#{$color});
290
+ }
291
+ }
292
+
293
+ // Cambiar el color
294
+ .#{$color} {
295
+ color: var(--#{$color});
296
+
297
+ &:focus {
298
+ color: var(--#{$color});
299
+ }
300
+
301
+ // Invertir el color en la selección
302
+ ::-moz-selection,
303
+ ::selection {
304
+ background: var(--#{$color});
305
+ color: white;
306
+ }
307
+
308
+ // Ajustes para Bootstrap
309
+ .form-control {
310
+ border-color: var(--#{$color});
311
+ color: var(--#{$color});
312
+ }
313
+
314
+ hr {
315
+ border-color: var(--#{$color});
316
+ }
317
+ }
318
+ }