forked from rtCamp/rt-carousel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_core.scss
More file actions
104 lines (87 loc) · 2.59 KB
/
_core.scss
File metadata and controls
104 lines (87 loc) · 2.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
:where(.carousel-kit) {
position: relative;
width: 100%;
--carousel-kit-slide-width: 100%;
}
/* Full alignment needs to break out of the container */
:where(.carousel-kit.alignfull) {
width: 100vw;
}
:where(.carousel-kit) .embla {
overflow: hidden;
}
/* Ensure the default container and Query Loop list are flex rows */
:where(.carousel-kit) .embla__container,
:where(.carousel-kit) .embla .wp-block-post-template {
display: flex;
flex-wrap: nowrap;
width: 100%;
margin: 0;
padding: 0;
list-style: none;
gap: var(--carousel-kit-gap, 0);
}
/* Ensure intermediate wrappers (like wp-block-query) don't shrink */
:where(.carousel-kit) .embla .wp-block-query {
width: 100%;
min-width: 100%;
}
/* Force slides (including posts) to respect a configurable width variable */
:where(.carousel-kit) .embla__slide,
:where(.carousel-kit) .embla .wp-block-post-template li {
flex: 0 0 var(--carousel-kit-slide-width, 100%);
max-width: var(--carousel-kit-slide-width, 100%);
min-width: 0;
box-sizing: border-box;
/* Reset margins by default (use gap instead) */
margin-inline-end: 0;
margin-block-start: 0;
margin-block-end: 0;
/* Vertical alignment support */
display: flex;
flex-direction: column;
&.is-vertically-aligned-top {
justify-content: flex-start;
}
&.is-vertically-aligned-center,
&.is-vertically-aligned-middle {
justify-content: center;
}
&.is-vertically-aligned-bottom {
justify-content: flex-end;
}
&.is-vertically-aligned-space-between {
justify-content: space-between;
}
}
/**
* Fix for Embla Carousel Loop + Gap
* When looping is enabled, Embla v8 doesn't support CSS 'gap'.
* We switch to margin for consistent spacing in loop mode.
*/
:where(.carousel-kit[data-loop="true"]) .embla__container,
:where(.carousel-kit[data-loop="true"]) .embla .wp-block-post-template {
gap: 0;
}
:where(.carousel-kit[data-loop="true"]) .embla__slide,
:where(.carousel-kit[data-loop="true"]) .embla .wp-block-post-template li {
margin-inline-end: var(--carousel-kit-gap, 0);
}
/* Vertical Axis adjustments */
:where(.carousel-kit[data-axis="y"]) .embla {
height: var(--carousel-kit-height);
}
:where(.carousel-kit[data-axis="y"]) .embla__container {
flex-direction: column;
height: 100%;
min-height: 100%;
}
:where(.carousel-kit[data-axis="y"]) .embla__slide,
:where(.carousel-kit[data-axis="y"]) .embla .wp-block-post-template li {
margin-inline-end: 0;
}
/* Vertical + Loop specific */
:where(.carousel-kit[data-axis="y"][data-loop="true"]) .embla__slide,
:where(.carousel-kit[data-axis="y"][data-loop="true"]) .embla .wp-block-post-template li {
margin-block-end: var(--carousel-kit-gap, 0);
}