@stackoverflow/stacks 3.0.0-beta.0 → 3.0.0-beta.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.
Files changed (47) hide show
  1. package/dist/css/stacks.css +1579 -1510
  2. package/dist/css/stacks.min.css +1 -1
  3. package/dist/js/stacks.js +0 -14
  4. package/dist/js/stacks.min.js +1 -1
  5. package/lib/atomic/border.less +2 -20
  6. package/lib/atomic/misc.less +1 -1
  7. package/lib/atomic/typography.less +13 -26
  8. package/lib/base/body.less +2 -7
  9. package/lib/components/activity-indicator/activity-indicator.less +17 -29
  10. package/lib/components/anchor/anchor.less +1 -1
  11. package/lib/components/avatar/avatar.less +9 -11
  12. package/lib/components/badge/badge.less +156 -177
  13. package/lib/components/bling/bling.less +130 -0
  14. package/lib/components/block-link/block-link.less +1 -1
  15. package/lib/components/button/button.less +222 -374
  16. package/lib/components/button-group/button-group.less +1 -1
  17. package/lib/components/card/card.less +1 -1
  18. package/lib/components/checkbox_radio/checkbox_radio.less +13 -11
  19. package/lib/components/input-icon/input-icon.less +3 -3
  20. package/lib/components/input_textarea/input_textarea.less +70 -58
  21. package/lib/components/link/link.less +1 -1
  22. package/lib/components/link-preview/link-preview.less +6 -6
  23. package/lib/components/menu/menu.less +100 -21
  24. package/lib/components/modal/modal.less +11 -11
  25. package/lib/components/navigation/navigation.less +61 -37
  26. package/lib/components/notice/notice.less +1 -1
  27. package/lib/components/pagination/pagination.less +44 -43
  28. package/lib/components/popover/popover.less +3 -103
  29. package/lib/components/popover/popover.ts +0 -6
  30. package/lib/components/popover/tooltip.ts +0 -12
  31. package/lib/components/post-summary/post-summary.less +4 -3
  32. package/lib/components/progress-bar/progress-bar.less +13 -12
  33. package/lib/components/prose/prose.less +2 -2
  34. package/lib/components/select/select.less +26 -37
  35. package/lib/components/skeleton/skeleton.less +1 -1
  36. package/lib/components/tag/tag.less +59 -70
  37. package/lib/components/toggle-switch/toggle-switch.less +4 -2
  38. package/lib/components/topbar/topbar.less +3 -3
  39. package/lib/components/uploader/uploader.less +3 -3
  40. package/lib/exports/color-mixins.less +13 -3
  41. package/lib/exports/color-sets.less +256 -216
  42. package/lib/exports/constants-helpers.less +5 -3
  43. package/lib/exports/constants-type.less +25 -25
  44. package/lib/exports/mixins.less +2 -2
  45. package/lib/stacks-static.less +1 -1
  46. package/package.json +1 -1
  47. package/lib/components/award-bling/award-bling.less +0 -31
@@ -37,36 +37,22 @@ p {
37
37
  .fs-body3 { font-size: var(--fs-body3) !important; }
38
38
  .fs-body2 { font-size: var(--fs-body2) !important; }
39
39
  .fs-body1 { font-size: var(--fs-body1) !important; }
40
-
41
- .fs-caption,
42
- .fs-category { font-size: var(--fs-caption) !important; }
40
+ .fs-caption { font-size: var(--fs-caption) !important; }
43
41
  .fs-fine { font-size: var(--fs-fine) !important; }
44
42
 
45
43
  #stacks-internals #screen-sm({
46
- .fs-display4 { font-size: 3.8rem !important; }
47
- .fs-display3 { font-size: 3.3rem !important; }
48
- .fs-display2 { font-size: 3rem !important; }
49
- .fs-display1 { font-size: 2.6rem !important; }
50
- .fs-headline2 { font-size: 2.3rem !important; }
51
- .fs-headline1 { font-size: 2rem !important; }
52
- .fs-title { font-size: 1.8rem !important; }
53
- .fs-subheading { font-size: 1.6rem !important; }
54
- .fs-body3 { font-size: 1.4rem !important; }
55
- .fs-body2 { font-size: 1.3rem !important; }
44
+ .fs-display4 { font-size: calc(var(--fs-display4) * .43) !important; } // 43px
45
+ .fs-display3 { font-size: calc(var(--fs-display3) * .5139) !important; } // ~37px
46
+ .fs-display2 { font-size: calc(var(--fs-display2) * .5862) !important; } // ~34px
47
+ .fs-display1 { font-size: calc(var(--fs-display1) * .6304) !important; } // ~29px
48
+ .fs-headline2 { font-size: calc(var(--fs-headline2) * .7224) !important; } // ~26px
49
+ .fs-headline1 { font-size: calc(var(--fs-headline1) * .8215) !important; } // ~23px
50
+ .fs-title { font-size: calc(var(--fs-title) * .9094) !important; } // ~20px
51
+ .fs-subheading { font-size: calc(var(--fs-subheading) * .8998) !important; } // ~18px
52
+ .fs-body3 { font-size: calc(var(--fs-body3) * .8888) !important; } // ~16px
53
+ .fs-body2 { font-size: calc(var(--fs-body2) * .9374) !important; } // ~15px
56
54
  }, @force-selector: true);
57
55
 
58
- .fs-category {
59
- font-weight: 700;
60
- text-transform: uppercase;
61
-
62
- // If a top border is desired
63
- &.has-border {
64
- width: 100%;
65
- padding: var(--su4) 0;
66
- border-top: var(--su-static1) solid var(--bc-medium);
67
- }
68
- }
69
-
70
56
  // ============================================================================
71
57
  // $ LINE HEIGHTS
72
58
  // ----------------------------------------------------------------------------
@@ -89,7 +75,8 @@ p {
89
75
 
90
76
  // -- Font Weight
91
77
  .fw-normal { font-weight: 400 !important; }
92
- .fw-bold { font-weight: 700 !important; }
78
+ .fw-medium { font-weight: 500 !important; }
79
+ .fw-bold { font-weight: 600 !important; }
93
80
 
94
81
  // -- Font Styles
95
82
  .fs-normal { font-style: normal !important; }
@@ -24,13 +24,6 @@ body {
24
24
  line-height: var(--lh-base);
25
25
  }
26
26
 
27
- #stacks-internals #screen-sm({
28
- &,
29
- body {
30
- font-size: 11px;
31
- }
32
- }, @force-selector: true);
33
-
34
27
  body {
35
28
  box-sizing: border-box;
36
29
  min-height: 100%;
@@ -41,4 +34,6 @@ body {
41
34
  *:after {
42
35
  box-sizing: inherit;
43
36
  }
37
+
38
+ // TODO SHINE set max width here
44
39
  }
@@ -1,53 +1,41 @@
1
1
  .s-activity-indicator {
2
- --_ai-translucent: var(--translucent-secondary);
3
- --_ai-bg: var(--theme-secondary-400);
2
+ --_ai-bg: var(--pink-400);
4
3
  --_ai-fc: var(--white);
5
-
6
- .highcontrast-mode({
7
- --_ai-bg: var(--theme-secondary-500);
8
- });
4
+ --_ai-min-size: var(--su-static16);
5
+ --_ai-p: 0 calc(var(--su-static4) - var(--su-static1));
9
6
 
10
7
  // VARIANTS
11
8
  &&__danger {
12
9
  --_ai-bg: var(--red-400);
13
- --_ai-translucent: var(--translucent-error);
14
-
15
- .highcontrast-mode({
16
- --_ai-bg: var(--red-500);
17
- });
18
10
  }
19
11
 
20
12
  &&__success {
21
13
  --_ai-bg: var(--green-400);
22
- --_ai-translucent: var(--translucent-success);
23
14
 
24
- .highcontrast-mode({
25
- --_ai-bg: var(--green-500);
26
- });
27
15
  }
28
16
 
29
17
  &&__warning {
30
18
  --_ai-bg: var(--yellow-400);
31
- --_ai-fc: var(--_black-static);
32
- --_ai-translucent: var(--translucent-warning);
19
+ }
33
20
 
34
- .highcontrast-mode({
35
- --_ai-bg: var(--yellow-500); // needs to be here to override default high contrast
36
- --_ai-fc: var(--white);
37
- });
21
+ &&__sm {
22
+ --_ai-min-size: calc(var(--su-static8) + var(--su-static2));
23
+ --_ai-p: 0;
38
24
  }
39
25
 
40
26
  background-color: var(--_ai-bg);
41
- box-shadow: 0 0 0 var(--su-static4) var(--_ai-translucent);
42
27
  color: var(--_ai-fc);
28
+ min-width: var(--_ai-min-size);
29
+ min-height: var(--_ai-min-size);
30
+ padding: var(--_ai-p);
43
31
 
44
- border-radius: 1000px;
45
- display: inline-block;
32
+ border-radius: var(--br-pill);
33
+ display: inline-flex;
46
34
  font-size: var(--fs-fine);
47
- font-weight: 700;
48
- line-height: 1.1; // Custom line-height to satisfy 1x screens
49
- min-width: var(--su-static12);
50
- min-height: var(--su-static12);
51
- padding: var(--su2) var(--su4);
35
+ font-weight: 600;
36
+ line-height: 1.1;
37
+ text-align: center;
38
+ align-items: center;
39
+ justify-content: center;
52
40
  text-transform: uppercase;
53
41
  }
@@ -28,7 +28,7 @@
28
28
  }
29
29
 
30
30
  &&__default {
31
- --_an-a-fc: var(--theme-link-color, var(--theme-secondary-400));
31
+ --_an-a-fc: var(--theme-link-color, var(--theme-secondary));
32
32
  --_an-a-fc-hover: var(--theme-link-color-hover, var(--theme-secondary-500));
33
33
  --_an-a-fc-visited: var(--theme-link-color-visited, var(--purple-500));
34
34
  --_an-a-fc-hover-visited: var(--theme-link-color-hover, var(--purple-600));
@@ -1,7 +1,6 @@
1
1
  .s-avatar {
2
2
  --_av-size: var(--su-static16);
3
3
  --_av-bg: var(--_white-static); // Force a white background color for when we have transparent avatars
4
- --_av-br: var(--br-sm);
5
4
  --_av-fs-letter: calc(var(--su-static12) - var(--su-static1));
6
5
  --_av-scale-badge: 1;
7
6
 
@@ -18,14 +17,8 @@
18
17
 
19
18
  // MODIFIERS
20
19
  // Sizes
21
- &&__32,
22
- &&__48 {
23
- --_av-br: var(--br-md);
24
- }
25
-
26
20
  &&__96,
27
21
  &&__128 {
28
- --_av-br: calc(var(--br-lg) + var(--br-sm));
29
22
  --_av-scale-badge: 3;
30
23
  }
31
24
 
@@ -49,7 +42,6 @@
49
42
 
50
43
  &&__64 {
51
44
  --_av-size: var(--su-static64);
52
- --_av-br: var(--br-lg);
53
45
  --_av-fs-letter: calc(var(--su-static48) - var(--su-static4));
54
46
  --_av-scale-badge: 2.4;
55
47
  }
@@ -74,7 +66,6 @@
74
66
  }
75
67
 
76
68
  & &--image {
77
- border-radius: var(--_av-br);
78
69
  display: block;
79
70
  height: var(--_av-size);
80
71
  width: var(--_av-size);
@@ -95,8 +86,15 @@
95
86
  user-select: none;
96
87
  }
97
88
 
98
- background-color: var(--_av-bg);
99
- border-radius: var(--_av-br);
89
+ & &--indicator {
90
+ box-shadow: 0 0 0 var(--su-static2) var(--white);
91
+ bottom: 100%;
92
+ left: 100%;
93
+ position: absolute;
94
+ transform: translate(-50%, 60%);
95
+ }
96
+
97
+ background-color: var(--_av-bg);
100
98
  height: var(--_av-size);
101
99
  width: var(--_av-size);
102
100
 
@@ -1,164 +1,109 @@
1
1
  .s-badge {
2
2
  --_ba-as: unset;
3
- --_ba-bc: var(--bc-medium);
4
- --_ba-bg: var(--black-150);
3
+ --_ba-bc: transparent;
4
+ --_ba-bg: var(--black-100);
5
5
  --_ba-fc: var(--black-500);
6
- --_ba-fs: var(--fs-caption);
7
- --_ba-fw: normal;
8
- --_ba-g: 0.3em;
9
- --_ba-lh: 2;
6
+ --_ba-fs: var(--fs-caption); //13px
10
7
  --_ba-px: var(--su6);
11
- --_ba-py: 0;
8
+ --_ba-py: var(--su4);
12
9
  --_ba-tt: unset;
13
10
  --_ba-wmn: 0;
14
-
15
- // CONTEXTUAL STYLES
16
- .highcontrast-mode({
17
- // Badge counts
18
- &__gold,
19
- &__silver,
20
- &__bronze,
21
- // Number counts
22
- &__rep,
23
- &__rep-down,
24
- &__votes:not(.s-badge__answered),
25
- // Users
26
- &__admin,
27
- &__moderator,
28
- &__staff {
29
- --_ba-bc: currentColor;
30
- }
31
-
32
- &__new {
33
- --_ba-fc: var(--purple-600);
34
- }
35
- });
36
-
37
- // MODIFIERS
38
- // Sizes
39
- &&__xs,
11
+ --_ba-bl: 0;
12
+ --_ba-fw: unset;
13
+ --_ba-sq-bg: var(--black-200);
14
+ --_ba-bx-sh-w: var(--su2);
15
+ --_ba-gap: unset;
16
+ --_ba-bx-sh-inset: ~"";
17
+
18
+ // SIZES
40
19
  &&__sm {
41
- --_ba-as: flex-start;
42
- --_ba-fs: var(--fs-fine);
43
- }
44
-
45
- &&__xs {
46
- --_ba-lh: 1.5;
47
- --_ba-px: var(--su2);
48
20
  --_ba-wmn: calc(var(--su-static16) + var(--su-static2));
49
- }
50
-
51
- &&__sm {
52
- --_ba-lh: 1.8;
21
+ --_ba-as: flex-start;
22
+ --_ba-fs: var(--fs-fine); //12px
53
23
  --_ba-px: var(--su4);
54
- --_ba-wmn: calc(var(--su-static16) + var(--su-static2));
55
- }
56
-
57
- // Badge counts
58
- &&__gold,
59
- &&__silver,
60
- &&__bronze {
61
- --_ba-fc: var(--black-500);
62
- }
63
-
64
- &&__gold {
65
- --_ba-bc: var(--gold-300);
66
- --_ba-bg: var(--gold-100);
24
+ --_ba-py: var(--su1);
25
+ --_ba-bx-sh-w: 0px;
26
+ --_ba-bx-sh-inset: inset;
67
27
  }
68
28
 
69
- &&__silver {
70
- --_ba-bc: var(--silver-300);
71
- --_ba-bg: var(--silver-100);
29
+ &&__lg {
30
+ --_ba-fs: var(--fs-body1); //14px
31
+ --_ba-px: var(--su8);
32
+ --_ba-py: calc(var(--su4) + var(--su1)); //5px
33
+ --_ba-bx-sh-w: var(--su4);
72
34
  }
73
35
 
74
- &&__bronze {
75
- --_ba-bc: var(--bronze-300);
76
- --_ba-bg: var(--bronze-100);
36
+ // We need negative margin to make up for the positive badge padding
37
+ & .s-bling__filled {
38
+ margin: calc(var(--_ba-py) * -1) 0 calc(var(--_ba-py) * -1) calc(var(--_ba-px) * -1);
77
39
  }
78
-
79
- // Number counts
80
- &&__answered,
81
- &&__bounty,
82
- &&__important {
83
- --_ba-bc: transparent;
84
- --_ba-fc: var(--white);
40
+ & svg {
41
+ margin: calc(var(--_ba-py) * -1) 0 calc(var(--_ba-py) * -1) calc(var(--su4) * -1);
85
42
  }
86
43
 
87
- &&__rep,
88
- &&__rep-down,
89
- &&__votes:not(&__answered) {
90
- --_ba-bg: var(--white);
44
+ &:has(.s-bling__rep) {
45
+ --_ba-fw: 600;
46
+ --_ba-fc: var(--black-600);
91
47
  }
92
-
93
- &&__answered {
94
- --_ba-bg: var(--green-400);
48
+ &:has(.s-bling) {
49
+ --_ba-bg: var(--black-150);
95
50
  }
96
51
 
97
- &&__bounty {
98
- --_ba-bg: var(--blue-400);
99
- }
52
+ // TAG
53
+ &&__gold,
54
+ &&__silver,
55
+ &&__bronze {
56
+ --_ba-bl: var(--su4);
100
57
 
101
- &&__important {
102
- --_ba-bg: var(--red-400);
58
+ & .s-bling__gold,
59
+ & .s-bling__silver,
60
+ & .s-bling__bronze {
61
+ margin-left: -2px;
62
+ }
103
63
  }
104
64
 
105
- &&__rep {
106
- --_ba-bc: var(--green-300);
107
- --_ba-fc: var(--green-400);
65
+ &&__gold {
66
+ --_ba-bc: var(--yellow-300);
108
67
  }
109
-
110
- &&__rep-down {
111
- --_ba-bc: var(--red-300);
112
- --_ba-fc: var(--red-400);
68
+ &&__silver {
69
+ --_ba-bc: var(--blue-300);
113
70
  }
114
-
115
- &&__votes:not(&__answered) {
116
- --_ba-bc: var(--black-250);
117
- --_ba-fc: var(--black-500);
71
+ &&__bronze {
72
+ --_ba-bc: var(--orange-300);
118
73
  }
119
74
 
120
- // Users
121
- &&__admin {
122
- --_ba-bc: var(--theme-primary-200);
123
- --_ba-bg: var(--theme-primary-100);
124
- --_ba-fc: var(--theme-primary-500);
75
+ // USER
76
+ &&__admin,
77
+ &&__moderator,
78
+ &&__staff,
79
+ &&__ai,
80
+ &&__bot {
81
+ --_ba-bl: var(--su4);
82
+ --_ba-bg: var(--black-150);
83
+ --_ba-fc: var(--black-600);
125
84
  }
126
85
 
127
86
  &&__moderator {
128
- --_ba-bc: var(--theme-secondary-300);
129
- --_ba-bg: var(--theme-secondary-200);
130
- --_ba-fc: var(--theme-secondary-600);
131
- --_ba-g: calc(var(--su-static4) - var(--su-static1)); // 3px
132
87
  // :before icon
133
- --_ba-before-h: calc(var(--su-static16) - var(--su-static2)); // 14px
134
- --_ba-before-icon: url("data:image/svg+xml;,%3Csvg width='12' height='14' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5.528.746c.257-.329.675-.327.93 0l4.42 5.66c.258.329.257.864 0 1.192l-4.42 5.66c-.256.328-.674.327-.93 0l-4.42-5.66c-.257-.329-.256-.865 0-1.192l4.42-5.66z' fill='%23fff'/%3E%3C/svg%3E");
135
- --_ba-before-mt: calc(var(--su-static1) * -1); // -1px
136
- --_ba-before-w: var(--su-static12);
137
-
138
- // Sizes
139
- &.s-badge__xs {
140
- --_ba-before-h: calc(var(--su-static8) + var(--su-static1)); // 9px
141
- --_ba-before-icon: url("data:image/svg+xml;,%3Csvg width='7' height='9' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 .246c.3-.329.701-.327 1 0L6.776 4c.3.329.298.672 0 1L4 8.75c-.299.329-.702.327-1 0L.224 5c-.284-.324-.285-.675 0-1L3 .246z' fill='%23fff'/%3E%3C/svg%3E");
142
- --_ba-before-mt: 0;
143
- --_ba-before-w: calc(var(--su-static8) - var(--su-static1)); // 7px
144
- }
88
+ --_ba-bc: var(--blue-500);
89
+ --_ba-before-h: calc(var(--su12) + var(--su1)); // 13px
90
+ --_ba-before-w: calc(var(--su12) - var(--su1)); // 11px
91
+ --_ba-before-icon: url("data:image/svg+xml;,%3Csvg width='11' height='13' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5.528.746c.257-.329.675-.327.93 0l4.42 5.66c.258.329.257.864 0 1.192l-4.42 5.66c-.256.328-.674.327-.93 0l-4.42-5.66c-.257-.329-.256-.865 0-1.192l4.42-5.66z' fill='%23fff'/%3E%3C/svg%3E");
145
92
 
146
93
  &.s-badge__sm {
147
- --_ba-g: var(--su-static2);
148
- --_ba-before-h: calc(var(--su-static12) - var(--su-static1)); // 11px
94
+ --_ba-before-h: calc(var(--su12) - var(--su1)); // 11px
95
+ --_ba-before-w: calc(var(--su8) + var(--su1)); // 9px
149
96
  --_ba-before-icon: url("data:image/svg+xml;,%3Csvg width='9' height='11' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3.55.246c.257-.329.647-.327.903 0l3.36 4.66c.256.329.256.864 0 1.192L4.45 10.75c-.257.329-.644.327-.9 0L.192 6.098c-.256-.329-.256-.865 0-1.192L3.55.246z' fill='%23fff'/%3E%3C/svg%3E");
150
- --_ba-before-mt: 0;
151
- --_ba-before-w: calc(var(--su-static8) + var(--su-static1)); // 9px
152
97
  }
153
98
 
154
99
  &:before {
155
100
  height: var(--_ba-before-h);
156
- margin-top: var(--_ba-before-mt);
101
+ margin-top: calc(var(--su1) * -1);
157
102
  width: var(--_ba-before-w);
158
103
 
159
104
  content: "";
160
105
  display: inline-block;
161
- background-color: currentColor;
106
+ background-color: var(--_ba-bc);
162
107
  -webkit-mask: var(--_ba-before-icon) no-repeat center;
163
108
  mask: var(--_ba-before-icon) no-repeat center;
164
109
  -webkit-mask-size: contain;
@@ -167,79 +112,114 @@
167
112
  }
168
113
 
169
114
  &&__staff {
170
- // Staff badges are always "Stack Overflow Orange"
171
- --_ba-bc: var(--orange-300);
172
- --_ba-bg: var(--orange-200);
173
- --_ba-fc: var(--orange-600);
115
+ // Staff should always be "StackOverflow orange"
116
+ --_ba-bc: var(--orange-400);
117
+ }
118
+ &&__admin {
119
+ // Only the admin badge is themeable
120
+ --_ba-bc: var(--theme-primary-500, var(--orange-500));
174
121
  }
175
-
176
- // VARIANTS
177
122
  &&__ai {
178
- --_ba-bc: var(--_ba-fc);
179
- --_ba-bg: var(--black-050);
180
- --_ba-fc: var(--orange-500);
181
- --_ba-tt: uppercase;
123
+ --_ba-bc: var(--purple-400);
182
124
  }
183
-
184
125
  &&__bot {
185
- --_ba-bc: var(--black-300);
126
+ --_ba-bc: var(--black-400);
186
127
  }
187
128
 
188
- &&__danger,
189
- &&__muted {
190
- &.s-badge__filled {
191
- --_ba-bc: transparent;
129
+ // STATES
130
+ &&__info {
131
+ --_ba-bg: var(--blue-100);
132
+ --_ba-fc: var(--blue-500);
133
+ --_ba-sq-bg: var(--blue-200);
134
+ &.s-badge__important {
135
+ --_ba-bg: var(--blue-400);
136
+ --_ba-sq-bg: var(--blue-500);
137
+ }
138
+ }
139
+ &&__warning {
140
+ --_ba-bg: var(--yellow-100);
141
+ --_ba-fc: var(--yellow-500);
142
+ --_ba-sq-bg: var(--yellow-200);
143
+ &.s-badge__important {
144
+ --_ba-bg: var(--yellow-400);
145
+ --_ba-sq-bg: var(--yellow-500);
192
146
  }
193
147
  }
194
-
195
148
  &&__danger {
196
- --_ba-bc: var(--red-300);
149
+ --_ba-bg: var(--red-100);
150
+ --_ba-fc: var(--red-500);
151
+ --_ba-sq-bg: var(--red-200);
152
+ &.s-badge__important {
153
+ --_ba-bg: var(--red-400);
154
+ --_ba-sq-bg: var(--red-500);
155
+ }
156
+ }
157
+ &&__critical {
197
158
  --_ba-bg: var(--red-200);
198
159
  --_ba-fc: var(--red-600);
199
-
200
- &.s-badge__filled {
201
- --_ba-bg: var(--red-400);
202
- --_ba-fc: var(--white);
160
+ --_ba-sq-bg: var(--red-300);
161
+ &.s-badge__important {
162
+ --_ba-bg: var(--red-500);
163
+ --_ba-sq-bg: var(--red-600);
203
164
  }
204
165
  }
205
- &&__info {
206
- --_ba-bc: var(--blue-300);
207
- --_ba-bg: var(--blue-200);
208
- --_ba-fc: var(--blue-600);
166
+ &&__tonal {
167
+ --_ba-bg: var(--black-200);
168
+ --_ba-fc: var(--black-600);
169
+ --_ba-sq-bg: var(--black-300);
170
+ &.s-badge__important {
171
+ --_ba-bg: var(--black-500);
172
+ --_ba-sq-bg: var(--black-600);
173
+ }
209
174
  }
210
-
211
- &&__warning {
212
- --_ba-bc: var(--yellow-300);
213
- --_ba-bg: var(--yellow-200);
214
- --_ba-fc: var(--yellow-600);
175
+ &&__success {
176
+ --_ba-bg: var(--green-100);
177
+ --_ba-fc: var(--green-600);
178
+ --_ba-sq-bg: var(--green-200);
179
+ &.s-badge__important {
180
+ --_ba-bg: var(--green-500);
181
+ --_ba-sq-bg: var(--green-600);
182
+ }
183
+ }
184
+ &&__featured {
185
+ --_ba-bg: var(--purple-100);
186
+ --_ba-fc: var(--purple-500);
187
+ --_ba-sq-bg: var(--purple-200);
188
+ &.s-badge__important {
189
+ --_ba-bg: var(--purple-400);
190
+ --_ba-sq-bg: var(--purple-500);
191
+ }
215
192
  }
216
193
 
217
- &&__muted {
218
- --_ba-bc: var(--black-300);
219
- --_ba-bg: var(--black-200);
220
- --_ba-fc: var(--black-500);
221
-
222
- &.s-badge__filled {
223
- --_ba-bg: var(--black-500);
224
- --_ba-fc: var(--white);
194
+ // SQUARED
195
+ &&__squared {
196
+ --_ba_box-shadow: 0 0 0 var(--_ba-bx-sh-w) var(--_ba-sq-bg);
197
+ svg {
198
+ background-color: var(--_ba-sq-bg);
199
+ box-shadow: var(--_ba_box-shadow);
200
+ margin-right: var(--_ba-bx-sh-w)
225
201
  }
226
202
  }
203
+ &&__squared:not(&__important) {
204
+ .highcontrast-mode({
205
+ //Add border around the square in high contrast mode
206
+ --_ba_box-shadow: 0 0 0 calc(var(--_ba-bx-sh-w) - var(--su1)) var(--_ba-sq-bg),
207
+ 0 0 0 max(var(--su1), var(--_ba-bx-sh-w)) currentcolor var(--_ba-bx-sh-inset);
208
+ });
209
+ }
227
210
 
228
- &&__new {
229
- --_ba-bc: var(--_ba-bg);
230
- --_ba-bg: var(--purple-100);
231
- --_ba-fc: var(--purple-400);
232
- --_ba-fw: bold;
233
- --_ba-tt: uppercase;
211
+ // ICONS
212
+ &:not(&__squared):has(> svg){
213
+ //We want a smaller gap for icons that aren't squared
214
+ --_ba-gap: calc(var(--_ba-px) - var(--su2));
234
215
  }
235
216
 
236
- // CHILD ELEMENTS
237
- &--image, // Included with no base class to account for usage in .s-progress__badge
238
- & &--image {
239
- align-self: center;
240
- display: inline-flex;
241
- margin-right: var(--su1);
242
- margin-left: calc((var(--su4) + var(--su1)) * -1);
217
+ // IMPORTANT
218
+ &&__important {
219
+ --_ba-bg: var(--black-400);
220
+ --_ba-sq-bg: var(--black-500);
221
+ --_ba-fw: 600;
222
+ --_ba-fc: var(--black-050);
243
223
  }
244
224
 
245
225
  // INTERACTION
@@ -249,18 +229,17 @@
249
229
 
250
230
  align-self: var(--_ba-as);
251
231
  background-color: var(--_ba-bg);
252
- border: var(--su-static1) solid var(--_ba-bc);
232
+ border-left: var(--_ba-bl) solid var(--_ba-bc);
253
233
  color: var(--_ba-fc);
254
234
  font-size: var(--_ba-fs);
255
- gap: var(--_ba-g);
256
235
  font-weight: var(--_ba-fw);
257
- line-height: var(--_ba-lh);
258
- min-width: var(--_ba-wmn);
236
+ gap: var(--_ba-gap, var(--_ba-px));
259
237
  padding: var(--_ba-py) var(--_ba-px);
238
+ line-height: var(--lh-md);
239
+ min-width: var(--_ba-wmn);
260
240
  text-transform: var(--_ba-tt);
261
241
 
262
242
  align-items: center;
263
- border-radius: var(--br-sm);
264
243
  display: inline-flex;
265
244
  justify-content: center;
266
245
  text-decoration: none;