@allxsmith/bestax-bulma 5.67.10 → 5.67.11
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/Message.js +4 -1
- package/dist/esm/components/Message.js.map +1 -1
- package/dist/esm/components/Modal.js +5 -2
- package/dist/esm/components/Modal.js.map +1 -1
- package/dist/esm/elements/Notification.js +13 -4
- package/dist/esm/elements/Notification.js.map +1 -1
- package/dist/esm/helpers/scrollLock.js +29 -4
- package/dist/esm/helpers/scrollLock.js.map +1 -1
- package/dist/extras.css +1 -1
- package/dist/extras.css.map +1 -1
- package/dist/index.cjs +49 -10
- package/dist/index.cjs.map +1 -1
- package/dist/types/components/Modal.d.ts +9 -5
- package/dist/types/helpers/scrollLock.d.ts +13 -0
- package/dist/types-cjs/components/Modal.d.ts +9 -5
- package/dist/types-cjs/helpers/scrollLock.d.ts +13 -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 +5 -0
- package/src/scss/_variables.scss +6 -0
- package/src/scss/components/_affix.scss +10 -5
- package/src/scss/components/_navbar.scss +19 -1
- package/src/scss/components/_toast.scss +18 -7
package/package.json
CHANGED
package/src/scss/CLAUDE.md
CHANGED
|
@@ -69,6 +69,11 @@ Rules the pattern encodes:
|
|
|
69
69
|
dark-mode bug.
|
|
70
70
|
- **Reuse `extras-*` mixins** for transitions, focus outlines, and screen-reader-only content
|
|
71
71
|
instead of re-rolling them (focus style consistency is an a11y requirement).
|
|
72
|
+
- **A part fixed to an edge of the window adds the scroll lock's room on that side**
|
|
73
|
+
(`$extras-scroll-lock-offset-left` or `-right`, from `_variables.scss`) to its offset there, as
|
|
74
|
+
`_affix.scss` and `_toast.scss` do. While an overlay locks the page, the window grows by the
|
|
75
|
+
room the page's scrollbar had and the lock pads `<html>` by it, which a fixed box doesn't see,
|
|
76
|
+
so without it the part moves by the scrollbar's width.
|
|
72
77
|
- New CSS variables should be documented in
|
|
73
78
|
`skills/bestax-theming/references/css-variables.md`, and the component's rows added to
|
|
74
79
|
`skills/bestax-theming/references/themeable-components.md`, in the same PR.
|
package/src/scss/_variables.scss
CHANGED
|
@@ -61,6 +61,12 @@ $extras-size-large: var(--bulma-size-large, 1.5rem);
|
|
|
61
61
|
// Spacing
|
|
62
62
|
$extras-block-spacing: var(--bulma-block-spacing, 1.5rem);
|
|
63
63
|
|
|
64
|
+
// The room the page's scrollbar gave back on each side while an overlay locks
|
|
65
|
+
// the page's scrolling, which the lock sets on `<html>`, and 0 otherwise. A
|
|
66
|
+
// part fixed to that edge of the window adds it to its offset there.
|
|
67
|
+
$extras-scroll-lock-offset-left: var(--bulma-scroll-lock-offset-left, 0px);
|
|
68
|
+
$extras-scroll-lock-offset-right: var(--bulma-scroll-lock-offset-right, 0px);
|
|
69
|
+
|
|
64
70
|
// Borders and radius
|
|
65
71
|
$extras-radius-small: var(--bulma-radius-small, 2px);
|
|
66
72
|
$extras-radius: var(--bulma-radius, 4px);
|
|
@@ -33,15 +33,18 @@ $affix-z-index: $extras-z-index-dropdown - 1 !default;
|
|
|
33
33
|
// stays on the right in right-to-left text. Each side adds the device's
|
|
34
34
|
// safe-area inset for that edge, which is 0 unless the page sets
|
|
35
35
|
// `viewport-fit=cover`. A margin from the spacing helpers adds to the
|
|
36
|
-
// distance, since a fixed box's margin pushes it off its inset.
|
|
36
|
+
// distance, since a fixed box's margin pushes it off its inset. The sides
|
|
37
|
+
// also add the room the page's scrollbar gave back there while an overlay
|
|
38
|
+
// locks the page, so the Affix stays put as the scrollbar goes.
|
|
37
39
|
.#{iv.$class-prefix}affix {
|
|
38
40
|
position: fixed;
|
|
39
41
|
z-index: cv.getVar('affix-z-index');
|
|
40
42
|
// As wide as its content, and never wider than the viewport less the
|
|
41
|
-
// offset
|
|
43
|
+
// offset, the safe area and the scrollbar's room on both sides.
|
|
42
44
|
max-width: calc(
|
|
43
45
|
100% - 2 * #{cv.getVar('affix-offset-horizontal')} -
|
|
44
|
-
env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)
|
|
46
|
+
env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px) -
|
|
47
|
+
#{$extras-scroll-lock-offset-left} - #{$extras-scroll-lock-offset-right}
|
|
45
48
|
);
|
|
46
49
|
|
|
47
50
|
&.#{iv.$class-prefix}is-top-right,
|
|
@@ -61,14 +64,16 @@ $affix-z-index: $extras-z-index-dropdown - 1 !default;
|
|
|
61
64
|
&.#{iv.$class-prefix}is-top-right,
|
|
62
65
|
&.#{iv.$class-prefix}is-bottom-right {
|
|
63
66
|
right: calc(
|
|
64
|
-
#{cv.getVar('affix-offset-horizontal')} + env(safe-area-inset-right, 0px)
|
|
67
|
+
#{cv.getVar('affix-offset-horizontal')} + env(safe-area-inset-right, 0px) +
|
|
68
|
+
#{$extras-scroll-lock-offset-right}
|
|
65
69
|
);
|
|
66
70
|
}
|
|
67
71
|
|
|
68
72
|
&.#{iv.$class-prefix}is-top-left,
|
|
69
73
|
&.#{iv.$class-prefix}is-bottom-left {
|
|
70
74
|
left: calc(
|
|
71
|
-
#{cv.getVar('affix-offset-horizontal')} + env(safe-area-inset-left, 0px)
|
|
75
|
+
#{cv.getVar('affix-offset-horizontal')} + env(safe-area-inset-left, 0px) +
|
|
76
|
+
#{$extras-scroll-lock-offset-left}
|
|
72
77
|
);
|
|
73
78
|
}
|
|
74
79
|
}
|
|
@@ -3,13 +3,23 @@
|
|
|
3
3
|
// on a button with no background. Forced colors (Windows' contrast themes)
|
|
4
4
|
// replaces background colors, and Chromium paints the bars in the page's
|
|
5
5
|
// Canvas color, so the burger vanishes while it still works. This keeps
|
|
6
|
-
// the bars in ButtonText.
|
|
6
|
+
// the bars in ButtonText.
|
|
7
7
|
//
|
|
8
8
|
// Bulma's CSS can land on either side of this partial, as it can for
|
|
9
9
|
// `_delete.scss`, so the selector names its class twice to outrank Bulma's
|
|
10
10
|
// `.navbar-burger span`, wherever the two load.
|
|
11
|
+
//
|
|
12
|
+
// A navbar fixed to the top or the bottom of the window (`Navbar fixed`)
|
|
13
|
+
// spans it. While an overlay locks the page, the window takes back the room
|
|
14
|
+
// the page's scrollbar had, and the lock pads the page by it, so a margin of
|
|
15
|
+
// that room on each side keeps the navbar over the page as the scrollbar
|
|
16
|
+
// goes. Outside a lock the margins are 0. A margin adds to the insets that
|
|
17
|
+
// place the navbar, Bulma's or an app's, and Bulma sets none on a navbar, so
|
|
18
|
+
// this needs no weight over Bulma's rules. `:where()` keeps it at none, so a
|
|
19
|
+
// margin an app gives its navbar still wins.
|
|
11
20
|
|
|
12
21
|
@use 'bulma/sass/utilities/initial-variables' as iv;
|
|
22
|
+
@use '../variables' as *;
|
|
13
23
|
|
|
14
24
|
@media (forced-colors: active) {
|
|
15
25
|
.#{iv.$class-prefix}navbar-burger.#{iv.$class-prefix}navbar-burger span {
|
|
@@ -18,3 +28,11 @@
|
|
|
18
28
|
background-color: ButtonText;
|
|
19
29
|
}
|
|
20
30
|
}
|
|
31
|
+
|
|
32
|
+
:where(
|
|
33
|
+
.#{iv.$class-prefix}navbar.#{iv.$class-prefix}is-fixed-top,
|
|
34
|
+
.#{iv.$class-prefix}navbar.#{iv.$class-prefix}is-fixed-bottom
|
|
35
|
+
) {
|
|
36
|
+
margin-left: $extras-scroll-lock-offset-left;
|
|
37
|
+
margin-right: $extras-scroll-lock-offset-right;
|
|
38
|
+
}
|
|
@@ -46,6 +46,14 @@ $toast-action-hover-opacity: 0.1 !default;
|
|
|
46
46
|
// Toast container — positions toasts on screen and stacks multiples vertically.
|
|
47
47
|
// Uses SCSS variables directly since the container is a parent of .toast
|
|
48
48
|
// (CSS vars registered on .toast don't cascade up).
|
|
49
|
+
//
|
|
50
|
+
// While an overlay locks the page, the window's edges take back the room the
|
|
51
|
+
// page's scrollbar had, so each side adds that room and a centered stack
|
|
52
|
+
// moves by half of the difference: the toasts stay put as the scrollbar goes.
|
|
53
|
+
$-centered-left: calc(
|
|
54
|
+
50% + (#{$extras-scroll-lock-offset-left} - #{$extras-scroll-lock-offset-right}) / 2
|
|
55
|
+
);
|
|
56
|
+
|
|
49
57
|
.#{iv.$class-prefix}toast-container {
|
|
50
58
|
position: fixed;
|
|
51
59
|
z-index: #{$toast-container-z-index};
|
|
@@ -54,24 +62,27 @@ $toast-action-hover-opacity: 0.1 !default;
|
|
|
54
62
|
gap: #{$toast-container-gap};
|
|
55
63
|
padding: #{$toast-container-padding};
|
|
56
64
|
pointer-events: none;
|
|
57
|
-
max-width:
|
|
65
|
+
max-width: calc(
|
|
66
|
+
100% - #{$extras-scroll-lock-offset-left} -
|
|
67
|
+
#{$extras-scroll-lock-offset-right}
|
|
68
|
+
);
|
|
58
69
|
|
|
59
70
|
// Top positions
|
|
60
71
|
&.#{iv.$class-prefix}is-top-right {
|
|
61
72
|
top: 0;
|
|
62
|
-
right:
|
|
73
|
+
right: $extras-scroll-lock-offset-right;
|
|
63
74
|
align-items: flex-end;
|
|
64
75
|
}
|
|
65
76
|
|
|
66
77
|
&.#{iv.$class-prefix}is-top-left {
|
|
67
78
|
top: 0;
|
|
68
|
-
left:
|
|
79
|
+
left: $extras-scroll-lock-offset-left;
|
|
69
80
|
align-items: flex-start;
|
|
70
81
|
}
|
|
71
82
|
|
|
72
83
|
&.#{iv.$class-prefix}is-top-center {
|
|
73
84
|
top: 0;
|
|
74
|
-
left:
|
|
85
|
+
left: $-centered-left;
|
|
75
86
|
transform: translateX(-50%);
|
|
76
87
|
align-items: center;
|
|
77
88
|
}
|
|
@@ -80,21 +91,21 @@ $toast-action-hover-opacity: 0.1 !default;
|
|
|
80
91
|
// edge as a top one grows down from the top, the first toast nearest it
|
|
81
92
|
&.#{iv.$class-prefix}is-bottom-right {
|
|
82
93
|
bottom: 0;
|
|
83
|
-
right:
|
|
94
|
+
right: $extras-scroll-lock-offset-right;
|
|
84
95
|
align-items: flex-end;
|
|
85
96
|
flex-direction: column-reverse;
|
|
86
97
|
}
|
|
87
98
|
|
|
88
99
|
&.#{iv.$class-prefix}is-bottom-left {
|
|
89
100
|
bottom: 0;
|
|
90
|
-
left:
|
|
101
|
+
left: $extras-scroll-lock-offset-left;
|
|
91
102
|
align-items: flex-start;
|
|
92
103
|
flex-direction: column-reverse;
|
|
93
104
|
}
|
|
94
105
|
|
|
95
106
|
&.#{iv.$class-prefix}is-bottom-center {
|
|
96
107
|
bottom: 0;
|
|
97
|
-
left:
|
|
108
|
+
left: $-centered-left;
|
|
98
109
|
transform: translateX(-50%);
|
|
99
110
|
align-items: center;
|
|
100
111
|
flex-direction: column-reverse;
|