@allxsmith/bestax-bulma 5.59.0 → 5.60.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.
@@ -0,0 +1,74 @@
1
+ // Affix Component Styles
2
+ // A wrapper fixed to a corner of the viewport
3
+
4
+ @use 'bulma/sass/utilities/initial-variables' as iv;
5
+ // Loaded a second time without a namespace, for `$block-spacing` below. It's
6
+ // the same module, so a build's configuration of it reaches both.
7
+ @use 'bulma/sass/utilities/initial-variables' as *;
8
+ @use 'bulma/sass/utilities/css-variables' as cv;
9
+ @use '../variables' as *;
10
+
11
+ // Affix-specific SCSS variables. The offsets start at Bulma's block spacing
12
+ // as a value rather than its variable, which Bulma redefines inside a
13
+ // `.field`, so an Affix written in a Field sits where every other one does.
14
+ $affix-offset-vertical: $block-spacing !default;
15
+ $affix-offset-horizontal: $block-spacing !default;
16
+ // One step under the dropdown layer, so a menu or a popover opened near its
17
+ // corner opens over it, as do the Sidebar, the modals, Tooltip and Toast
18
+ // above that. The page's own stacking (Bulma's addons, Carousel's arrows)
19
+ // sits under it.
20
+ $affix-z-index: $extras-z-index-dropdown - 1 !default;
21
+
22
+ .#{iv.$class-prefix}affix {
23
+ @include cv.register-vars(
24
+ (
25
+ 'affix-offset-vertical': #{$affix-offset-vertical},
26
+ 'affix-offset-horizontal': #{$affix-offset-horizontal},
27
+ 'affix-z-index': #{$affix-z-index},
28
+ )
29
+ );
30
+ }
31
+
32
+ // The corners are physical, as Badge's and Toast's are, so a right corner
33
+ // stays on the right in right-to-left text. Each side adds the device's
34
+ // safe-area inset for that edge, which is 0 unless the page sets
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.
37
+ .#{iv.$class-prefix}affix {
38
+ position: fixed;
39
+ z-index: cv.getVar('affix-z-index');
40
+ // As wide as its content, and never wider than the viewport less the
41
+ // offset and the safe area on both sides.
42
+ max-width: calc(
43
+ 100% - 2 * #{cv.getVar('affix-offset-horizontal')} -
44
+ env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)
45
+ );
46
+
47
+ &.#{iv.$class-prefix}is-top-right,
48
+ &.#{iv.$class-prefix}is-top-left {
49
+ top: calc(
50
+ #{cv.getVar('affix-offset-vertical')} + env(safe-area-inset-top, 0px)
51
+ );
52
+ }
53
+
54
+ &.#{iv.$class-prefix}is-bottom-right,
55
+ &.#{iv.$class-prefix}is-bottom-left {
56
+ bottom: calc(
57
+ #{cv.getVar('affix-offset-vertical')} + env(safe-area-inset-bottom, 0px)
58
+ );
59
+ }
60
+
61
+ &.#{iv.$class-prefix}is-top-right,
62
+ &.#{iv.$class-prefix}is-bottom-right {
63
+ right: calc(
64
+ #{cv.getVar('affix-offset-horizontal')} + env(safe-area-inset-right, 0px)
65
+ );
66
+ }
67
+
68
+ &.#{iv.$class-prefix}is-top-left,
69
+ &.#{iv.$class-prefix}is-bottom-left {
70
+ left: calc(
71
+ #{cv.getVar('affix-offset-horizontal')} + env(safe-area-inset-left, 0px)
72
+ );
73
+ }
74
+ }
@@ -26,3 +26,4 @@
26
26
  @use 'command';
27
27
  @use 'datatable';
28
28
  @use 'pagination';
29
+ @use 'affix';