@allxsmith/bestax-bulma 5.3.0 → 5.4.2

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,121 @@
1
+ // Avatar component styles
2
+ @use 'bulma/sass/utilities/initial-variables' as iv;
3
+ @use 'bulma/sass/utilities/css-variables' as cv;
4
+ @use '../mixins' as *;
5
+
6
+ // Avatar-specific SCSS variables
7
+ $avatar-size: 48px !default;
8
+ $avatar-background: cv.getVar('background') !default;
9
+ $avatar-color: cv.getVar('text') !default;
10
+ $avatar-weight: cv.getVar('weight-semibold') !default;
11
+ $avatar-rounded-radius: cv.getVar('radius-large') !default;
12
+
13
+ .#{iv.$class-prefix}avatar {
14
+ @include cv.register-vars(
15
+ (
16
+ 'avatar-size': #{$avatar-size},
17
+ 'avatar-background': #{$avatar-background},
18
+ 'avatar-color': #{$avatar-color},
19
+ 'avatar-weight': #{$avatar-weight},
20
+ 'avatar-rounded-radius': #{$avatar-rounded-radius},
21
+ )
22
+ );
23
+ }
24
+
25
+ .#{iv.$class-prefix}avatar {
26
+ position: relative;
27
+ display: inline-flex;
28
+ align-items: center;
29
+ justify-content: center;
30
+ overflow: hidden;
31
+ flex-shrink: 0;
32
+ width: cv.getVar('avatar-size');
33
+ height: cv.getVar('avatar-size');
34
+ background-color: cv.getVar('avatar-background');
35
+ color: cv.getVar('avatar-color');
36
+ font-weight: cv.getVar('avatar-weight');
37
+ vertical-align: middle;
38
+ user-select: none;
39
+ margin: 0;
40
+
41
+ img {
42
+ display: block;
43
+ width: 100%;
44
+ height: 100%;
45
+ object-fit: cover;
46
+ }
47
+
48
+ svg {
49
+ display: block;
50
+ }
51
+ }
52
+
53
+ a.#{iv.$class-prefix}avatar,
54
+ button.#{iv.$class-prefix}avatar {
55
+ cursor: pointer;
56
+ border: none;
57
+ padding: 0;
58
+
59
+ &:focus-visible {
60
+ @include extras-focus-outline;
61
+ }
62
+ }
63
+
64
+ .#{iv.$class-prefix}avatar-initials {
65
+ line-height: 1;
66
+ text-transform: uppercase;
67
+ }
68
+
69
+ // Shapes
70
+ .#{iv.$class-prefix}avatar.#{iv.$class-prefix}is-circle {
71
+ border-radius: cv.getVar('radius-rounded');
72
+ }
73
+
74
+ .#{iv.$class-prefix}avatar.#{iv.$class-prefix}is-rounded {
75
+ border-radius: cv.getVar('avatar-rounded-radius');
76
+ }
77
+
78
+ .#{iv.$class-prefix}avatar.#{iv.$class-prefix}is-square {
79
+ border-radius: 0;
80
+ }
81
+
82
+ // Preset sizes (mirrors Bulma's image fixed-size list)
83
+ @each $size in 16, 24, 32, 48, 64, 96, 128 {
84
+ .#{iv.$class-prefix}avatar.#{iv.$class-prefix}is-#{$size}x#{$size} {
85
+ width: #{$size}px;
86
+ height: #{$size}px;
87
+ font-size: calc(#{$size}px / 2.5);
88
+ }
89
+ }
90
+
91
+ // Color variants — background + a contrasting foreground (mirrors Toast's approach).
92
+ @each $name in 'primary', 'link', 'info', 'success', 'warning', 'danger' {
93
+ .#{iv.$class-prefix}avatar.#{iv.$class-prefix}is-#{$name} {
94
+ background-color: cv.getVar($name);
95
+ color: hsl(
96
+ cv.getVar($name, '', '-h'),
97
+ cv.getVar($name, '', '-s'),
98
+ cv.getVar($name, '', '-invert-l')
99
+ );
100
+ }
101
+ }
102
+
103
+ .#{iv.$class-prefix}avatar.#{iv.$class-prefix}is-black {
104
+ background-color: cv.getVar('black');
105
+ color: cv.getVar('white');
106
+ }
107
+
108
+ .#{iv.$class-prefix}avatar.#{iv.$class-prefix}is-dark {
109
+ background-color: cv.getVar('dark');
110
+ color: cv.getVar('light');
111
+ }
112
+
113
+ .#{iv.$class-prefix}avatar.#{iv.$class-prefix}is-light {
114
+ background-color: cv.getVar('light');
115
+ color: cv.getVar('dark');
116
+ }
117
+
118
+ .#{iv.$class-prefix}avatar.#{iv.$class-prefix}is-white {
119
+ background-color: cv.getVar('white');
120
+ color: cv.getVar('black');
121
+ }
@@ -0,0 +1,75 @@
1
+ // Avatars component styles — an overlapping/stacked Avatar group
2
+ @use 'bulma/sass/utilities/initial-variables' as iv;
3
+ @use 'bulma/sass/utilities/css-variables' as cv;
4
+
5
+ // Avatars-specific SCSS variables
6
+ $avatars-ring-color: cv.getVar('scheme-main') !default;
7
+ $avatars-ring-width: 2px !default;
8
+ $avatars-spacing-sm: 0.5rem !default;
9
+ $avatars-spacing-md: 0.75rem !default;
10
+ $avatars-spacing-lg: 1rem !default;
11
+
12
+ .#{iv.$class-prefix}avatars {
13
+ @include cv.register-vars(
14
+ (
15
+ 'avatars-ring-color': #{$avatars-ring-color},
16
+ 'avatars-ring-width': #{$avatars-ring-width},
17
+ 'avatars-spacing': #{$avatars-spacing-md},
18
+ )
19
+ );
20
+ }
21
+
22
+ // Re-register the single spacing var per preset. A numeric `spacing` prop sets
23
+ // --bulma-avatars-spacing inline instead (mirrors Sidebar's inline width var).
24
+ .#{iv.$class-prefix}avatars.#{iv.$class-prefix}is-spacing-sm {
25
+ @include cv.register-vars(
26
+ (
27
+ 'avatars-spacing': #{$avatars-spacing-sm},
28
+ )
29
+ );
30
+ }
31
+
32
+ .#{iv.$class-prefix}avatars.#{iv.$class-prefix}is-spacing-lg {
33
+ @include cv.register-vars(
34
+ (
35
+ 'avatars-spacing': #{$avatars-spacing-lg},
36
+ )
37
+ );
38
+ }
39
+
40
+ .#{iv.$class-prefix}avatars {
41
+ display: inline-flex;
42
+ align-items: center;
43
+
44
+ .#{iv.$class-prefix}avatar {
45
+ box-shadow: 0 0 0 cv.getVar('avatars-ring-width')
46
+ cv.getVar('avatars-ring-color');
47
+
48
+ &:not(:first-child) {
49
+ // Logical property so the stack overlaps toward the reading direction
50
+ // (a physical margin-left pulls avatars apart under dir="rtl").
51
+ margin-inline-start: calc(-1 * #{cv.getVar('avatars-spacing')});
52
+ }
53
+ }
54
+
55
+ // Non-overlapping: a positive gap of the same spacing var instead of a
56
+ // negative margin, and no ring (there is nothing to separate from).
57
+ &.#{iv.$class-prefix}is-spaced {
58
+ gap: cv.getVar('avatars-spacing');
59
+
60
+ .#{iv.$class-prefix}avatar {
61
+ box-shadow: none;
62
+
63
+ &:not(:first-child) {
64
+ margin-inline-start: 0;
65
+ }
66
+ }
67
+ }
68
+
69
+ // The "+N" surplus avatar uses scheme-aware tokens so it flips in dark mode
70
+ // (a fixed light color would stay pale on a dark scheme).
71
+ .#{iv.$class-prefix}avatar.#{iv.$class-prefix}is-surplus {
72
+ background-color: cv.getVar('background');
73
+ color: cv.getVar('text');
74
+ }
75
+ }
@@ -0,0 +1,194 @@
1
+ // Badge component styles — a small status/count indicator overlaid on a corner
2
+ @use 'bulma/sass/utilities/initial-variables' as iv;
3
+ @use 'bulma/sass/utilities/css-variables' as cv;
4
+
5
+ // Badge-specific SCSS variables
6
+ $badge-height: 1.25em !default;
7
+ $badge-min-width: 1.25em !default;
8
+ $badge-padding: 0 0.4em !default;
9
+ $badge-font-size: 0.7rem !default;
10
+ $badge-radius: cv.getVar('radius-rounded') !default;
11
+ $badge-ring-color: cv.getVar('scheme-main') !default;
12
+ $badge-ring-width: 2px !default;
13
+ $badge-dot-size: 0.65em !default;
14
+ $badge-inset-circle: 12% !default;
15
+ $badge-animation-duration: 1.4s !default;
16
+
17
+ .#{iv.$class-prefix}badge-wrapper {
18
+ position: relative;
19
+ display: inline-flex;
20
+ }
21
+
22
+ .#{iv.$class-prefix}badge {
23
+ @include cv.register-vars(
24
+ (
25
+ 'badge-height': #{$badge-height},
26
+ 'badge-min-width': #{$badge-min-width},
27
+ 'badge-padding': #{$badge-padding},
28
+ 'badge-font-size': #{$badge-font-size},
29
+ 'badge-radius': #{$badge-radius},
30
+ 'badge-ring-color': #{$badge-ring-color},
31
+ 'badge-ring-width': #{$badge-ring-width},
32
+ 'badge-dot-size': #{$badge-dot-size},
33
+ 'badge-inset-circle': #{$badge-inset-circle},
34
+ 'badge-animation-duration': #{$badge-animation-duration},
35
+ )
36
+ );
37
+ }
38
+
39
+ .#{iv.$class-prefix}badge {
40
+ position: absolute;
41
+ z-index: 1;
42
+ display: inline-flex;
43
+ align-items: center;
44
+ justify-content: center;
45
+ box-sizing: border-box;
46
+ height: cv.getVar('badge-height');
47
+ min-width: cv.getVar('badge-min-width');
48
+ padding: cv.getVar('badge-padding');
49
+ border-radius: cv.getVar('badge-radius');
50
+ box-shadow: 0 0 0 cv.getVar('badge-ring-width') cv.getVar('badge-ring-color');
51
+ font-size: cv.getVar('badge-font-size');
52
+ line-height: 1;
53
+ white-space: nowrap;
54
+ pointer-events: none;
55
+
56
+ &.#{iv.$class-prefix}is-dot {
57
+ height: cv.getVar('badge-dot-size');
58
+ min-width: cv.getVar('badge-dot-size');
59
+ padding: 0;
60
+ }
61
+
62
+ &.#{iv.$class-prefix}is-invisible {
63
+ visibility: hidden;
64
+ }
65
+ }
66
+
67
+ // Corner positions (relative to the .badge-wrapper, unless is-standalone)
68
+ .#{iv.$class-prefix}badge.#{iv.$class-prefix}is-top-right {
69
+ top: 0;
70
+ right: 0;
71
+ transform: translate(50%, -50%);
72
+ }
73
+
74
+ .#{iv.$class-prefix}badge.#{iv.$class-prefix}is-top-left {
75
+ top: 0;
76
+ left: 0;
77
+ transform: translate(-50%, -50%);
78
+ }
79
+
80
+ .#{iv.$class-prefix}badge.#{iv.$class-prefix}is-bottom-right {
81
+ bottom: 0;
82
+ right: 0;
83
+ transform: translate(50%, 50%);
84
+ }
85
+
86
+ .#{iv.$class-prefix}badge.#{iv.$class-prefix}is-bottom-left {
87
+ bottom: 0;
88
+ left: 0;
89
+ transform: translate(-50%, 50%);
90
+ }
91
+
92
+ // Standalone (no children) badges no longer emit an is-{position} class, but
93
+ // keep this reset as belt-and-braces so a standalone badge always sits inline
94
+ // in normal flow regardless of any position/overlap class a caller adds.
95
+ // - position: relative (not static) so the pill is the positioned ancestor
96
+ // .is-pulse::after resolves against, instead of the halo escaping to cover
97
+ // whatever positioned container the badge sits in.
98
+ // - pointer-events: auto overrides the base .badge reset (needed for the
99
+ // anchored overlay so clicks pass through to the child) because in
100
+ // standalone mode the pill itself is the interactive root.
101
+ .#{iv.$class-prefix}badge.#{iv.$class-prefix}is-standalone {
102
+ position: relative;
103
+ display: inline-flex;
104
+ transform: none;
105
+ pointer-events: auto;
106
+ }
107
+
108
+ // Overlap adjustment — nudge the badge further in on a round child so it
109
+ // doesn't float off the visible edge.
110
+ .#{iv.$class-prefix}badge.#{iv.$class-prefix}is-overlap-circle.#{iv.$class-prefix}is-top-right {
111
+ top: cv.getVar('badge-inset-circle');
112
+ right: cv.getVar('badge-inset-circle');
113
+ }
114
+
115
+ .#{iv.$class-prefix}badge.#{iv.$class-prefix}is-overlap-circle.#{iv.$class-prefix}is-top-left {
116
+ top: cv.getVar('badge-inset-circle');
117
+ left: cv.getVar('badge-inset-circle');
118
+ }
119
+
120
+ .#{iv.$class-prefix}badge.#{iv.$class-prefix}is-overlap-circle.#{iv.$class-prefix}is-bottom-right {
121
+ bottom: cv.getVar('badge-inset-circle');
122
+ right: cv.getVar('badge-inset-circle');
123
+ }
124
+
125
+ .#{iv.$class-prefix}badge.#{iv.$class-prefix}is-overlap-circle.#{iv.$class-prefix}is-bottom-left {
126
+ bottom: cv.getVar('badge-inset-circle');
127
+ left: cv.getVar('badge-inset-circle');
128
+ }
129
+
130
+ // Color variants — background + a contrasting foreground (mirrors Toast/Avatar).
131
+ @each $name in 'primary', 'link', 'info', 'success', 'warning', 'danger' {
132
+ .#{iv.$class-prefix}badge.#{iv.$class-prefix}is-#{$name} {
133
+ background-color: cv.getVar($name);
134
+ color: hsl(
135
+ cv.getVar($name, '', '-h'),
136
+ cv.getVar($name, '', '-s'),
137
+ cv.getVar($name, '', '-invert-l')
138
+ );
139
+ }
140
+ }
141
+
142
+ .#{iv.$class-prefix}badge.#{iv.$class-prefix}is-black {
143
+ background-color: cv.getVar('black');
144
+ color: cv.getVar('white');
145
+ }
146
+
147
+ .#{iv.$class-prefix}badge.#{iv.$class-prefix}is-dark {
148
+ background-color: cv.getVar('dark');
149
+ color: cv.getVar('light');
150
+ }
151
+
152
+ .#{iv.$class-prefix}badge.#{iv.$class-prefix}is-light {
153
+ background-color: cv.getVar('light');
154
+ color: cv.getVar('dark');
155
+ }
156
+
157
+ .#{iv.$class-prefix}badge.#{iv.$class-prefix}is-white {
158
+ background-color: cv.getVar('white');
159
+ color: cv.getVar('black');
160
+ }
161
+
162
+ // Pulse animation for "processing" badges.
163
+ .#{iv.$class-prefix}badge.#{iv.$class-prefix}is-pulse::after {
164
+ content: '';
165
+ position: absolute;
166
+ inset: 0;
167
+
168
+ // Decorative halo only — never intercept clicks. pointer-events is inherited,
169
+ // so without this the halo picks up the standalone pill's `auto` and its
170
+ // 1.75×-scaled box (opacity 0 still hit-tests) swallows adjacent clicks.
171
+ pointer-events: none;
172
+ border-radius: inherit;
173
+ background-color: inherit;
174
+ animation: extras-badge-pulse cv.getVar('badge-animation-duration')
175
+ cubic-bezier(0, 0, 0.2, 1) infinite;
176
+ }
177
+
178
+ @keyframes extras-badge-pulse {
179
+ 0% {
180
+ opacity: 0.6;
181
+ transform: scale(1);
182
+ }
183
+ 100% {
184
+ opacity: 0;
185
+ transform: scale(1.75);
186
+ }
187
+ }
188
+
189
+ @media (prefers-reduced-motion: reduce) {
190
+ .#{iv.$class-prefix}badge.#{iv.$class-prefix}is-pulse::after {
191
+ animation: none;
192
+ display: none;
193
+ }
194
+ }
@@ -12,3 +12,6 @@
12
12
  @use 'carousel';
13
13
  @use 'tabs';
14
14
  @use 'reveal';
15
+ @use 'avatar';
16
+ @use 'avatars';
17
+ @use 'badge';