@stackoverflow/stacks 3.0.0-beta.2 → 3.0.0-beta.21

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 (60) hide show
  1. package/dist/css/stacks.css +6068 -5972
  2. package/dist/css/stacks.min.css +1 -1
  3. package/lib/atomic/flex.less +6 -34
  4. package/lib/atomic/height.less +22 -0
  5. package/lib/atomic/misc.less +21 -15
  6. package/lib/atomic/positioning.less +34 -0
  7. package/lib/atomic/sizing.less +76 -0
  8. package/lib/atomic/spacing.less +35 -75
  9. package/lib/atomic/typography.less +52 -13
  10. package/lib/atomic/width.less +27 -0
  11. package/lib/base/body.less +2 -4
  12. package/lib/base/configuration-static.less +3 -3
  13. package/lib/base/internal.less +3 -5
  14. package/lib/base/reset-normalize.less +1 -1
  15. package/lib/components/activity-indicator/activity-indicator.less +1 -17
  16. package/lib/components/avatar/avatar.less +2 -2
  17. package/lib/components/badge/badge.less +179 -173
  18. package/lib/components/banner/banner.less +11 -10
  19. package/lib/components/bling/bling.less +130 -0
  20. package/lib/components/button/button.less +233 -376
  21. package/lib/components/button-group/button-group.less +2 -1
  22. package/lib/components/checkbox_radio/checkbox_radio.less +195 -113
  23. package/lib/components/code-block/code-block.fixtures.ts +2 -2
  24. package/lib/components/code-block/code-block.less +1 -1
  25. package/lib/components/description/description.less +15 -1
  26. package/lib/components/empty-state/empty-state.less +17 -6
  27. package/lib/components/form-group/form-group.less +25 -0
  28. package/lib/components/input-icon/input-icon.less +3 -3
  29. package/lib/components/input_textarea/input_textarea.less +71 -58
  30. package/lib/components/menu/menu.less +83 -21
  31. package/lib/components/modal/modal.less +10 -10
  32. package/lib/components/navigation/navigation.less +62 -37
  33. package/lib/components/notice/notice.less +89 -74
  34. package/lib/components/pagination/pagination.less +44 -43
  35. package/lib/components/popover/popover.less +8 -10
  36. package/lib/components/post-summary/post-summary.less +6 -5
  37. package/lib/components/progress-bar/progress-bar.less +1 -1
  38. package/lib/components/prose/prose.less +5 -5
  39. package/lib/components/select/select.less +26 -37
  40. package/lib/components/sidebar-widget/sidebar-widget.less +2 -2
  41. package/lib/components/table/table.less +0 -8
  42. package/lib/components/tag/tag.less +69 -71
  43. package/lib/components/toast/toast.less +4 -2
  44. package/lib/components/topbar/topbar.less +4 -4
  45. package/lib/components/user-card/user-card.less +118 -92
  46. package/lib/components/vote/vote.less +134 -0
  47. package/lib/exports/color-sets.less +78 -77
  48. package/lib/exports/constants-helpers.less +4 -8
  49. package/lib/exports/constants-type.less +18 -36
  50. package/lib/exports/mixins.less +71 -0
  51. package/lib/stacks-static.less +7 -5
  52. package/lib/test/visual-test-utils.ts +42 -10
  53. package/lib/tsconfig.json +1 -1
  54. package/package.json +1 -1
  55. package/lib/atomic/width-height.less +0 -194
  56. package/lib/components/award-bling/award-bling.less +0 -32
  57. package/lib/components/check-control/check-control.less +0 -17
  58. package/lib/components/check-group/check-group.less +0 -19
  59. package/lib/components/skeleton/skeleton.less +0 -73
  60. package/lib/exports/spacing-mixins.less +0 -67
@@ -1,27 +1,27 @@
1
1
  .s-input,
2
- .s-textarea {
3
- --_in-bc: var(--bc-darker);
2
+ .s-textarea,
3
+ //The :has selector here allows us to use these vars for sibling icons in textarea components (See .s-textarea -> ~ .s-input-icon)
4
+ :has(> .s-textarea) {
5
+ --_in-ai: unset;
6
+ --_in-bc: var(--black-300);
4
7
  --_in-bg: var(--white);
5
8
  --_in-br: var(--br-md);
9
+ --_in-bw: var(--su-static1);
6
10
  --_in-c: unset;
7
- --_in-fc: var(--fc-dark);
11
+ --_in-d: unset;
12
+ --_in-fc: var(--black-600);
8
13
  --_in-fs: var(--fs-body1);
9
- --_in-o: unset;
10
- --_in-px: 0.7em;
11
- --_in-py: 0.6em;
14
+ --_in-fw: unset;
15
+ --_in-g: unset;
16
+ --_in-lh: var(--lh-base);
17
+ --_in-px: calc(var(--su12) - var(--su1)); // 11px
18
+ --_in-py: var(--su8);
12
19
  --_in-placeholder-fc: var(--black-300);
20
+ }
13
21
 
22
+ .s-input,
23
+ .s-textarea {
14
24
  // CONTEXTUAL STYLES
15
- @supports (-webkit-overflow-scrolling: touch) {
16
- --_in-fs: var(--su-static16); // 16px — Increase font size for mobile safari. This keeps our inputs from zooming the page while focused.
17
- --_in-px: 0.55em;
18
- --_in-py: 0.36em;
19
-
20
- &::-webkit-input-placeholder {
21
- line-height: normal !important;
22
- }
23
- }
24
-
25
25
  .highcontrast-mode({
26
26
  --_in-bc: var(--black);
27
27
  --_in-placeholder-fc: var(--black-400);
@@ -31,17 +31,16 @@
31
31
  fieldset[disabled] &,
32
32
  &[disabled] {
33
33
  --_in-c: not-allowed;
34
- --_in-o: var(--_o-disabled-static);
35
34
  }
36
35
 
37
36
  &[readonly],
38
37
  .is-readonly & {
39
38
  .highcontrast-mode({
40
- --_in-fc: var(--fc-medium);
39
+ --_in-fc: var(--black-500);
41
40
  });
42
41
 
43
42
  --_in-bg: var(--black-150);
44
- --_in-bc: var(--bc-light);
43
+ --_in-bc: var(--black-200);
45
44
  --_in-c: default;
46
45
  --_in-fc: var(--black-400);
47
46
  }
@@ -55,45 +54,27 @@
55
54
 
56
55
  // Sizes
57
56
  &&__sm {
58
- .size-styles(sm; in; @styles: fs);
59
- }
60
-
61
- &&__md {
62
- @supports (-webkit-overflow-scrolling: touch) {
63
- --_in-fs: calc(var(--su-static16) + var(--su-static1)); // 17px
64
- --_in-py: 0.4em;
65
- }
66
-
67
- .size-styles(md; in; @styles: br, fs);
57
+ --_in-fs: var(--fs-caption);
58
+ --_in-lh: var(--lh-sm);
59
+ --_in-px: calc(var(--su12) - var(--su2)); // 10px
60
+ --_in-py: calc(var(--su4) + var(--su1)); // 5px
68
61
  }
69
62
 
70
63
  &&__lg {
71
- .size-styles(lg; in; @styles: br, fs);
72
- --_in-px: 0.6em;
73
- --_in-py: 0.45em;
74
- }
75
-
76
- &&__xl {
77
- .size-styles(xl; in; @styles: br, fs);
78
- --_in-px: 0.5em;
79
- --_in-py: 0.4em;
64
+ --_in-fs: var(--fs-body3);
65
+ --_in-lh: var(--lh-lg);
66
+ --_in-px: calc(var(--su12) + var(--su1)); // 13px
80
67
  }
81
-
68
+
82
69
  // CHILD ELEMENTS
83
- .webkit-autofill();
84
-
85
- &::placeholder,
86
- &::-webkit-input-placeholder {
87
- color: var(--_in-placeholder-fc);
88
- }
89
-
90
70
  &::placeholder {
71
+ color: var(--_in-placeholder-fc);
91
72
  opacity: 1;
92
73
  }
93
74
 
94
75
  &&__creditcard,
95
76
  &&__search {
96
- --_in-pl: var(--su-static32);
77
+ --_in-pl: calc(var(--su-static32) + var(--su-static4)); // 36px
97
78
  }
98
79
 
99
80
  // INTERACTION
@@ -104,16 +85,19 @@
104
85
  }
105
86
 
106
87
  @scrollbar-styles();
88
+ align-items: var(--_in-ai);
107
89
  background-color: var(--_in-bg);
108
- border: var(--su-static1) solid var(--_in-bc);
109
- border-radius: var(--_in-br);
90
+ border: var(--_in-bw) solid var(--_in-bc);
110
91
  color: var(--_in-fc);
111
92
  cursor: var(--_in-c);
93
+ display: var(--_in-d);
94
+ flex-wrap: var(--_in-fw);
112
95
  font-size: var(--_in-fs);
113
- opacity: var(--_in-o);
96
+ gap: var(--_in-g);
97
+ line-height: var(--_in-lh);
114
98
  padding: var(--_in-py) var(--_in-px) var(--_in-py) var(--_in-pl, var(--_in-px));
115
-
116
- -webkit-appearance: none; // Removes shadows we don't want in mobile Safari
99
+
100
+ border-radius: var(--br-md);
117
101
  font-family: inherit;
118
102
  margin: 0; // A guard against Core's default margins
119
103
  width: 100%;
@@ -124,8 +108,23 @@
124
108
  padding-right: var(--su32);
125
109
  });
126
110
 
127
- &&__md {
128
- --_in-py: 0.5em;
111
+ // Nested Inputs
112
+ & & {
113
+ --_in-bg: transparent;
114
+ --_in-bw: 0;
115
+ --_in-px: 0;
116
+
117
+ box-shadow: none;
118
+ flex: 1 1 0;
119
+ margin: calc(var(--_in-py) * -1) 0;
120
+ }
121
+
122
+ &:has(&) {
123
+ --_in-ai: center;
124
+ --_in-d: flex;
125
+ --_in-fw: nowrap;
126
+ --_in-px: var(--_in-py);
127
+ --_in-g: var(--su8);
129
128
  }
130
129
  }
131
130
 
@@ -134,12 +133,26 @@
134
133
  padding-right: var(--su48);
135
134
  });
136
135
 
137
- &&__md {
138
- --_in-py: 0.72em;
136
+ --_in-py: var(--su8);
137
+ --_te-hmn: calc(var(--su32) + var(--su4)); // 36px
138
+ --_te-h: calc(var(--su64) + var(--su6)); // 70px
139
+
140
+ &&__sm {
141
+ --_te-hmn: calc(var(--su32) - var(--su4)); // 28px
142
+ --_te-h: calc(var(--su48) + var(--su6)); // 54px
143
+ }
144
+
145
+ &&__lg {
146
+ --_te-hmn: calc(var(--su48) - var(--su4)); // 44px
147
+ --_te-h: calc(var(--su64) + var(--su32)); // 96px
139
148
  }
140
149
 
150
+ min-height: var(--_te-hmn);
151
+ height: var(--_te-h); //set initial height
152
+
141
153
  ~ .s-input-icon {
142
- right: 1.5em;
143
- top: 1.5em;
154
+ right: var(--_in-px);
155
+ top: var(--_in-py);
156
+ margin-top: 0;
144
157
  }
145
158
  }
@@ -1,39 +1,101 @@
1
1
  .s-menu {
2
- --_me-divider-bg: var(--bc-light);
3
- --_me-label-btc: var(--bc-light);
4
- --_me-label-cursor: pointer;
5
-
6
- // CONTEXTUAL STYLES
7
- .dark-mode({
8
- --_me-divider-bg: var(--bc-light);
9
- --_me-label-btc: var(--bc-light);
10
- });
2
+ --_me-action-bg: unset;
3
+ --_me-action-fc: var(--black-500);
4
+ --_me-item-p: var(--su8);
11
5
 
12
6
  // CHILD ELEMENTS
13
7
  & &--divider {
14
- background-color: var(--_me-divider-bg);
8
+ background-color: var(--black-200);
15
9
  height: var(--su-static1);
16
10
  margin: var(--su8) 0;
17
11
  }
18
12
 
19
- & &--label {
20
- &.is-disabled {
21
- --_me-label-cursor: not-allowed;
13
+ & &--icon {
14
+ color: inherit;
15
+ margin-right: var(--su8);
16
+ }
17
+
18
+ & &--item {
19
+ &:has(> .s-menu--action){
20
+ --_me-item-p: 0;
22
21
  }
23
22
 
24
- border-top: var(--su-static1) solid var(--_me-label-btc);
25
- cursor: var(--_me-label-cursor);
26
- padding: var(--su12);
23
+ &.s-checkbox,
24
+ &.s-radio {
25
+ --_me-item-p: var(--su6) var(--su8);
26
+
27
+ input {
28
+ margin-top: var(--su4);
29
+ }
30
+
31
+ align-items: flex-start;
32
+ }
33
+
34
+ &:not(.s-checkbox):not(.s-radio) {
35
+ input {
36
+ height: 0;
37
+ pointer-events: none;
38
+ position: absolute;
39
+ opacity: 0;
40
+ width: 0;
41
+ }
42
+ }
43
+
44
+ color: var(--_me-action-fc);
45
+ padding: var(--_me-item-p);
46
+
47
+ align-items: center;
48
+ display: flex;
49
+ width: 100%;
50
+ }
51
+
52
+ & &--action {
53
+ &:focus-visible,
54
+ &:has(> input:focus-visible) {
55
+ .focus-styles(true, false);
56
+ }
57
+
58
+ &:focus-visible,
59
+ &:has(> input:focus-visible),
60
+ &:hover {
61
+ --_me-action-bg: var(--black-150);
62
+ --_me-action-fc: var(--black-600);
63
+ }
64
+
65
+ &__danger {
66
+ --_me-action-fc: var(--red-400);
67
+
68
+ &:focus-visible,
69
+ &:hover {
70
+ --_me-action-fc: var(--red-500);
71
+ }
72
+ }
73
+
74
+ background-color: var(--_me-action-bg);
75
+ color: var(--_me-action-fc);
76
+
77
+ align-items: center;
78
+ border-radius: var(--br-md);
79
+ cursor: pointer;
80
+ display: flex;
81
+ padding: var(--su8);
82
+ width: 100%;
83
+ }
84
+
85
+ & button&--action { // Normalize for when applying to a button
86
+ border: none;
87
+ font-family: inherit;
88
+ line-height: inherit;
89
+ text-align: left;
27
90
  }
28
91
 
29
92
  & &--title {
30
- color: var(--black-500);
31
- font-size: var(--fs-fine);
32
- padding: var(--su8) var(--su12);
33
- text-transform: uppercase;
93
+ color: var(--black-600);
94
+ font-weight: 700;
95
+ padding: var(--su6) var(--su8);
34
96
  }
35
97
 
36
- & li + &--title {
98
+ & &--item + &--title {
37
99
  margin-top: var(--su12);
38
100
  }
39
101
 
@@ -3,18 +3,17 @@
3
3
  --_mo-bg: fade(.set-black()[600], 50%); // Background remains fixed
4
4
  --_mo-hmx: unset;
5
5
  --_mo-wmx: unset;
6
- --_mo-close-t: var(--su8);
7
6
  --_mo-dialog-bg: var(--white);
8
7
  --_mo-dialog-pt: var(--su24);
9
- --_mo-header-fc: var(--fc-dark);
8
+ --_mo-dialog-ou: 0;
10
9
 
11
10
  // CONTEXTUAL STYLES
12
11
  .dark-mode({
13
- --_mo-dialog-bg: var(--black-225);
12
+ --_mo-dialog-bg: var(--black-100);
14
13
  });
15
14
 
16
- .highcontrast-dark-mode({
17
- --_mo-dialog-bg: var(--black-200);
15
+ .highcontrast-mode({
16
+ --_mo-dialog-ou: var(--su2) solid var(--black-500);
18
17
  });
19
18
 
20
19
  &[aria-hidden="false"] {
@@ -46,7 +45,6 @@
46
45
  &.has-danger,
47
46
  &&__danger {
48
47
  --_mo-bg: darken(fade(.set-red()[600], 50%), 18%);
49
- --_mo-header-fc: var(--red-500);
50
48
  }
51
49
 
52
50
  // CHILD ELEMENTS
@@ -61,16 +59,17 @@
61
59
  margin: 0 !important;
62
60
  }
63
61
 
64
- padding: var(--su12) !important; // [1]
62
+ padding: var(--su6) !important; // [1]
65
63
  position: absolute !important; // [1]
66
- right: var(--su8);
67
- top: var(--_mo-close-t);
64
+ right: var(--su16);
65
+ top: var(--su16);
68
66
  }
69
67
 
70
68
  & &--dialog {
71
69
  padding: var(--_mo-dialog-pt) var(--su24) var(--su24);
72
70
 
73
71
  @scrollbar-styles();
72
+ position: relative;
74
73
  backface-visibility: hidden;
75
74
  background-color: var(--_mo-dialog-bg);
76
75
  border-radius: var(--br-md);
@@ -83,6 +82,7 @@
83
82
  transition: opacity 200ms var(--te-smooth) 0s, z-index 0s 100ms, visibility 0s 100ms, transform 100ms var(--te-smooth) 0s, transform 100ms var(--te-smooth) 0s; // Transition out
84
83
  visibility: hidden;
85
84
  z-index: var(--zi-hide); // Make sure it's also below everything so we can't interact with it.
85
+ outline: var(--_mo-dialog-ou);
86
86
  }
87
87
 
88
88
  & &--footer {
@@ -90,7 +90,7 @@
90
90
  }
91
91
 
92
92
  & &--header {
93
- color: var(--_mo-header-fc);
93
+ color: var(--fc-dark);
94
94
 
95
95
  font-size: var(--fs-headline1);
96
96
  font-weight: normal;
@@ -4,18 +4,20 @@
4
4
  --_na-p: var(--su2) 0;
5
5
  --_na-gap: var(--su4);
6
6
  --_na-item-bg: none;
7
- --_na-item-fc: var(--black-500);
7
+ --_na-item-fc: var(--black-400);
8
8
  --_na-item-fs: unset;
9
- --_na-item-p: var(--su6) var(--su12);
10
- --_na-item-py: var(--su12);
9
+ --_na-item-p: calc(var(--su12) - var(--su1)) var(--su16);
11
10
  --_na-item-ws: nowrap;
12
- --_na-item-bg-hover: var(--black-200);
11
+ --_na-item-bg-hover: var(--black-100);
13
12
  --_na-item-fc-hover: var(--_na-item-fc);
14
- --_na-item-selected-bg: var(--theme-primary);
15
- --_na-item-selected-fc: var(--white);
16
- --_na-item-selected-bg-hover: var(--theme-primary-500);
13
+ --_na-item-selected-bg: none;
14
+ --_na-item-selected-fc: var(--black-600);
15
+ --_na-item-selected-bg-hover: var(--_na-item-bg-hover);
16
+ --_na-item-selected-h: var(--su-static2);
17
17
  --_na-item-text-ta: center;
18
- --_na-title-mt: var(--su16);
18
+ --_na-title-mt: var(--su24);
19
+ --_na-after-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M11.35 4.35 6 9.71.65 4.35l.7-.7L6 8.29l4.65-4.64z'/%3E%3C/svg%3E");
20
+ --_na-after-bg-color: var(--black-400);
19
21
 
20
22
  // CONTEXTUAL STYLES
21
23
  .highcontrast-mode({
@@ -33,7 +35,7 @@
33
35
 
34
36
  &&__sm {
35
37
  --_na-item-fs: var(--fs-caption);
36
- --_na-item-p: var(--su4) var(--su12);
38
+ --_na-item-p: var(--su6) var(--su4);
37
39
  }
38
40
 
39
41
  &&__vertical {
@@ -42,19 +44,20 @@
42
44
  --_na-p: 0;
43
45
  --_na-item-text-ta: unset;
44
46
  --_na-item-ws: normal;
45
- }
47
+ --_na-item-selected-h: 0;
48
+ --_na-item-p: var(--su6) var(--su8);
49
+ & .s-navigation--item {
50
+ &.is-selected {
51
+ --_na-item-bg: var(--black-150);
52
+ }
46
53
 
47
- // VARIANTS
48
- &&__muted {
49
- --_na-item-selected-bg: var(--black-150);
50
- --_na-item-selected-fc: var(--black-600);
51
- --_na-item-selected-bg-hover: var(--_na-item-bg);
52
-
53
- .highcontrast-mode({
54
- --_na-item-selected-bg: var(--black-600);
55
- --_na-item-selected-fc: var(--black-150);
56
- --_na-item-selected-bg-hover: var(--black-600);
57
- });
54
+ &:has(.s-navigation--icon) {
55
+ --_na-item-p: calc(var(--su12) - var(--su1)) var(--su8);
56
+ }
57
+ &:has(.s-navigation--avatar) {
58
+ --_na-item-p: var(--su12) var(--su8);
59
+ }
60
+ }
58
61
  }
59
62
 
60
63
  // CHILD ELEMENTS
@@ -65,8 +68,18 @@
65
68
  --_na-item-fc-hover: var(--_na-item-fc);
66
69
  --_na-item-bg-hover: var(--_na-item-selected-bg-hover);
67
70
 
71
+ &:before {
72
+ content: "";
73
+ position: absolute;
74
+ bottom: 0;
75
+ left: 0;
76
+ right: 0;
77
+ height: var(--_na-item-selected-h);
78
+ background-color: var(--_na-item-selected-fc);
79
+ }
80
+
68
81
  .highcontrast-mode({
69
- text-decoration: none;
82
+ --_na-item-fc-hover: var(--white);
70
83
  });
71
84
 
72
85
  font-weight: bold;
@@ -75,22 +88,22 @@
75
88
  // TODO: include child component class (without variant) on selector
76
89
  &__dropdown {
77
90
  &:after {
78
- border-style: solid;
79
- border-width: var(--su-static4) var(--su-static4) 0 var(--su-static4);
80
- border-color: currentColor transparent;
91
+ mask-image: var(--_na-after-mask);
92
+ mask-size: contain;
93
+ mask-repeat: no-repeat;
94
+ background-color: var(--_na-after-bg-color);
81
95
  content: "";
82
- pointer-events: none;
83
- position: absolute;
84
- right: 0.9em;
85
- top: calc(50% - var(--su-static2)); // 50% - 2px
86
- z-index: var(--zi-active);
96
+ height: var(--su12);
97
+ width: var(--su12);
98
+ margin-left: var(--su8);
87
99
  }
88
-
89
- padding-right: 2em;
90
100
  }
91
101
 
92
102
  &:hover,
93
103
  &:active {
104
+ .highcontrast-mode({
105
+ --_na-after-bg-color: var(--white);
106
+ });
94
107
  background-color: var(--_na-item-bg-hover);
95
108
  color: var(--_na-item-fc-hover);
96
109
  }
@@ -108,7 +121,7 @@
108
121
 
109
122
  align-items: center;
110
123
  border: none; // Reset some things for when the navigation item is also a button
111
- border-radius: 1000px;
124
+ border-radius: var(--br-md);
112
125
  box-shadow: none;
113
126
  cursor: pointer;
114
127
  display: flex;
@@ -136,12 +149,24 @@
136
149
  --_na-title-mt: 0;
137
150
  }
138
151
 
139
- margin-top: var(--_na-title-mt);
152
+ & .s-btn {
153
+ color: var(--black-400);
154
+ }
140
155
 
156
+ margin-top: var(--_na-title-mt);
141
157
  font-size: var(--fs-fine);
142
- font-weight: bold;
143
- padding: var(--su6) var(--su12);
144
- text-transform: uppercase;
158
+ color: var(--black-400);
159
+ padding: calc(var(--su16) + var(--su2)) var(--su8);
160
+ }
161
+
162
+ & &--icon {
163
+ color: inherit;
164
+ margin-right: var(--su4);
165
+ }
166
+
167
+ & &--avatar {
168
+ margin-right: var(--su8);
169
+ background: transparent;
145
170
  }
146
171
 
147
172
  flex-direction: var(--_na-fd);