@stackoverflow/stacks 3.0.0-beta.3 → 3.0.0-beta.30

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 (108) hide show
  1. package/dist/controllers.d.ts +0 -2
  2. package/dist/css/stacks.css +14245 -15086
  3. package/dist/css/stacks.min.css +1 -1
  4. package/dist/js/stacks.js +0 -364
  5. package/dist/js/stacks.min.js +1 -1
  6. package/lib/atomic/backgrounds.less +67 -0
  7. package/lib/atomic/border-radius.less +38 -0
  8. package/lib/atomic/borders.less +73 -0
  9. package/lib/atomic/box-shadow.less +29 -0
  10. package/lib/atomic/box-sizing.less +3 -0
  11. package/lib/atomic/current-color.less +2 -0
  12. package/lib/atomic/cursors.less +8 -0
  13. package/lib/atomic/display.less +15 -0
  14. package/lib/atomic/flex.less +6 -34
  15. package/lib/atomic/floats.less +20 -0
  16. package/lib/atomic/gap.less +2 -0
  17. package/lib/atomic/grid.less +2 -0
  18. package/lib/atomic/height.less +22 -0
  19. package/lib/atomic/interactivity.less +45 -0
  20. package/lib/atomic/lists.less +29 -0
  21. package/lib/atomic/margin.less +48 -0
  22. package/lib/atomic/object-fit.less +9 -0
  23. package/lib/atomic/opacity.less +54 -0
  24. package/lib/atomic/outline.less +11 -0
  25. package/lib/atomic/overflow.less +17 -0
  26. package/lib/atomic/padding.less +12 -0
  27. package/lib/atomic/positioning.less +41 -0
  28. package/lib/atomic/sizing.less +51 -0
  29. package/lib/atomic/transitions.less +20 -0
  30. package/lib/atomic/truncation.less +58 -0
  31. package/lib/atomic/typography.less +71 -137
  32. package/lib/atomic/vertical-alignment.less +9 -0
  33. package/lib/atomic/visibility.less +18 -0
  34. package/lib/atomic/width.less +27 -0
  35. package/lib/atomic/z-index.less +12 -0
  36. package/lib/base/body.less +2 -4
  37. package/lib/base/configuration-static.less +3 -3
  38. package/lib/base/internal.less +3 -5
  39. package/lib/base/reset-normalize.less +3 -3
  40. package/lib/components/activity-indicator/activity-indicator.less +4 -20
  41. package/lib/components/anchor/anchor.less +28 -39
  42. package/lib/components/avatar/avatar.less +20 -19
  43. package/lib/components/badge/badge.less +227 -167
  44. package/lib/components/banner/banner.less +12 -11
  45. package/lib/components/bling/bling.less +47 -10
  46. package/lib/components/button/button.less +300 -380
  47. package/lib/components/checkbox_radio/checkbox_radio.less +195 -113
  48. package/lib/components/code-block/code-block.fixtures.ts +2 -2
  49. package/lib/components/code-block/code-block.less +2 -3
  50. package/lib/components/description/description.less +17 -2
  51. package/lib/components/empty-state/empty-state.less +17 -6
  52. package/lib/components/form-group/form-group.less +38 -0
  53. package/lib/components/input-fill/input-fill.less +3 -3
  54. package/lib/components/input-icon/input-icon.less +3 -3
  55. package/lib/components/input-message/input-message.less +1 -0
  56. package/lib/components/input_textarea/input_textarea.less +71 -58
  57. package/lib/components/label/label.less +12 -56
  58. package/lib/components/link/link.less +44 -98
  59. package/lib/components/loader/loader.less +88 -0
  60. package/lib/components/menu/menu.less +89 -19
  61. package/lib/components/modal/modal.less +10 -10
  62. package/lib/components/navigation/navigation.less +77 -42
  63. package/lib/components/notice/notice.less +90 -75
  64. package/lib/components/pagination/pagination.less +50 -42
  65. package/lib/components/popover/popover.less +9 -11
  66. package/lib/components/post-summary/post-summary.less +225 -385
  67. package/lib/components/prose/prose.less +49 -35
  68. package/lib/components/select/select.less +46 -41
  69. package/lib/components/sidebar-widget/sidebar-widget.less +26 -196
  70. package/lib/components/table/table.less +48 -22
  71. package/lib/components/tag/tag.less +25 -6
  72. package/lib/components/toast/toast.less +4 -2
  73. package/lib/components/toggle-switch/toggle-switch.less +15 -19
  74. package/lib/components/user-card/user-card.less +129 -92
  75. package/lib/components/vote/vote.less +134 -0
  76. package/lib/controllers.ts +0 -2
  77. package/lib/exports/color-sets.less +108 -81
  78. package/lib/exports/constants-helpers.less +9 -13
  79. package/lib/exports/constants-type.less +18 -36
  80. package/lib/exports/mixins.less +92 -272
  81. package/lib/index.ts +0 -4
  82. package/lib/stacks-static.less +44 -30
  83. package/lib/test/visual-test-utils.ts +42 -10
  84. package/lib/tsconfig.json +1 -1
  85. package/package.json +1 -1
  86. package/dist/components/expandable/expandable.d.ts +0 -17
  87. package/dist/components/uploader/uploader.d.ts +0 -48
  88. package/lib/atomic/border.less +0 -121
  89. package/lib/atomic/misc.less +0 -374
  90. package/lib/atomic/spacing.less +0 -98
  91. package/lib/atomic/width-height.less +0 -194
  92. package/lib/components/block-link/block-link.less +0 -82
  93. package/lib/components/breadcrumbs/breadcrumbs.less +0 -41
  94. package/lib/components/button-group/button-group.less +0 -81
  95. package/lib/components/card/card.less +0 -37
  96. package/lib/components/check-control/check-control.less +0 -17
  97. package/lib/components/check-group/check-group.less +0 -19
  98. package/lib/components/expandable/expandable.less +0 -119
  99. package/lib/components/expandable/expandable.ts +0 -238
  100. package/lib/components/link-preview/link-preview.less +0 -148
  101. package/lib/components/page-title/page-title.less +0 -51
  102. package/lib/components/progress-bar/progress-bar.less +0 -292
  103. package/lib/components/skeleton/skeleton.less +0 -73
  104. package/lib/components/spinner/spinner.less +0 -103
  105. package/lib/components/topbar/topbar.less +0 -553
  106. package/lib/components/uploader/uploader.less +0 -205
  107. package/lib/components/uploader/uploader.ts +0 -207
  108. package/lib/exports/spacing-mixins.less +0 -67
@@ -1,7 +1,7 @@
1
1
  .s-avatar {
2
- --_av-size: var(--su-static16);
3
- --_av-bg: var(--_white-static); // Force a white background color for when we have transparent avatars
4
- --_av-fs-letter: calc(var(--su-static12) - var(--su-static1));
2
+ --_av-size: var(--su16);
3
+ --_av-bg: var(--white); // Use a solid background color to prevent transparent avatars from blending with the background
4
+ --_av-fs-letter: calc(var(--su12) - var(--su1));
5
5
  --_av-scale-badge: 1;
6
6
 
7
7
  // CONTEXTUAL STYLES
@@ -11,7 +11,7 @@
11
11
  }
12
12
 
13
13
  background-color: var(--black);
14
- box-shadow: 0 0 0 var(--su-static1) var(--black);
14
+ box-shadow: 0 0 0 var(--su1) var(--black);
15
15
  color: var(--white);
16
16
  });
17
17
 
@@ -23,44 +23,44 @@
23
23
  }
24
24
 
25
25
  &&__24 {
26
- --_av-size: var(--su-static24);
27
- --_av-fs-letter: var(--su-static16);
26
+ --_av-size: var(--su24);
27
+ --_av-fs-letter: var(--su16);
28
28
  --_av-scale-badge: 1.1;
29
29
  }
30
30
 
31
31
  &&__32 {
32
- --_av-size: var(--su-static32);
33
- --_av-fs-letter: calc(var(--su-static24) - var(--su-static2));
32
+ --_av-size: var(--su32);
33
+ --_av-fs-letter: calc(var(--su24) - var(--su2));
34
34
  --_av-scale-badge: 1.3;
35
35
  }
36
36
 
37
37
  &&__48 {
38
- --_av-size: var(--su-static48);
39
- --_av-fs-letter: calc(var(--su-static32) + var(--su-static2));
38
+ --_av-size: var(--su48);
39
+ --_av-fs-letter: calc(var(--su32) + var(--su2));
40
40
  --_av-scale-badge: 1.6;
41
41
  }
42
42
 
43
43
  &&__64 {
44
- --_av-size: var(--su-static64);
45
- --_av-fs-letter: calc(var(--su-static48) - var(--su-static4));
44
+ --_av-size: var(--su64);
45
+ --_av-fs-letter: calc(var(--su48) - var(--su4));
46
46
  --_av-scale-badge: 2.4;
47
47
  }
48
48
 
49
49
  &&__96 {
50
- --_av-size: var(--su-static96);
51
- --_av-fs-letter: calc(var(--su-static64) + var(--su-static2));
50
+ --_av-size: var(--su96);
51
+ --_av-fs-letter: calc(var(--su64) + var(--su2));
52
52
  }
53
53
 
54
54
  &&__128 {
55
- --_av-size: var(--su-static128);
56
- --_av-fs-letter: calc(var(--su-static96) - var(--su-static8));
55
+ --_av-size: var(--su128);
56
+ --_av-fs-letter: calc(var(--su96) - var(--su8));
57
57
  }
58
58
 
59
59
  // CHILD ELEMENTS
60
60
  & &--badge {
61
- bottom: calc(var(--su-static4) * -1); // -4px
61
+ bottom: var(--sun4);
62
62
  position: absolute;
63
- right: calc(var(--su-static4) * -1); // -4px
63
+ right: var(--sun4);
64
64
  -webkit-transform: scale(var(--_av-scale-badge));
65
65
  transform: scale(var(--_av-scale-badge));
66
66
  }
@@ -87,7 +87,7 @@
87
87
  }
88
88
 
89
89
  & &--indicator {
90
- box-shadow: 0 0 0 var(--su-static2) var(--white);
90
+ box-shadow: 0 0 0 var(--su2) var(--white);
91
91
  bottom: 100%;
92
92
  left: 100%;
93
93
  position: absolute;
@@ -102,5 +102,6 @@
102
102
  background-size: 100%;
103
103
  display: inline-block; // Make sure the avatar has structure regardless of the element eg. span vs. div
104
104
  position: relative;
105
+ text-decoration: none;
105
106
  vertical-align: bottom; // Make our avatars play more nicely with text next to it.
106
107
  }
@@ -1,245 +1,307 @@
1
1
  .s-badge {
2
- --_ba-as: unset;
3
- --_ba-bc: var(--bc-medium);
4
- --_ba-bg: var(--black-150);
2
+ --_ba-bc: transparent;
3
+ --_ba-bg: var(--black-100);
5
4
  --_ba-fc: var(--black-500);
6
5
  --_ba-fs: var(--fs-caption);
7
- --_ba-fw: normal;
8
- --_ba-g: 0.3em;
9
- --_ba-lh: 2;
10
6
  --_ba-px: var(--su6);
11
- --_ba-py: 0;
7
+ --_ba-py: var(--su4);
12
8
  --_ba-tt: unset;
13
9
  --_ba-wmn: 0;
14
-
10
+ --_ba-bl: 0;
11
+ --_ba-fw: unset;
12
+ --_ba-g: unset;
13
+ --_ba-svg-p: var(--su2);
14
+ --_ba-sq-bg: var(--black-200);
15
+
15
16
  // CONTEXTUAL STYLES
16
17
  .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;
18
+ --_ba-bx-sh-w: var(--su1);
19
+
20
+ &.s-badge__sm {
21
+ --_ba-bx-sh-w: 0;
22
+ }
23
+
24
+ &.s-badge__lg {
25
+ --_ba-bx-sh-w: var(--su4);
26
+ }
27
+
28
+ &:not(.s-badge__important) > svg {
29
+ //Add border around the square in high contrast mode
30
+ box-shadow: 0 0 0 calc(var(--_ba-bx-sh-w) - var(--su1)) var(--_ba-sq-bg),
31
+ 0 0 0 max(var(--su1), var(--_ba-bx-sh-w)) currentcolor inset;
30
32
  }
31
33
 
32
- &__new {
33
- --_ba-fc: var(--purple-600);
34
+ a[href] {
35
+ &,
36
+ &:hover {
37
+ text-decoration: underline !important;
38
+ }
34
39
  }
35
40
  });
36
41
 
37
- // MODIFIERS
38
- // Sizes
39
- &&__xs,
40
- &&__sm {
41
- --_ba-as: flex-start;
42
- --_ba-fs: var(--fs-fine);
42
+ &:has(> .s-bling__filled),
43
+ &&__squared,
44
+ &:has(> svg) {
45
+ &,
46
+ &.s-badge__lg,
47
+ &.s-badge__sm {
48
+ --_ba-px: 0;
49
+ --_ba-py: 0;
50
+ }
51
+
52
+ &.s-badge__lg {
53
+ --_ba-pr: var(--su8);
54
+ }
55
+
56
+ &.s-badge__sm {
57
+ --_ba-pr: var(--su4);
58
+ }
59
+
60
+ --_ba-pr: var(--su6);
43
61
  }
44
62
 
45
- &&__xs {
46
- --_ba-lh: 1.5;
47
- --_ba-px: var(--su2);
48
- --_ba-wmn: calc(var(--su-static16) + var(--su-static2));
63
+ &:has(> .s-bling__filled),
64
+ &&__squared {
65
+ &.s-badge__lg {
66
+ --_ba-g: var(--su8);
67
+ }
68
+
69
+ &.s-badge__sm {
70
+ --_ba-g: var(--su4);
71
+ }
72
+
73
+ --_ba-g: var(--su6);
49
74
  }
50
75
 
76
+ &:not(&__squared):has(> svg){
77
+ --_ba-g: var(--su2);
78
+ }
79
+
80
+
81
+ &:has(.s-bling__rep) {
82
+ --_ba-fw: 600;
83
+ --_ba-fc: var(--black-600);
84
+ }
85
+
86
+ &:has(.s-bling) {
87
+ --_ba-bg: var(--black-150);
88
+ }
89
+
90
+ // SIZES
51
91
  &&__sm {
52
- --_ba-lh: 1.8;
92
+ --_ba-fs: var(--fs-fine);
53
93
  --_ba-px: var(--su4);
54
- --_ba-wmn: calc(var(--su-static16) + var(--su-static2));
94
+ --_ba-py: var(--su1);
95
+ --_ba-wmn: calc(var(--su16) + var(--su2));
96
+ --_ba-svg-p: var(--_ba-py);
55
97
  }
56
98
 
57
- // Badge counts
99
+ &&__lg {
100
+ --_ba-fs: var(--fs-body1);
101
+ --_ba-px: var(--su8);
102
+ --_ba-py: calc(var(--su4) + var(--su1));
103
+ --_ba-svg-p: var(--_ba-py);
104
+ }
105
+
106
+ // TAG
58
107
  &&__gold,
59
108
  &&__silver,
60
109
  &&__bronze {
61
- --_ba-fc: var(--black-500);
110
+ --_ba-bl: var(--su4);
111
+
112
+ & .s-bling__gold,
113
+ & .s-bling__silver,
114
+ & .s-bling__bronze {
115
+ margin-left: -2px;
116
+ }
62
117
  }
63
118
 
64
119
  &&__gold {
65
120
  --_ba-bc: var(--yellow-300);
66
- --_ba-bg: var(--yellow-100);
67
121
  }
68
-
69
122
  &&__silver {
70
123
  --_ba-bc: var(--blue-300);
71
- --_ba-bg: var(--blue-100);
72
124
  }
73
-
74
125
  &&__bronze {
75
126
  --_ba-bc: var(--orange-300);
76
- --_ba-bg: var(--orange-100);
77
127
  }
78
128
 
79
- // Number counts
80
- &&__answered,
81
- &&__bounty,
82
- &&__important {
83
- --_ba-bc: transparent;
84
- --_ba-fc: var(--white);
129
+ // USER
130
+ &&__admin,
131
+ &&__moderator,
132
+ &&__staff,
133
+ &&__ai,
134
+ &&__bot,
135
+ &&__new {
136
+ --_ba-bl: var(--su4);
137
+ --_ba-bg: var(--black-150);
138
+ --_ba-fc: var(--black-600);
85
139
  }
86
140
 
87
- &&__rep,
88
- &&__rep-down,
89
- &&__votes:not(&__answered) {
90
- --_ba-bg: var(--white);
141
+ &&__moderator,
142
+ &&__new {
143
+ &:before {
144
+ background-color: var(--_ba-bc);
145
+ height: var(--_ba-before-h);
146
+ width: var(--_ba-before-w);
147
+ -webkit-mask: var(--_ba-before-icon) no-repeat center;
148
+ mask: var(--_ba-before-icon) no-repeat center;
149
+
150
+ content: "";
151
+ display: inline-block;
152
+ -webkit-mask-size: contain;
153
+ mask-size: contain;
154
+ }
91
155
  }
92
156
 
93
- &&__answered {
94
- --_ba-bg: var(--green-400);
95
- }
157
+ &&__moderator {
158
+ --_ba-bc: var(--blue-500);
159
+ --_ba-before-h: calc(var(--su12) + var(--su1)); // 13px
160
+ --_ba-before-w: calc(var(--su12) - var(--su1)); // 11px
161
+ --_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");
96
162
 
97
- &&__bounty {
98
- --_ba-bg: var(--blue-400);
99
- }
163
+ &.s-badge__sm {
164
+ --_ba-before-h: calc(var(--su12) - var(--su1)); // 11px
165
+ --_ba-before-w: calc(var(--su8) + var(--su1)); // 9px
166
+ --_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");
167
+ }
100
168
 
101
- &&__important {
102
- --_ba-bg: var(--red-400);
169
+ &:before {
170
+ margin-top: var(--sun1);
171
+ }
103
172
  }
104
173
 
105
- &&__rep {
106
- --_ba-bc: var(--green-300);
107
- --_ba-fc: var(--green-400);
174
+ &&__staff {
175
+ --_ba-bc: var(--orange-400);
108
176
  }
109
177
 
110
- &&__rep-down {
111
- --_ba-bc: var(--red-300);
112
- --_ba-fc: var(--red-400);
178
+ &&__admin {
179
+ --_ba-bc: var(--theme-primary-500, var(--orange-500));
113
180
  }
114
181
 
115
- &&__votes:not(&__answered) {
116
- --_ba-bc: var(--black-250);
117
- --_ba-fc: var(--black-500);
182
+ &&__ai {
183
+ --_ba-bc: var(--purple-400);
118
184
  }
119
185
 
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);
186
+ &&__bot {
187
+ --_ba-bc: var(--black-400);
125
188
  }
126
189
 
127
- &&__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
- // :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
- }
145
-
146
- &.s-badge__sm {
147
- --_ba-g: var(--su-static2);
148
- --_ba-before-h: calc(var(--su-static12) - var(--su-static1)); // 11px
149
- --_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
- }
190
+ // TODO reassess if we need this modifier or should rely on embedding an svg (our `__featured` example is the same as this badge)
191
+ &&__new {
192
+ --_ba-bg: var(--purple-100);
193
+ --_ba-fc: var(--purple-500);
194
+ --_ba-sq-bg: var(--purple-200);
195
+ --_ba-bc: var(--purple-400);
196
+ --_ba-gap: var(--su2);
197
+ --_ba-before-h: calc(var(--su12) + var(--su2));
198
+ --_ba-before-w: calc(var(--su12) + var(--su2));
199
+ --_ba-before-icon: url("data:image/svg+xml;,%3Csvg width='14' height='14' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8 1a7 7 0 1 1 0 14A7 7 0 0 1 8 1m0 1.25a5.75 5.75 0 1 0 0 11.5 5.75 5.75 0 0 0 0-11.5m1 10.06H7V10.6h2zM8.14 4c1.78 0 2.77.96 2.77 2.5 0 1.79-2.1 2.2-2.1 3.25h-1.6c0-2 2-2.08 2-3.26 0-.54-.27-.96-1.02-.96-.7 0-1.03.46-1.1 1.23H5.4A2.75 2.75 0 0 1 8.13 4' fill='%23fff'/%3E%3C/svg%3E");
153
200
 
154
201
  &:before {
155
- height: var(--_ba-before-h);
156
- margin-top: var(--_ba-before-mt);
157
- width: var(--_ba-before-w);
158
-
159
- content: "";
160
- display: inline-block;
161
- background-color: currentColor;
162
- -webkit-mask: var(--_ba-before-icon) no-repeat center;
163
- mask: var(--_ba-before-icon) no-repeat center;
164
- -webkit-mask-size: contain;
165
- mask-size: contain;
202
+ margin-left: var(--sun2);
203
+ margin-top: 0;
166
204
  }
167
205
  }
168
206
 
169
- &&__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);
174
- }
207
+ // STATES
208
+ &&__info {
209
+ --_ba-bg: var(--blue-100);
210
+ --_ba-fc: var(--blue-500);
211
+ --_ba-sq-bg: var(--blue-200);
175
212
 
176
- // VARIANTS
177
- &&__ai {
178
- --_ba-bc: var(--_ba-fc);
179
- --_ba-bg: var(--black-050);
180
- --_ba-fc: var(--orange-500);
181
- --_ba-tt: uppercase;
213
+ &.s-badge__important {
214
+ --_ba-bg: var(--blue-400);
215
+ --_ba-sq-bg: var(--blue-500);
216
+ }
182
217
  }
183
218
 
184
- &&__bot {
185
- --_ba-bc: var(--black-300);
186
- }
219
+ &&__warning {
220
+ --_ba-bg: var(--yellow-100);
221
+ --_ba-fc: var(--yellow-500);
222
+ --_ba-sq-bg: var(--yellow-200);
187
223
 
188
- &&__danger,
189
- &&__muted {
190
- &.s-badge__filled {
191
- --_ba-bc: transparent;
224
+ &.s-badge__important {
225
+ --_ba-bg: var(--yellow-400);
226
+ --_ba-sq-bg: var(--yellow-500);
192
227
  }
193
228
  }
194
229
 
195
230
  &&__danger {
196
- --_ba-bc: var(--red-300);
197
- --_ba-bg: var(--red-200);
198
- --_ba-fc: var(--red-600);
231
+ --_ba-bg: var(--red-100);
232
+ --_ba-fc: var(--red-500);
233
+ --_ba-sq-bg: var(--red-200);
199
234
 
200
- &.s-badge__filled {
235
+ &.s-badge__important {
201
236
  --_ba-bg: var(--red-400);
202
- --_ba-fc: var(--white);
237
+ --_ba-sq-bg: var(--red-500);
203
238
  }
204
239
  }
205
- &&__info {
206
- --_ba-bc: var(--blue-300);
207
- --_ba-bg: var(--blue-200);
208
- --_ba-fc: var(--blue-600);
209
- }
210
240
 
211
- &&__warning {
212
- --_ba-bc: var(--yellow-300);
213
- --_ba-bg: var(--yellow-200);
214
- --_ba-fc: var(--yellow-600);
241
+ &&__critical {
242
+ --_ba-bg: var(--red-200);
243
+ --_ba-fc: var(--red-600);
244
+ --_ba-sq-bg: var(--red-300);
245
+
246
+ &.s-badge__important {
247
+ --_ba-bg: var(--red-500);
248
+ --_ba-sq-bg: var(--red-600);
249
+ }
215
250
  }
216
251
 
217
- &&__muted {
218
- --_ba-bc: var(--black-300);
252
+ &&__tonal {
219
253
  --_ba-bg: var(--black-200);
220
- --_ba-fc: var(--black-500);
254
+ --_ba-fc: var(--black-600);
255
+ --_ba-sq-bg: var(--black-300);
221
256
 
222
- &.s-badge__filled {
257
+ &.s-badge__important {
223
258
  --_ba-bg: var(--black-500);
224
- --_ba-fc: var(--white);
259
+ --_ba-sq-bg: var(--black-600);
225
260
  }
226
261
  }
227
262
 
228
- &&__new {
229
- --_ba-bc: var(--_ba-bg);
263
+ &&__success {
264
+ --_ba-bg: var(--green-100);
265
+ --_ba-fc: var(--green-600);
266
+ --_ba-sq-bg: var(--green-200);
267
+
268
+ &.s-badge__important {
269
+ --_ba-bg: var(--green-500);
270
+ --_ba-sq-bg: var(--green-600);
271
+ }
272
+ }
273
+
274
+ &&__featured {
230
275
  --_ba-bg: var(--purple-100);
231
- --_ba-fc: var(--purple-400);
232
- --_ba-fw: bold;
233
- --_ba-tt: uppercase;
276
+ --_ba-fc: var(--purple-500);
277
+ --_ba-sq-bg: var(--purple-200);
278
+
279
+ &.s-badge__important {
280
+ --_ba-bg: var(--purple-400);
281
+ --_ba-sq-bg: var(--purple-500);
282
+ }
283
+ }
284
+
285
+ // SQUARED
286
+ &&__squared svg {
287
+ background-color: var(--_ba-sq-bg);
288
+ }
289
+
290
+ // IMPORTANT
291
+ &&__important {
292
+ --_ba-bg: var(--black-400);
293
+ --_ba-fc: var(--black-050);
294
+ --_ba-fw: 600;
295
+ --_ba-sq-bg: var(--black-500);
234
296
  }
235
297
 
236
298
  // 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);
299
+ svg {
300
+ aspect-ratio: 1 / 1;
301
+ box-sizing: content-box;
302
+ display: block;
303
+ height: calc(var(--su16) + var(--su4));
304
+ padding: var(--_ba-svg-p);
243
305
  }
244
306
 
245
307
  // INTERACTION
@@ -247,22 +309,20 @@
247
309
  text-decoration: none;
248
310
  }
249
311
 
250
- align-self: var(--_ba-as);
251
312
  background-color: var(--_ba-bg);
252
- border: var(--su-static1) solid var(--_ba-bc);
313
+ border-left: var(--_ba-bl) solid var(--_ba-bc);
253
314
  color: var(--_ba-fc);
254
315
  font-size: var(--_ba-fs);
255
- gap: var(--_ba-g);
256
316
  font-weight: var(--_ba-fw);
257
- line-height: var(--_ba-lh);
317
+ gap: var(--_ba-g, var(--_ba-px));
318
+ padding: var(--_ba-py) var(--_ba-pr, var(--_ba-px)) var(--_ba-py) var(--_ba-px);
258
319
  min-width: var(--_ba-wmn);
259
- padding: var(--_ba-py) var(--_ba-px);
260
320
  text-transform: var(--_ba-tt);
261
-
321
+
262
322
  align-items: center;
263
- border-radius: var(--br-md);
264
323
  display: inline-flex;
265
324
  justify-content: center;
325
+ line-height: var(--lh-md);
266
326
  text-decoration: none;
267
327
  vertical-align: middle;
268
328
  white-space: nowrap;
@@ -3,8 +3,15 @@
3
3
  // This would reduce the amount of CSS we ship to the client and simplify our codebase
4
4
  .s-banner {
5
5
  --_no-ty-offset: 0;
6
- --_no-ty: var(--theme-topbar-height, calc(var(--su-static48) + var(--su-static8)));
6
+ --_no-ty: var(--theme-topbar-height, calc(var(--su48) + var(--su8)));
7
7
  .construct-notice-component(s-banner);
8
+
9
+ &--icon {
10
+ //Remove the icon backgound color
11
+ --_no-icon-bg: transparent;
12
+ margin-right: var(--su8);
13
+ align-self: flex-start;
14
+ }
8
15
 
9
16
  &[aria-hidden="true"] { // If you want to hide and reveal the banner
10
17
  --_no-ty-offset: -1;
@@ -27,18 +34,12 @@
27
34
  padding-top: 93px;
28
35
  }
29
36
 
30
- & &--container { // When we want to keep hero content capped
31
- margin: 0 auto;
32
- max-width: calc(var(--s-step) * 10);
33
- position: relative;
34
- width: 100%;
35
- }
36
-
37
- border-width: 0 0 var(--su-static1);
37
+ display: flex;
38
+ align-items: center;
39
+ padding: var(--su16);
38
40
  inset: 0 0 auto 0;
39
- padding: var(--su12);
40
41
  position: fixed;
41
42
  transform: translate3d(0, calc(var(--_no-ty) * var(--_no-ty-offset)), 0);
42
43
  width: 100%;
43
44
  z-index: calc(var(--zi-navigation-fixed) - 1); // Tuck below topbar
44
- }
45
+ }