@allxsmith/bestax-bulma 5.41.0 → 5.42.1

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.
@@ -1,6 +1,12 @@
1
1
  // Carousel component styles
2
2
  @use "bulma/sass/utilities/initial-variables" as iv;
3
3
  @use "bulma/sass/utilities/css-variables" as cv;
4
+ @use "bulma/sass/utilities/mixins" as mx;
5
+
6
+ // The space between two items in view, left out at the track's edges. A
7
+ // length, so `0px` rather than `0`: the track's offset adds it to a
8
+ // percentage inside `calc()`, where a bare `0` is not a length.
9
+ $carousel-item-gap: 0px !default;
4
10
 
5
11
  // Carousel-specific SCSS sizing variables
6
12
  $carousel-arrow-size: 48px !default;
@@ -126,10 +132,70 @@ $carousel-indicator-line-radius: cv.getVar("radius-small") !default;
126
132
  "carousel-overlay-indicator-background-active": #{$carousel-overlay-indicator-background-active},
127
133
  "carousel-transition-duration": #{$carousel-transition-duration},
128
134
  "carousel-fade-duration": #{$carousel-fade-duration},
135
+ "carousel-item-gap": #{$carousel-item-gap},
136
+ // How many items are in view. `Carousel` writes each `itemsToShow*`
137
+ // prop it is given as the variable of the same name on its own
138
+ // element; the rest fall back the way the props do, each viewport to
139
+ // the next narrower one and all of them to `itemsToShow`. Declared
140
+ // here, on every carousel, so one nested in another's items starts
141
+ // from its own props rather than inheriting the outer one's.
142
+ "carousel-items-to-show": 1,
143
+ "carousel-items-to-show-mobile": #{cv.getVar("carousel-items-to-show")},
144
+ "carousel-items-to-show-tablet": #{cv.getVar("carousel-items-to-show")},
145
+ "carousel-items-to-show-desktop": #{cv.getVar("carousel-items-to-show-tablet")},
146
+ "carousel-items-to-show-widescreen": #{cv.getVar("carousel-items-to-show-desktop")},
147
+ "carousel-items-to-show-fullhd": #{cv.getVar("carousel-items-to-show-widescreen")},
148
+ // The count for the viewport the page is in, which the item widths and
149
+ // the track's offset both read. Bulma's breakpoint mixins below pick
150
+ // the tablet count and wider; every width they don't reach is mobile,
151
+ // as it is to the script. A `mobile` block of its own would leave out
152
+ // the fractional widths between Bulma's `mobile` query (up to 768px)
153
+ // and its `tablet` one (from 769px), where the two would disagree.
154
+ "carousel-items-in-view": #{cv.getVar("carousel-items-to-show-mobile")},
129
155
  )
130
156
  );
131
157
  }
132
158
 
159
+ @include mx.tablet {
160
+ .#{iv.$class-prefix}carousel {
161
+ @include cv.register-vars(
162
+ (
163
+ "carousel-items-in-view": #{cv.getVar("carousel-items-to-show-tablet")},
164
+ )
165
+ );
166
+ }
167
+ }
168
+
169
+ @include mx.desktop {
170
+ .#{iv.$class-prefix}carousel {
171
+ @include cv.register-vars(
172
+ (
173
+ "carousel-items-in-view": #{cv.getVar("carousel-items-to-show-desktop")},
174
+ )
175
+ );
176
+ }
177
+ }
178
+
179
+ @include mx.widescreen {
180
+ .#{iv.$class-prefix}carousel {
181
+ @include cv.register-vars(
182
+ (
183
+ "carousel-items-in-view": #{cv.getVar("carousel-items-to-show-widescreen")},
184
+ )
185
+ );
186
+ }
187
+ }
188
+
189
+ @include mx.fullhd {
190
+ .#{iv.$class-prefix}carousel {
191
+ @include cv.register-vars(
192
+ (
193
+ "carousel-items-in-view": #{cv.getVar("carousel-items-to-show-fullhd")},
194
+ )
195
+ );
196
+ }
197
+ }
198
+
133
199
  .#{iv.$class-prefix}carousel {
134
200
  position: relative;
135
201
  overflow: hidden;
@@ -147,15 +213,22 @@ $carousel-indicator-line-radius: cv.getVar("radius-small") !default;
147
213
  // Slides container
148
214
  .#{iv.$class-prefix}carousel-slides {
149
215
  display: flex;
216
+ gap: cv.getVar("carousel-item-gap");
150
217
  width: 100%;
151
218
  will-change: transform;
152
219
  }
153
220
 
154
- // Individual slide
221
+ // Individual slide: an equal share of the track, less the gaps between
222
+ // the items in view
155
223
  .#{iv.$class-prefix}carousel-item {
156
- flex: 0 0 100%;
157
- width: 100%;
158
- min-width: 100%;
224
+ $carousel-item-width: calc(
225
+ (100% - (#{cv.getVar("carousel-items-in-view")} - 1) * #{cv.getVar("carousel-item-gap")}) /
226
+ #{cv.getVar("carousel-items-in-view")}
227
+ );
228
+
229
+ flex: 0 0 $carousel-item-width;
230
+ width: $carousel-item-width;
231
+ min-width: $carousel-item-width;
159
232
 
160
233
  // Allow images to fill the slide
161
234
  img {
@@ -505,26 +578,6 @@ $carousel-indicator-line-radius: cv.getVar("radius-small") !default;
505
578
  }
506
579
  }
507
580
 
508
- // Carousel list variant (multiple visible items)
509
- .#{iv.$class-prefix}carousel-list {
510
- .#{iv.$class-prefix}carousel-container {
511
- overflow: visible;
512
- }
513
-
514
- .#{iv.$class-prefix}carousel-slides {
515
- display: flex;
516
- gap: 1rem;
517
- }
518
-
519
- .#{iv.$class-prefix}carousel-item {
520
- flex: 0 0 auto;
521
- width: auto;
522
- position: relative;
523
- opacity: 1;
524
- visibility: visible;
525
- }
526
- }
527
-
528
581
  // Responsive adjustments
529
582
  @media screen and (max-width: 768px) {
530
583
  .#{iv.$class-prefix}carousel {
@@ -9,7 +9,10 @@
9
9
  $checkbox-size: 1.25em !default;
10
10
  $checkbox-border-width: 2px !default;
11
11
  $checkbox-radius: cv.getVar("radius-small") !default;
12
- $checkbox-border-color: cv.getVar("border") !default;
12
+ // The border is all that shows of an unchecked box, so it takes `text-weak`,
13
+ // which holds the 3:1 WCAG asks of a control's boundary (SC 1.4.11) on the
14
+ // scheme's surfaces in light and dark. `border` falls well short of it.
15
+ $checkbox-border-color: cv.getVar("text-weak") !default;
13
16
  $checkbox-background: transparent !default;
14
17
  $checkbox-check-color: cv.getVar("scheme-invert") !default;
15
18
  $checkbox-active-color: cv.getVar("primary") !default;
@@ -18,8 +21,10 @@ $checkbox-focus-shadow-size: 0 0 0 0.125em !default;
18
21
  $checkbox-transition-duration: cv.getVar("duration") !default;
19
22
  $checkbox-indeterminate-color: cv.getVar("primary") !default;
20
23
 
21
- // The check mark, drawn as an image normally and used as a mask in forced
22
- // colors. Private, since it's the shape rather than a themable value.
24
+ // The check mark's shape, used as a mask so the mark is painted with a
25
+ // background color: `checkbox-check-color`, or a system color in forced
26
+ // colors. Private, since it's the shape rather than a themable value; the
27
+ // stroke's color only marks what the mask keeps.
23
28
  $-check-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
24
29
 
25
30
  // Register CSS custom properties
@@ -127,7 +132,8 @@ $-check-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'
127
132
  transition-duration: cv.getVar("checkbox-transition-duration");
128
133
  transition-timing-function: ease;
129
134
 
130
- // Checkmark via SVG background-image
135
+ // The check mark: the mask cuts the shape, the background color paints
136
+ // it, in the same color as the mixed state's dash.
131
137
  &::after {
132
138
  content: "";
133
139
  position: absolute;
@@ -138,10 +144,15 @@ $-check-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'
138
144
  transition-property: opacity, transform;
139
145
  transition-duration: cv.getVar("checkbox-transition-duration");
140
146
  transition-timing-function: ease;
141
- background-image: $-check-mark;
142
- background-size: contain;
143
- background-repeat: no-repeat;
144
- background-position: center;
147
+ background-color: cv.getVar("checkbox-check-color");
148
+ -webkit-mask-image: $-check-mark;
149
+ -webkit-mask-size: contain;
150
+ -webkit-mask-repeat: no-repeat;
151
+ -webkit-mask-position: center;
152
+ mask-image: $-check-mark;
153
+ mask-size: contain;
154
+ mask-repeat: no-repeat;
155
+ mask-position: center;
145
156
  }
146
157
  }
147
158
 
@@ -188,16 +199,12 @@ $-check-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'
188
199
  background-color: Highlight;
189
200
  border-color: Highlight;
190
201
 
191
- // The mark's image has a black stroke, which forced colors leaves as
192
- // it is, black on the Highlight fill. Use its shape as a mask instead
193
- // and paint it in HighlightText, the color made to read on Highlight.
202
+ // Forced colors replaces the check color the mark is painted with, as
203
+ // it does any color that isn't a system one. Name HighlightText, the
204
+ // color made to read on Highlight. The mask is untouched there, so the
205
+ // shape stays.
194
206
  &::after {
195
- background-image: none;
196
207
  background-color: HighlightText;
197
- mask-image: $-check-mark;
198
- mask-size: contain;
199
- mask-repeat: no-repeat;
200
- mask-position: center;
201
208
  }
202
209
  }
203
210
 
@@ -8,7 +8,10 @@
8
8
  // Radio-specific SCSS variables
9
9
  $radio-size: 1.25em !default;
10
10
  $radio-border-width: 2px !default;
11
- $radio-border-color: cv.getVar("border") !default;
11
+ // The ring is all that shows of an unchecked radio, so it takes `text-weak`,
12
+ // which holds the 3:1 WCAG asks of a control's boundary (SC 1.4.11) on the
13
+ // scheme's surfaces in light and dark. `border` falls well short of it.
14
+ $radio-border-color: cv.getVar("text-weak") !default;
12
15
  $radio-background: transparent !default;
13
16
  $radio-dot-color: cv.getVar("scheme-main") !default;
14
17
  $radio-active-color: cv.getVar("primary") !default;