@edc-motor/ui 0.4.0 → 0.4.2
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/package.json +1 -1
- package/scss/components/_blocks.scss +45 -2
- package/src/blocks/BlockCta.vue +10 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edc-motor/ui",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"description": "EdC Motor — componentes públicos Vue 3 + tokens SCSS para webs de juegos de mesa (paquete fuente: lo compila el consumidor con Vite)",
|
|
5
5
|
"license": "GPL-3.0-only",
|
|
6
6
|
"type": "module",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
// Anchura del contenido (campo común `width`): coherente entre bloques.
|
|
18
|
-
&--w-narrow .block__inner { max-width:
|
|
18
|
+
&--w-narrow .block__inner { max-width: 800px; }
|
|
19
19
|
&--w-full .block__inner { max-width: none; padding-inline: $space-6; }
|
|
20
20
|
|
|
21
21
|
// Tipografía de bloque: texto $fs-16, subtítulo $fs-20, título $fs-28
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
&__card {
|
|
44
44
|
// Semitransparente: la imagen de fondo de la página se ve a través
|
|
45
45
|
// (patrón CDL, rgba(surface, .5)); el blur mantiene el texto legible.
|
|
46
|
-
background: color-mix(in srgb, $surface
|
|
46
|
+
background: color-mix(in srgb, $surface 50%, transparent);
|
|
47
47
|
backdrop-filter: blur(8px);
|
|
48
48
|
border: 1px solid $border;
|
|
49
49
|
border-radius: $radius-lg;
|
|
@@ -157,6 +157,48 @@
|
|
|
157
157
|
display: grid;
|
|
158
158
|
gap: $space-3;
|
|
159
159
|
justify-items: start;
|
|
160
|
+
align-content: center; // centrado frente a la imagen sangrada
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// La imagen del CTA sangra hasta el borde de la tarjeta según su posición:
|
|
164
|
+
// en columnas toca arriba, abajo y su lateral (el título viaja a la
|
|
165
|
+
// columna de texto); arriba/abajo toca los laterales. Esquinas siguiendo
|
|
166
|
+
// el radio de la tarjeta.
|
|
167
|
+
&--cta.block--image-right .block__media-layout .block__image-frame,
|
|
168
|
+
&--cta.block--image-left .block__media-layout .block__image-frame {
|
|
169
|
+
@container content (min-width: #{$bp-sm}) {
|
|
170
|
+
overflow: hidden;
|
|
171
|
+
min-height: 0;
|
|
172
|
+
|
|
173
|
+
.block__image { border-radius: 0; }
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
&--cta.block--image-right .block__media-layout .block__image-frame {
|
|
177
|
+
@container content (min-width: #{$bp-sm}) {
|
|
178
|
+
margin: (-$space-8) (-$space-8) (-$space-8) 0;
|
|
179
|
+
border-radius: 0 $radius-lg $radius-lg 0;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
&--cta.block--image-left .block__media-layout .block__image-frame {
|
|
183
|
+
@container content (min-width: #{$bp-sm}) {
|
|
184
|
+
margin: (-$space-8) 0 (-$space-8) (-$space-8);
|
|
185
|
+
border-radius: $radius-lg 0 0 $radius-lg;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
// Arriba solo sangra si no hay título/subtítulo por encima.
|
|
189
|
+
&--cta.block--image-top .block__card > .block__media-layout:first-child > .block__image {
|
|
190
|
+
justify-self: stretch;
|
|
191
|
+
max-width: none;
|
|
192
|
+
width: calc(100% + #{$space-8 * 2});
|
|
193
|
+
margin: (-$space-8) (-$space-8) 0;
|
|
194
|
+
border-radius: $radius-lg $radius-lg 0 0;
|
|
195
|
+
}
|
|
196
|
+
&--cta.block--image-bottom .block__media-layout > .block__image {
|
|
197
|
+
justify-self: stretch;
|
|
198
|
+
max-width: none;
|
|
199
|
+
width: calc(100% + #{$space-8 * 2});
|
|
200
|
+
margin: 0 (-$space-8) (-$space-8);
|
|
201
|
+
border-radius: 0 0 $radius-lg $radius-lg;
|
|
160
202
|
}
|
|
161
203
|
|
|
162
204
|
&--quote .block__quote {
|
|
@@ -227,6 +269,7 @@
|
|
|
227
269
|
padding: $space-2 $space-5;
|
|
228
270
|
border: 1px solid $accent-500;
|
|
229
271
|
border-radius: $radius-md;
|
|
272
|
+
font-size: $fs-18;
|
|
230
273
|
font-weight: 600;
|
|
231
274
|
text-decoration: none;
|
|
232
275
|
cursor: pointer;
|
package/src/blocks/BlockCta.vue
CHANGED
|
@@ -27,14 +27,22 @@ const layoutStyle = computed(() => {
|
|
|
27
27
|
]"
|
|
28
28
|
>
|
|
29
29
|
<div class="block__card">
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
<!-- En columnas, título y subtítulo viajan a la columna de texto para
|
|
31
|
+
que la imagen pueda sangrar a TODA la altura de la tarjeta. -->
|
|
32
|
+
<template v-if="!inColumns">
|
|
33
|
+
<h2 v-if="settings.title" class="block__title">{{ settings.title }}</h2>
|
|
34
|
+
<p v-if="settings.subtitle" class="block__subtitle">{{ settings.subtitle }}</p>
|
|
35
|
+
</template>
|
|
32
36
|
<div class="block__media-layout" :style="layoutStyle">
|
|
33
37
|
<span v-if="settings.image && inColumns" class="block__image-frame">
|
|
34
38
|
<img class="block__image" :src="String(settings.image)" alt="" />
|
|
35
39
|
</span>
|
|
36
40
|
<img v-else-if="settings.image" class="block__image" :src="String(settings.image)" alt="" />
|
|
37
41
|
<div class="block__cta-body">
|
|
42
|
+
<template v-if="inColumns">
|
|
43
|
+
<h2 v-if="settings.title" class="block__title">{{ settings.title }}</h2>
|
|
44
|
+
<p v-if="settings.subtitle" class="block__subtitle">{{ settings.subtitle }}</p>
|
|
45
|
+
</template>
|
|
38
46
|
<div v-if="settings.body" class="block__text rich-content" v-html="settings.body" />
|
|
39
47
|
<a
|
|
40
48
|
v-if="settings.button_text && settings.button_url"
|