@allxsmith/bestax-bulma 5.63.0 → 5.65.0
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/dist/bestax.css +1 -1
- package/dist/bestax.css.map +1 -1
- package/dist/esm/components/Carousel.js +12 -66
- package/dist/esm/components/Carousel.js.map +1 -1
- package/dist/esm/components/Lightbox.js +756 -0
- package/dist/esm/components/Lightbox.js.map +1 -0
- package/dist/esm/components/Reveal.js +1 -24
- package/dist/esm/components/Reveal.js.map +1 -1
- package/dist/esm/components/ScrollArea.js +7 -7
- package/dist/esm/components/ScrollArea.js.map +1 -1
- package/dist/esm/components/TableOfContents.js +85 -0
- package/dist/esm/components/TableOfContents.js.map +1 -0
- package/dist/esm/form/PasswordInput.js +105 -0
- package/dist/esm/form/PasswordInput.js.map +1 -0
- package/dist/esm/form/PasswordInputBase.js +177 -0
- package/dist/esm/form/PasswordInputBase.js.map +1 -0
- package/dist/esm/helpers/chevronIcons.js +24 -0
- package/dist/esm/helpers/chevronIcons.js.map +1 -0
- package/dist/esm/helpers/usePrefersReducedMotion.js +34 -0
- package/dist/esm/helpers/usePrefersReducedMotion.js.map +1 -0
- package/dist/esm/helpers/useScrollSpy.js +286 -0
- package/dist/esm/helpers/useScrollSpy.js.map +1 -0
- package/dist/esm/helpers/useSwipe.js +82 -0
- package/dist/esm/helpers/useSwipe.js.map +1 -0
- package/dist/extras.css +1 -1
- package/dist/extras.css.map +1 -1
- package/dist/index.cjs +1582 -198
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +5 -0
- package/dist/index.esm.js.map +1 -1
- package/dist/types/components/Lightbox.d.ts +244 -0
- package/dist/types/components/TableOfContents.d.ts +87 -0
- package/dist/types/form/PasswordInput.d.ts +98 -0
- package/dist/types/form/PasswordInputBase.d.ts +91 -0
- package/dist/types/helpers/chevronIcons.d.ts +14 -0
- package/dist/types/helpers/usePrefersReducedMotion.d.ts +10 -0
- package/dist/types/helpers/useScrollSpy.d.ts +61 -0
- package/dist/types/helpers/useSwipe.d.ts +66 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types-cjs/components/Lightbox.d.ts +244 -0
- package/dist/types-cjs/components/TableOfContents.d.ts +87 -0
- package/dist/types-cjs/form/PasswordInput.d.ts +98 -0
- package/dist/types-cjs/form/PasswordInputBase.d.ts +91 -0
- package/dist/types-cjs/helpers/chevronIcons.d.ts +14 -0
- package/dist/types-cjs/helpers/usePrefersReducedMotion.d.ts +10 -0
- package/dist/types-cjs/helpers/useScrollSpy.d.ts +61 -0
- package/dist/types-cjs/helpers/useSwipe.d.ts +66 -0
- package/dist/types-cjs/index.d.ts +6 -0
- package/dist/versions/bestax-no-dark-mode.css +1 -1
- package/dist/versions/bestax-no-dark-mode.css.map +1 -1
- package/dist/versions/bestax-no-helpers-prefixed.css +1 -1
- package/dist/versions/bestax-no-helpers-prefixed.css.map +1 -1
- package/dist/versions/bestax-no-helpers.css +1 -1
- package/dist/versions/bestax-no-helpers.css.map +1 -1
- package/dist/versions/bestax-prefixed.css +1 -1
- package/dist/versions/bestax-prefixed.css.map +1 -1
- package/package.json +1 -1
- package/src/scss/CLAUDE.md +3 -0
- package/src/scss/_input-trigger.scss +76 -0
- package/src/scss/components/_index.scss +2 -0
- package/src/scss/components/_lightbox.scss +392 -0
- package/src/scss/components/_tableofcontents.scss +42 -0
- package/src/scss/form/_index.scss +1 -0
- package/src/scss/form/_passwordinput.scss +112 -0
- package/src/scss/form/_picker-popover.scss +24 -63
package/src/scss/CLAUDE.md
CHANGED
|
@@ -16,6 +16,9 @@ of their own — Bulma provides it. A partial exists only for components that ex
|
|
|
16
16
|
It loads no Bulma module, since tests compile it with only this folder on the load path
|
|
17
17
|
- `_selected-row.scss` — `extras-selected-table-cell`, the cells Checkbox's and Radio's
|
|
18
18
|
selected-row rules share; it reads Bulma's `$colors`, which is why it isn't in `_mixins.scss`
|
|
19
|
+
- `_input-trigger.scss` — `extras-input-trigger`, a button laid over an input's right edge, which
|
|
20
|
+
the date and time pickers' launcher and PasswordInput's toggle share; it reads Bulma's class
|
|
21
|
+
prefix and variables, so it isn't in `_mixins.scss` either
|
|
19
22
|
- `versions/` — the flavor builds: `bestax-prefixed`, `bestax-no-helpers`, `bestax-no-dark-mode`,
|
|
20
23
|
`bestax-no-helpers-prefixed`. A new partial is included by all of them automatically (they reuse
|
|
21
24
|
the same `_index` imports), but must **work** under each — especially the prefixed build.
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
// Bestax Extras - a button inside an input
|
|
2
|
+
// The rule the date and time pickers' launcher and PasswordInput's toggle
|
|
3
|
+
// share, so the two can't drift apart. It reads Bulma's class prefix and
|
|
4
|
+
// variables, so it lives here rather than in `_mixins.scss`, which compiles
|
|
5
|
+
// with no Bulma to load, and it emits nothing until it's included.
|
|
6
|
+
|
|
7
|
+
@use 'bulma/sass/utilities/initial-variables' as iv;
|
|
8
|
+
@use 'bulma/sass/utilities/css-variables' as cv;
|
|
9
|
+
@use 'mixins' as *;
|
|
10
|
+
|
|
11
|
+
// A button over the input's right edge, in Bulma's 2.5em icon slot. Bulma's
|
|
12
|
+
// Control icons are decorative (`pointer-events: none`), so a button there
|
|
13
|
+
// needs rules of its own. Include it on the element that holds the input and
|
|
14
|
+
// the button, which it positions. A content block, when given, lands in that
|
|
15
|
+
// element's own rule, after its `position`: the pickers register the
|
|
16
|
+
// variables they pass in there.
|
|
17
|
+
//
|
|
18
|
+
// `$trigger` is the button's class, without the prefix. `$width` is the slot,
|
|
19
|
+
// which the input keeps as padding so typed text never slides under the
|
|
20
|
+
// button; `$color` and `$hover-color` are the button's, and
|
|
21
|
+
// `$disabled-opacity` a disabled one's. Each is usually a `cv.getVar()`, so
|
|
22
|
+
// every value a theme can change is a registered variable. The color change
|
|
23
|
+
// on hover takes Bulma's duration and easing through `extras-transition`. The
|
|
24
|
+
// button takes the input's `is-small`, `is-medium` or `is-large` font size,
|
|
25
|
+
// so its em-based width tracks the input's.
|
|
26
|
+
@mixin extras-input-trigger(
|
|
27
|
+
$trigger,
|
|
28
|
+
$width,
|
|
29
|
+
$color,
|
|
30
|
+
$hover-color,
|
|
31
|
+
$disabled-opacity
|
|
32
|
+
) {
|
|
33
|
+
position: relative;
|
|
34
|
+
@content;
|
|
35
|
+
|
|
36
|
+
> .#{iv.$class-prefix}input {
|
|
37
|
+
padding-right: $width;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
> .#{iv.$class-prefix}#{$trigger} {
|
|
41
|
+
position: absolute;
|
|
42
|
+
top: 0;
|
|
43
|
+
right: 0;
|
|
44
|
+
z-index: 4;
|
|
45
|
+
height: 100%;
|
|
46
|
+
width: $width;
|
|
47
|
+
display: inline-flex;
|
|
48
|
+
align-items: center;
|
|
49
|
+
justify-content: center;
|
|
50
|
+
padding: 0;
|
|
51
|
+
border: none;
|
|
52
|
+
background: transparent;
|
|
53
|
+
color: $color;
|
|
54
|
+
cursor: pointer;
|
|
55
|
+
@include extras-transition(color);
|
|
56
|
+
|
|
57
|
+
.#{iv.$class-prefix}icon {
|
|
58
|
+
pointer-events: none;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
&:hover:not(:disabled) {
|
|
62
|
+
color: $hover-color;
|
|
63
|
+
}
|
|
64
|
+
&:disabled {
|
|
65
|
+
cursor: not-allowed;
|
|
66
|
+
opacity: $disabled-opacity;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
@each $size in 'small', 'medium', 'large' {
|
|
71
|
+
> .#{iv.$class-prefix}input.#{iv.$class-prefix}is-#{$size}
|
|
72
|
+
~ .#{iv.$class-prefix}#{$trigger} {
|
|
73
|
+
font-size: cv.getVar('size-#{$size}');
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1,392 @@
|
|
|
1
|
+
// Bestax Extras - Lightbox Styles
|
|
2
|
+
// Bulma's image modal, finished: `.modal` with its near-black background and
|
|
3
|
+
// `.modal-close.is-large`, the image centred as large as the viewer allows,
|
|
4
|
+
// a bar along the top with the counter and the zoom buttons, round previous
|
|
5
|
+
// and next buttons at the inline edges, and the caption under the image.
|
|
6
|
+
//
|
|
7
|
+
// The root carries both `modal` and `lightbox`, so these rules outrank
|
|
8
|
+
// Bulma's `.modal` ones in either stylesheet order. The space around the
|
|
9
|
+
// image takes no pointer events, so a click there lands on
|
|
10
|
+
// `.modal-background`, which closes the viewer.
|
|
11
|
+
|
|
12
|
+
@use 'bulma/sass/utilities/initial-variables' as iv;
|
|
13
|
+
@use 'bulma/sass/utilities/css-variables' as cv;
|
|
14
|
+
@use '../variables' as *;
|
|
15
|
+
@use '../mixins' as *;
|
|
16
|
+
|
|
17
|
+
// Carousel's overlay arrows, light controls on a dark tint in either scheme.
|
|
18
|
+
// The same values rather than an `@use` of `_carousel.scss`, which would put
|
|
19
|
+
// the carousel's whole stylesheet into a modular build that asks only for
|
|
20
|
+
// this one.
|
|
21
|
+
$lightbox-arrow-background: hsla(
|
|
22
|
+
#{cv.getVar('scheme-h')},
|
|
23
|
+
#{cv.getVar('scheme-s')},
|
|
24
|
+
#{cv.getVar('scheme-invert-l')},
|
|
25
|
+
0.3
|
|
26
|
+
) !default;
|
|
27
|
+
$lightbox-arrow-background-hover: hsla(
|
|
28
|
+
#{cv.getVar('scheme-h')},
|
|
29
|
+
#{cv.getVar('scheme-s')},
|
|
30
|
+
#{cv.getVar('scheme-invert-l')},
|
|
31
|
+
0.5
|
|
32
|
+
) !default;
|
|
33
|
+
$lightbox-arrow-color: cv.getVar('white') !default;
|
|
34
|
+
$lightbox-arrow-size: 3rem !default;
|
|
35
|
+
$lightbox-arrow-offset: 1rem !default;
|
|
36
|
+
$lightbox-arrow-icon-size: 1.5rem !default;
|
|
37
|
+
// The zoom buttons in the toolbar start from the arrows' look.
|
|
38
|
+
$lightbox-toolbar-button-background: cv.getVar(
|
|
39
|
+
'lightbox-arrow-background'
|
|
40
|
+
) !default;
|
|
41
|
+
$lightbox-toolbar-button-background-hover: cv.getVar(
|
|
42
|
+
'lightbox-arrow-background-hover'
|
|
43
|
+
) !default;
|
|
44
|
+
$lightbox-toolbar-icon-size: 1.25rem !default;
|
|
45
|
+
// The round buttons' border, transparent until forced colors draws it.
|
|
46
|
+
$lightbox-button-border-width: 1px !default;
|
|
47
|
+
// A button that does nothing at an end, or at a zoom limit.
|
|
48
|
+
$lightbox-disabled-opacity: 0.4 !default;
|
|
49
|
+
// The close button, the toolbar and the arrows sit over the image.
|
|
50
|
+
$lightbox-controls-z-index: $extras-z-index-base !default;
|
|
51
|
+
// The modal's background stays near-black in Bulma's dark theme too, so the
|
|
52
|
+
// text on it is white in both.
|
|
53
|
+
$lightbox-toolbar-color: cv.getVar('white') !default;
|
|
54
|
+
$lightbox-toolbar-gap: 0.75rem !default;
|
|
55
|
+
$lightbox-caption-color: cv.getVar('white') !default;
|
|
56
|
+
$lightbox-caption-max-width: 40em !default;
|
|
57
|
+
$lightbox-caption-padding: 0.75rem 1rem 0 !default;
|
|
58
|
+
// A failed image's message and Retry, where the image would be.
|
|
59
|
+
$lightbox-error-color: cv.getVar('lightbox-caption-color') !default;
|
|
60
|
+
$lightbox-error-gap: 0.75rem !default;
|
|
61
|
+
$lightbox-error-padding: 1rem !default;
|
|
62
|
+
$lightbox-loader-size: 2.5rem !default;
|
|
63
|
+
// The band kept free above the image for the toolbar and the close button,
|
|
64
|
+
// and below it, so the image stays centred.
|
|
65
|
+
$lightbox-spacing: 4.5rem !default;
|
|
66
|
+
// The image and its caption share the viewer's height less the two bands.
|
|
67
|
+
$lightbox-image-max-height: calc(
|
|
68
|
+
100% - 2 * #{cv.getVar('lightbox-spacing')}
|
|
69
|
+
) !default;
|
|
70
|
+
// The fades and the zoom, timed and eased as Bulma's own transitions are.
|
|
71
|
+
$lightbox-animation-duration: cv.getVar('duration') !default;
|
|
72
|
+
|
|
73
|
+
.#{iv.$class-prefix}modal.#{iv.$class-prefix}lightbox {
|
|
74
|
+
@include cv.register-vars(
|
|
75
|
+
(
|
|
76
|
+
'lightbox-arrow-background': #{$lightbox-arrow-background},
|
|
77
|
+
'lightbox-arrow-background-hover': #{$lightbox-arrow-background-hover},
|
|
78
|
+
'lightbox-arrow-color': #{$lightbox-arrow-color},
|
|
79
|
+
'lightbox-arrow-size': #{$lightbox-arrow-size},
|
|
80
|
+
'lightbox-arrow-offset': #{$lightbox-arrow-offset},
|
|
81
|
+
'lightbox-arrow-icon-size': #{$lightbox-arrow-icon-size},
|
|
82
|
+
'lightbox-toolbar-button-background':
|
|
83
|
+
#{$lightbox-toolbar-button-background},
|
|
84
|
+
'lightbox-toolbar-button-background-hover':
|
|
85
|
+
#{$lightbox-toolbar-button-background-hover},
|
|
86
|
+
'lightbox-toolbar-icon-size': #{$lightbox-toolbar-icon-size},
|
|
87
|
+
'lightbox-button-border-width': #{$lightbox-button-border-width},
|
|
88
|
+
'lightbox-disabled-opacity': #{$lightbox-disabled-opacity},
|
|
89
|
+
'lightbox-controls-z-index': #{$lightbox-controls-z-index},
|
|
90
|
+
'lightbox-toolbar-color': #{$lightbox-toolbar-color},
|
|
91
|
+
'lightbox-toolbar-gap': #{$lightbox-toolbar-gap},
|
|
92
|
+
'lightbox-caption-color': #{$lightbox-caption-color},
|
|
93
|
+
'lightbox-caption-max-width': #{$lightbox-caption-max-width},
|
|
94
|
+
'lightbox-caption-padding': #{$lightbox-caption-padding},
|
|
95
|
+
'lightbox-error-color': #{$lightbox-error-color},
|
|
96
|
+
'lightbox-error-gap': #{$lightbox-error-gap},
|
|
97
|
+
'lightbox-error-padding': #{$lightbox-error-padding},
|
|
98
|
+
'lightbox-loader-size': #{$lightbox-loader-size},
|
|
99
|
+
'lightbox-spacing': #{$lightbox-spacing},
|
|
100
|
+
'lightbox-image-max-height': #{$lightbox-image-max-height},
|
|
101
|
+
'lightbox-animation-duration': #{$lightbox-animation-duration},
|
|
102
|
+
// Bulma's own, wide enough for the image with room for the arrows at
|
|
103
|
+
// either side, in place of its 40rem.
|
|
104
|
+
'modal-content-width': calc(
|
|
105
|
+
100% - 2 *
|
|
106
|
+
(
|
|
107
|
+
#{cv.getVar('lightbox-arrow-size')} + 2 *
|
|
108
|
+
#{cv.getVar('lightbox-arrow-offset')}
|
|
109
|
+
)
|
|
110
|
+
),
|
|
111
|
+
)
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// ---- The viewer ---------------------------------------------------------------
|
|
116
|
+
|
|
117
|
+
.#{iv.$class-prefix}modal.#{iv.$class-prefix}lightbox.#{iv.$class-prefix}is-active {
|
|
118
|
+
animation: extras-fade-in cv.getVar('lightbox-animation-duration')
|
|
119
|
+
$extras-easing;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.#{iv.$class-prefix}modal.#{iv.$class-prefix}lightbox:focus {
|
|
123
|
+
outline: none;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.#{iv.$class-prefix}modal.#{iv.$class-prefix}lightbox
|
|
127
|
+
> .#{iv.$class-prefix}modal-close {
|
|
128
|
+
z-index: cv.getVar('lightbox-controls-z-index');
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// The image's area: the viewer's width less the arrows' room from a tablet
|
|
132
|
+
// up, and its whole width below, where the arrows sit over the image.
|
|
133
|
+
.#{iv.$class-prefix}modal.#{iv.$class-prefix}lightbox
|
|
134
|
+
> .#{iv.$class-prefix}modal-content {
|
|
135
|
+
height: cv.getVar('lightbox-image-max-height');
|
|
136
|
+
max-height: none;
|
|
137
|
+
margin: 0;
|
|
138
|
+
overflow: visible;
|
|
139
|
+
pointer-events: none;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// ---- The toolbar ----------------------------------------------------------------
|
|
143
|
+
|
|
144
|
+
.#{iv.$class-prefix}lightbox-toolbar {
|
|
145
|
+
position: absolute;
|
|
146
|
+
inset-block-start: 0;
|
|
147
|
+
inset-inline: 0;
|
|
148
|
+
z-index: cv.getVar('lightbox-controls-z-index');
|
|
149
|
+
display: flex;
|
|
150
|
+
align-items: center;
|
|
151
|
+
gap: cv.getVar('lightbox-toolbar-gap');
|
|
152
|
+
min-height: cv.getVar('lightbox-spacing');
|
|
153
|
+
// Level with the close button, and clear of it.
|
|
154
|
+
padding-block: cv.getVar('modal-close-top');
|
|
155
|
+
padding-inline: cv.getVar('modal-close-right')
|
|
156
|
+
calc(
|
|
157
|
+
#{cv.getVar('modal-close-right')} * 2 +
|
|
158
|
+
#{cv.getVar('modal-close-dimensions')}
|
|
159
|
+
);
|
|
160
|
+
color: cv.getVar('lightbox-toolbar-color');
|
|
161
|
+
pointer-events: none;
|
|
162
|
+
|
|
163
|
+
> .#{iv.$class-prefix}buttons {
|
|
164
|
+
flex-wrap: nowrap;
|
|
165
|
+
margin-block-end: 0;
|
|
166
|
+
margin-inline-start: auto;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.#{iv.$class-prefix}lightbox-progress {
|
|
171
|
+
font-variant-numeric: tabular-nums;
|
|
172
|
+
white-space: nowrap;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// ---- The buttons over the dark background ------------------------------------------
|
|
176
|
+
|
|
177
|
+
.#{iv.$class-prefix}modal.#{iv.$class-prefix}lightbox
|
|
178
|
+
.#{iv.$class-prefix}lightbox-toolbar
|
|
179
|
+
.#{iv.$class-prefix}button,
|
|
180
|
+
.#{iv.$class-prefix}modal.#{iv.$class-prefix}lightbox
|
|
181
|
+
.#{iv.$class-prefix}lightbox-arrow {
|
|
182
|
+
align-items: center;
|
|
183
|
+
justify-content: center;
|
|
184
|
+
width: cv.getVar('modal-close-dimensions');
|
|
185
|
+
height: cv.getVar('modal-close-dimensions');
|
|
186
|
+
padding: 0;
|
|
187
|
+
// Transparent until forced colors draws it.
|
|
188
|
+
border: cv.getVar('lightbox-button-border-width') solid transparent;
|
|
189
|
+
border-radius: cv.getVar('radius-rounded');
|
|
190
|
+
pointer-events: auto;
|
|
191
|
+
|
|
192
|
+
// Bulma's ring is a link-colored shadow, under 3:1 on the near-black
|
|
193
|
+
// background and gone in forced colors, so an outline in the buttons' own
|
|
194
|
+
// color takes its place.
|
|
195
|
+
&:focus-visible {
|
|
196
|
+
@include extras-focus-outline;
|
|
197
|
+
outline-color: currentColor;
|
|
198
|
+
box-shadow: none;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
&[aria-disabled='true'] {
|
|
202
|
+
opacity: cv.getVar('lightbox-disabled-opacity');
|
|
203
|
+
cursor: not-allowed;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.#{iv.$class-prefix}modal.#{iv.$class-prefix}lightbox
|
|
208
|
+
.#{iv.$class-prefix}lightbox-toolbar
|
|
209
|
+
.#{iv.$class-prefix}button {
|
|
210
|
+
background-color: cv.getVar('lightbox-toolbar-button-background');
|
|
211
|
+
color: cv.getVar('lightbox-toolbar-color');
|
|
212
|
+
|
|
213
|
+
&:hover:not([aria-disabled='true']) {
|
|
214
|
+
background-color: cv.getVar('lightbox-toolbar-button-background-hover');
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
svg {
|
|
218
|
+
width: cv.getVar('lightbox-toolbar-icon-size');
|
|
219
|
+
height: cv.getVar('lightbox-toolbar-icon-size');
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.#{iv.$class-prefix}modal.#{iv.$class-prefix}lightbox
|
|
224
|
+
.#{iv.$class-prefix}lightbox-arrow {
|
|
225
|
+
position: absolute;
|
|
226
|
+
inset-block-start: 50%;
|
|
227
|
+
z-index: cv.getVar('lightbox-controls-z-index');
|
|
228
|
+
width: cv.getVar('lightbox-arrow-size');
|
|
229
|
+
height: cv.getVar('lightbox-arrow-size');
|
|
230
|
+
transform: translateY(-50%);
|
|
231
|
+
background-color: cv.getVar('lightbox-arrow-background');
|
|
232
|
+
color: cv.getVar('lightbox-arrow-color');
|
|
233
|
+
|
|
234
|
+
&:hover:not([aria-disabled='true']) {
|
|
235
|
+
background-color: cv.getVar('lightbox-arrow-background-hover');
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
&.#{iv.$class-prefix}is-prev {
|
|
239
|
+
inset-inline-start: cv.getVar('lightbox-arrow-offset');
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
&.#{iv.$class-prefix}is-next {
|
|
243
|
+
inset-inline-end: cv.getVar('lightbox-arrow-offset');
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
svg {
|
|
247
|
+
width: cv.getVar('lightbox-arrow-icon-size');
|
|
248
|
+
height: cv.getVar('lightbox-arrow-icon-size');
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
// Right to left, the previous button is on the right, so its chevron
|
|
252
|
+
// points that way.
|
|
253
|
+
svg:dir(rtl) {
|
|
254
|
+
transform: scaleX(-1);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
// ---- The image and its caption -----------------------------------------------------
|
|
259
|
+
|
|
260
|
+
// One cell the image fills, with the caption under it. The image, the one
|
|
261
|
+
// fading out over it, the Loader and the error share the cell.
|
|
262
|
+
.#{iv.$class-prefix}lightbox-figure {
|
|
263
|
+
display: grid;
|
|
264
|
+
grid-template-columns: minmax(0, 1fr);
|
|
265
|
+
grid-template-rows: minmax(0, 1fr) auto;
|
|
266
|
+
height: 100%;
|
|
267
|
+
margin: 0;
|
|
268
|
+
position: relative;
|
|
269
|
+
transition: transform cv.getVar('lightbox-animation-duration') $extras-easing;
|
|
270
|
+
|
|
271
|
+
> :not(.#{iv.$class-prefix}lightbox-caption) {
|
|
272
|
+
grid-area: 1 / 1;
|
|
273
|
+
place-self: center;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.#{iv.$class-prefix}lightbox-image {
|
|
278
|
+
display: block;
|
|
279
|
+
max-width: 100%;
|
|
280
|
+
max-height: 100%;
|
|
281
|
+
object-fit: contain;
|
|
282
|
+
pointer-events: auto;
|
|
283
|
+
// Pinch zooms the image rather than the page, and a drag pans it.
|
|
284
|
+
touch-action: none;
|
|
285
|
+
user-select: none;
|
|
286
|
+
-webkit-user-drag: none;
|
|
287
|
+
transition: transform cv.getVar('lightbox-animation-duration') $extras-easing;
|
|
288
|
+
|
|
289
|
+
// Hidden until it loads, then faded in.
|
|
290
|
+
&.#{iv.$class-prefix}is-loading {
|
|
291
|
+
opacity: 0;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
&:not(.#{iv.$class-prefix}is-loading):not(.#{iv.$class-prefix}is-leaving) {
|
|
295
|
+
animation: extras-fade-in cv.getVar('lightbox-animation-duration')
|
|
296
|
+
$extras-easing;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
// The image before it, on top, shown until the new one has loaded and then
|
|
300
|
+
// faded out as that one fades in. Animations rather than transitions, so
|
|
301
|
+
// the fades run for an image that was already loaded too.
|
|
302
|
+
&.#{iv.$class-prefix}is-leaving {
|
|
303
|
+
pointer-events: none;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
&:not(.#{iv.$class-prefix}is-loading)
|
|
307
|
+
+ .#{iv.$class-prefix}lightbox-image.#{iv.$class-prefix}is-leaving {
|
|
308
|
+
animation: extras-fade-out cv.getVar('lightbox-animation-duration')
|
|
309
|
+
$extras-easing forwards;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
.#{iv.$class-prefix}modal.#{iv.$class-prefix}lightbox.#{iv.$class-prefix}is-zoomed
|
|
314
|
+
.#{iv.$class-prefix}lightbox-image {
|
|
315
|
+
cursor: grab;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
.#{iv.$class-prefix}lightbox-caption {
|
|
319
|
+
justify-self: center;
|
|
320
|
+
max-width: cv.getVar('lightbox-caption-max-width');
|
|
321
|
+
padding: cv.getVar('lightbox-caption-padding');
|
|
322
|
+
color: cv.getVar('lightbox-caption-color');
|
|
323
|
+
text-align: center;
|
|
324
|
+
pointer-events: auto;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
.#{iv.$class-prefix}lightbox-error {
|
|
328
|
+
display: flex;
|
|
329
|
+
flex-direction: column;
|
|
330
|
+
align-items: center;
|
|
331
|
+
gap: cv.getVar('lightbox-error-gap');
|
|
332
|
+
padding: cv.getVar('lightbox-error-padding');
|
|
333
|
+
color: cv.getVar('lightbox-error-color');
|
|
334
|
+
text-align: center;
|
|
335
|
+
pointer-events: auto;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
.#{iv.$class-prefix}lightbox-figure > .#{iv.$class-prefix}loader {
|
|
339
|
+
font-size: cv.getVar('lightbox-loader-size');
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
// ---- The trigger ----------------------------------------------------------------------
|
|
343
|
+
|
|
344
|
+
// A button around a thumbnail, drawn as the thumbnail: no button chrome, as
|
|
345
|
+
// wide as the column or cell it's in, since a ratio `Image` has no width of
|
|
346
|
+
// its own, and an outline around what it holds. `:where()` keeps all of it
|
|
347
|
+
// at no specificity, so a trigger given Bulma's `button` class looks and
|
|
348
|
+
// sizes like a Bulma button instead.
|
|
349
|
+
:where(.#{iv.$class-prefix}lightbox-trigger) {
|
|
350
|
+
@include extras-button-reset;
|
|
351
|
+
text-align: inherit;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
:where(.#{iv.$class-prefix}lightbox-trigger:not(.#{iv.$class-prefix}button)) {
|
|
355
|
+
display: block;
|
|
356
|
+
width: 100%;
|
|
357
|
+
|
|
358
|
+
&:focus-visible {
|
|
359
|
+
@include extras-focus-outline;
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
// ---- Motion and forced colors ------------------------------------------------------------
|
|
364
|
+
|
|
365
|
+
// The fades are on selectors more specific than these, hence `!important`.
|
|
366
|
+
// Script keeps no outgoing image under reduced motion either.
|
|
367
|
+
@media (prefers-reduced-motion: reduce) {
|
|
368
|
+
.#{iv.$class-prefix}modal.#{iv.$class-prefix}lightbox.#{iv.$class-prefix}is-active,
|
|
369
|
+
.#{iv.$class-prefix}lightbox-image {
|
|
370
|
+
animation: none !important;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
.#{iv.$class-prefix}lightbox-figure,
|
|
374
|
+
.#{iv.$class-prefix}lightbox-image {
|
|
375
|
+
transition: none;
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
@media (forced-colors: active) {
|
|
380
|
+
.#{iv.$class-prefix}modal.#{iv.$class-prefix}lightbox
|
|
381
|
+
.#{iv.$class-prefix}lightbox-toolbar
|
|
382
|
+
.#{iv.$class-prefix}button,
|
|
383
|
+
.#{iv.$class-prefix}modal.#{iv.$class-prefix}lightbox
|
|
384
|
+
.#{iv.$class-prefix}lightbox-arrow {
|
|
385
|
+
border-color: ButtonText;
|
|
386
|
+
|
|
387
|
+
&[aria-disabled='true'] {
|
|
388
|
+
border-color: GrayText;
|
|
389
|
+
color: GrayText;
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// Bestax Extras - TableOfContents Styles
|
|
2
|
+
// A table of contents is Bulma's menu as it is: `.menu` on its `<nav>`, a
|
|
3
|
+
// `.menu-label` title, `.menu-list` links and `is-active` on the current one,
|
|
4
|
+
// so every `--bulma-menu-*` variable themes it. This adds only the opt-in
|
|
5
|
+
// sticky position, for a column that doesn't stick by itself.
|
|
6
|
+
|
|
7
|
+
@use 'bulma/sass/utilities/initial-variables' as iv;
|
|
8
|
+
@use 'bulma/sass/utilities/css-variables' as cv;
|
|
9
|
+
|
|
10
|
+
// How far below the viewport's top a sticky list stops. Under a fixed
|
|
11
|
+
// navbar, make it the navbar's height plus this.
|
|
12
|
+
$table-of-contents-sticky-top: cv.getVar('block-spacing') !default;
|
|
13
|
+
|
|
14
|
+
.#{iv.$class-prefix}table-of-contents {
|
|
15
|
+
@include cv.register-vars(
|
|
16
|
+
(
|
|
17
|
+
'table-of-contents-sticky-top': #{$table-of-contents-sticky-top},
|
|
18
|
+
)
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// Bulma's focus ring, which sits this far outside a link.
|
|
23
|
+
$-focus-ring: calc(#{cv.getVar('focus-width')} + #{cv.getVar('focus-offset')});
|
|
24
|
+
|
|
25
|
+
// It stays in view as the page scrolls, and a list taller than the room left
|
|
26
|
+
// below its top scrolls itself, so its end can still be reached. The room is
|
|
27
|
+
// measured in `dvh`, the viewport as it is now, so a phone's toolbar doesn't
|
|
28
|
+
// cover the list's end, and in `vh` where `dvh` isn't known. Scrolling clips
|
|
29
|
+
// what's outside it, so it keeps room around it for a link's focus ring, at
|
|
30
|
+
// the sides and above the first link and below the last, and gives that room
|
|
31
|
+
// back with a margin, so the links stay where they are.
|
|
32
|
+
.#{iv.$class-prefix}table-of-contents.#{iv.$class-prefix}is-sticky {
|
|
33
|
+
margin-block: calc(-1 * #{$-focus-ring});
|
|
34
|
+
margin-inline: calc(-1 * #{$-focus-ring});
|
|
35
|
+
max-height: calc(100vh - #{cv.getVar('table-of-contents-sticky-top')});
|
|
36
|
+
max-height: calc(100dvh - #{cv.getVar('table-of-contents-sticky-top')});
|
|
37
|
+
overflow-y: auto;
|
|
38
|
+
padding-block: $-focus-ring;
|
|
39
|
+
padding-inline: $-focus-ring;
|
|
40
|
+
position: sticky;
|
|
41
|
+
top: cv.getVar('table-of-contents-sticky-top');
|
|
42
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
// Bestax Extras - PasswordInput Styles
|
|
2
|
+
// A password field with a button inside it that shows what was typed. Bulma's
|
|
3
|
+
// Control icons take no clicks, so the toggle is a real button laid over the
|
|
4
|
+
// input's right edge, with the date pickers' launcher rule, which the two
|
|
5
|
+
// share through the `extras-input-trigger` mixin.
|
|
6
|
+
//
|
|
7
|
+
// The toggle sits on the physical right, as the pickers' launcher and Bulma's
|
|
8
|
+
// right icon do, so in a right-to-left page it's at the start of the field
|
|
9
|
+
// rather than its end. Moving them to the inline end is one change, for all
|
|
10
|
+
// of them together.
|
|
11
|
+
|
|
12
|
+
@use 'bulma/sass/utilities/initial-variables' as iv;
|
|
13
|
+
@use 'bulma/sass/utilities/css-variables' as cv;
|
|
14
|
+
@use '../mixins' as *;
|
|
15
|
+
@use '../input-trigger' as *;
|
|
16
|
+
|
|
17
|
+
// The toggle's room, in em so it tracks the input's size, as Bulma's icon
|
|
18
|
+
// slot does. The words need more room than the eye; a longer translation
|
|
19
|
+
// sets its own.
|
|
20
|
+
$password-input-toggle-width: 2.5em !default;
|
|
21
|
+
$password-input-toggle-text-width: 4.5em !default;
|
|
22
|
+
$password-input-toggle-color: cv.getVar('text') !default;
|
|
23
|
+
$password-input-toggle-hover-color: cv.getVar('text-strong') !default;
|
|
24
|
+
$password-input-toggle-disabled-opacity: 0.5 !default;
|
|
25
|
+
|
|
26
|
+
.#{iv.$class-prefix}password-input-container {
|
|
27
|
+
@include cv.register-vars(
|
|
28
|
+
(
|
|
29
|
+
'password-input-toggle-width': #{$password-input-toggle-width},
|
|
30
|
+
'password-input-toggle-text-width': #{$password-input-toggle-text-width},
|
|
31
|
+
'password-input-toggle-color': #{$password-input-toggle-color},
|
|
32
|
+
'password-input-toggle-hover-color': #{$password-input-toggle-hover-color},
|
|
33
|
+
'password-input-toggle-disabled-opacity': #{$password-input-toggle-disabled-opacity},
|
|
34
|
+
)
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.#{iv.$class-prefix}password-input-container {
|
|
39
|
+
@include extras-input-trigger(
|
|
40
|
+
$trigger: 'password-input-toggle',
|
|
41
|
+
$width: cv.getVar('password-input-toggle-width'),
|
|
42
|
+
$color: cv.getVar('password-input-toggle-color'),
|
|
43
|
+
$hover-color: cv.getVar('password-input-toggle-hover-color'),
|
|
44
|
+
$disabled-opacity: cv.getVar('password-input-toggle-disabled-opacity')
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
// Bulma gives a rounded input its own side padding at two classes, which
|
|
48
|
+
// ties the rule above; at three this wins whichever sheet loads first.
|
|
49
|
+
> .#{iv.$class-prefix}input.#{iv.$class-prefix}is-rounded {
|
|
50
|
+
padding-right: cv.getVar('password-input-toggle-width');
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&.#{iv.$class-prefix}is-text {
|
|
54
|
+
> .#{iv.$class-prefix}input,
|
|
55
|
+
> .#{iv.$class-prefix}input.#{iv.$class-prefix}is-rounded {
|
|
56
|
+
padding-right: cv.getVar('password-input-toggle-text-width');
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
> .#{iv.$class-prefix}password-input-toggle {
|
|
60
|
+
width: cv.getVar('password-input-toggle-text-width');
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
> .#{iv.$class-prefix}password-input-toggle {
|
|
65
|
+
// The input's own size, which the size modifiers above change, wherever
|
|
66
|
+
// the field sits; a button otherwise takes the text's around it.
|
|
67
|
+
font-family: inherit;
|
|
68
|
+
font-size: cv.getVar('size-normal');
|
|
69
|
+
line-height: 1;
|
|
70
|
+
|
|
71
|
+
&:focus-visible {
|
|
72
|
+
@include extras-focus-outline;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// Edge draws its own reveal button in a password field, which would make
|
|
77
|
+
// two.
|
|
78
|
+
> .#{iv.$class-prefix}input::-ms-reveal {
|
|
79
|
+
display: none;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// Bulma sizes and colors a left icon from the input beside it
|
|
84
|
+
// (`.input.is-small ~ .icon`). Here the input sits one level down, in the
|
|
85
|
+
// container, so these say the same from the container.
|
|
86
|
+
.#{iv.$class-prefix}control.#{iv.$class-prefix}has-icons-left
|
|
87
|
+
> .#{iv.$class-prefix}password-input-container {
|
|
88
|
+
@each $size in 'small', 'medium', 'large' {
|
|
89
|
+
&:has(> .#{iv.$class-prefix}input.#{iv.$class-prefix}is-#{$size})
|
|
90
|
+
~ .#{iv.$class-prefix}icon {
|
|
91
|
+
font-size: cv.getVar('size-#{$size}');
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
&:has(> .#{iv.$class-prefix}input:hover) ~ .#{iv.$class-prefix}icon {
|
|
96
|
+
color: cv.getVar('input-icon-hover-color');
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
&:has(> .#{iv.$class-prefix}input:focus) ~ .#{iv.$class-prefix}icon {
|
|
100
|
+
color: cv.getVar('input-icon-focus-color');
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// In forced colors the toggle's glyph and words take the system's button
|
|
105
|
+
// text, and a disabled one the system's gray, as a native button's do.
|
|
106
|
+
@media (forced-colors: active) {
|
|
107
|
+
.#{iv.$class-prefix}password-input-container
|
|
108
|
+
> .#{iv.$class-prefix}password-input-toggle:disabled {
|
|
109
|
+
color: GrayText;
|
|
110
|
+
opacity: 1;
|
|
111
|
+
}
|
|
112
|
+
}
|