@allxsmith/bestax-bulma 5.67.10 → 5.67.12

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.
Files changed (45) hide show
  1. package/dist/bestax.css +1 -1
  2. package/dist/bestax.css.map +1 -1
  3. package/dist/esm/components/Message.js +4 -1
  4. package/dist/esm/components/Message.js.map +1 -1
  5. package/dist/esm/components/Modal.js +5 -2
  6. package/dist/esm/components/Modal.js.map +1 -1
  7. package/dist/esm/elements/Button.js +3 -1
  8. package/dist/esm/elements/Button.js.map +1 -1
  9. package/dist/esm/elements/Notification.js +16 -5
  10. package/dist/esm/elements/Notification.js.map +1 -1
  11. package/dist/esm/elements/Tag.js +3 -1
  12. package/dist/esm/elements/Tag.js.map +1 -1
  13. package/dist/esm/form/ColorInputBase.js +3 -1
  14. package/dist/esm/form/ColorInputBase.js.map +1 -1
  15. package/dist/esm/helpers/scrollLock.js +29 -4
  16. package/dist/esm/helpers/scrollLock.js.map +1 -1
  17. package/dist/extras.css +1 -1
  18. package/dist/extras.css.map +1 -1
  19. package/dist/index.cjs +61 -14
  20. package/dist/index.cjs.map +1 -1
  21. package/dist/types/components/Modal.d.ts +9 -5
  22. package/dist/types/elements/Notification.d.ts +16 -12
  23. package/dist/types/elements/Tag.d.ts +11 -2
  24. package/dist/types/helpers/scrollLock.d.ts +13 -0
  25. package/dist/types-cjs/components/Modal.d.ts +9 -5
  26. package/dist/types-cjs/elements/Notification.d.ts +16 -12
  27. package/dist/types-cjs/elements/Tag.d.ts +11 -2
  28. package/dist/types-cjs/helpers/scrollLock.d.ts +13 -0
  29. package/dist/versions/bestax-no-dark-mode.css +1 -1
  30. package/dist/versions/bestax-no-dark-mode.css.map +1 -1
  31. package/dist/versions/bestax-no-helpers-prefixed.css +1 -1
  32. package/dist/versions/bestax-no-helpers-prefixed.css.map +1 -1
  33. package/dist/versions/bestax-no-helpers.css +1 -1
  34. package/dist/versions/bestax-no-helpers.css.map +1 -1
  35. package/dist/versions/bestax-prefixed.css +1 -1
  36. package/dist/versions/bestax-prefixed.css.map +1 -1
  37. package/package.json +1 -1
  38. package/src/scss/CLAUDE.md +5 -0
  39. package/src/scss/_variables.scss +6 -0
  40. package/src/scss/components/_affix.scss +10 -5
  41. package/src/scss/components/_navbar.scss +19 -1
  42. package/src/scss/components/_toast.scss +18 -7
  43. package/src/scss/elements/_index.scss +1 -0
  44. package/src/scss/elements/_notification.scss +19 -1
  45. package/src/scss/elements/_tag.scss +29 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allxsmith/bestax-bulma",
3
- "version": "5.67.10",
3
+ "version": "5.67.12",
4
4
  "description": "Component library based on React, Bulma, with Agent Skills and MCP",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.esm.js",
@@ -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.
@@ -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 and the safe area on both sides.
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. Outside forced colors it changes nothing.
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: 100%;
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: 0;
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: 0;
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: 50%;
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: 0;
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: 0;
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: 50%;
108
+ left: $-centered-left;
98
109
  transform: translateX(-50%);
99
110
  align-items: center;
100
111
  flex-direction: column-reverse;
@@ -15,3 +15,4 @@
15
15
  @use 'ringprogress';
16
16
  @use 'skeleton';
17
17
  @use 'stat';
18
+ @use 'tag';
@@ -1,6 +1,6 @@
1
1
  // Notification Styles
2
2
  // Bulma already styles the notification; this keeps its text clear of the
3
- // close button, and gives the dark color back its own look
3
+ // close button, and gives the dark and light colors back their own looks
4
4
 
5
5
  @use "bulma/sass/utilities/initial-variables" as iv;
6
6
  @use "bulma/sass/utilities/css-variables" as cv;
@@ -96,3 +96,21 @@ $-delete-sizes: (
96
96
  )
97
97
  );
98
98
  }
99
+
100
+ // The same nesting writes the light color's light variant as
101
+ // `.notification.is-light.is-light`, which matches every light notification,
102
+ // with a 90% background and the text's lightness read from
103
+ // `--bulma-light-light-invert-l`, which Bulma doesn't define either. This puts
104
+ // back what `.notification.is-light` sets. Its `:not()` names every other
105
+ // color, `dark` included, so a dark notification with `isLight` keeps the rule
106
+ // above.
107
+ .#{iv.$class-prefix}notification.#{iv.$class-prefix}is-light.#{iv.$class-prefix}is-light:not(
108
+ #{extras-color-classes("light")}
109
+ ) {
110
+ @include cv.register-vars(
111
+ (
112
+ "notification-background-l": #{cv.getVar("light-l")},
113
+ "notification-color-l": #{cv.getVar("light-invert-l")},
114
+ )
115
+ );
116
+ }
@@ -0,0 +1,29 @@
1
+ // Tag Styles
2
+ // Bulma already styles the tag; this gives the light color back its own text
3
+
4
+ @use 'bulma/sass/utilities/initial-variables' as iv;
5
+ @use 'bulma/sass/utilities/css-variables' as cv;
6
+ @use '../color-classes' as *;
7
+
8
+ // Bulma nests a light variant, `&.is-light`, in each color of its tag. For the
9
+ // light color it is `.tag.is-light.is-light`, and a class repeated in a
10
+ // selector matches an element that has it once, so every light tag gets it.
11
+ // It reads the text's lightness from `--bulma-light-light-invert-l`, which
12
+ // Bulma doesn't define, so the text inherits the color around it, which on the
13
+ // dark scheme is light text on the light tag. Its background is already the
14
+ // light color's own.
15
+ //
16
+ // This puts back the text's lightness `.tag.is-light` sets. The `:not()`
17
+ // skips a tag that carries another color, so Bulma's light variant of that
18
+ // color (`is-primary is-light`) keeps its look, and adds a class's weight, so
19
+ // the rule outranks Bulma's whichever stylesheet loads first. Once Bulma fixes
20
+ // its loop, this restates Bulma's value and can go.
21
+ .#{iv.$class-prefix}tag.#{iv.$class-prefix}is-light.#{iv.$class-prefix}is-light:not(
22
+ #{extras-color-classes('light')}
23
+ ) {
24
+ @include cv.register-vars(
25
+ (
26
+ 'tag-color-l': #{cv.getVar('light-invert-l')},
27
+ )
28
+ );
29
+ }