@stackoverflow/stacks 1.0.0 → 1.0.1

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 (71) hide show
  1. package/README.md +47 -47
  2. package/dist/css/stacks.css +108 -0
  3. package/dist/css/stacks.min.css +1 -1
  4. package/lib/css/atomic/borders.less +378 -378
  5. package/lib/css/atomic/colors.less +209 -209
  6. package/lib/css/atomic/flex.less +375 -375
  7. package/lib/css/atomic/grid.less +174 -174
  8. package/lib/css/atomic/misc.less +343 -343
  9. package/lib/css/atomic/spacing.less +332 -314
  10. package/lib/css/atomic/typography.less +273 -273
  11. package/lib/css/atomic/width-height.less +194 -194
  12. package/lib/css/base/body.less +44 -44
  13. package/lib/css/base/configuration-static.less +61 -61
  14. package/lib/css/base/icons.less +20 -20
  15. package/lib/css/base/internals.less +220 -220
  16. package/lib/css/base/reset-meyer.less +64 -64
  17. package/lib/css/base/reset-normalize.less +449 -449
  18. package/lib/css/base/reset.less +20 -20
  19. package/lib/css/components/activity-indicator.less +45 -45
  20. package/lib/css/components/avatars.less +189 -189
  21. package/lib/css/components/badges.less +209 -209
  22. package/lib/css/components/banners.less +80 -80
  23. package/lib/css/components/blank-states.less +26 -26
  24. package/lib/css/components/breadcrumbs.less +44 -44
  25. package/lib/css/components/button-groups.less +104 -104
  26. package/lib/css/components/buttons.less +665 -665
  27. package/lib/css/components/cards.less +44 -44
  28. package/lib/css/components/code-blocks.less +130 -130
  29. package/lib/css/components/collapsible.less +104 -104
  30. package/lib/css/components/inputs.less +728 -728
  31. package/lib/css/components/link-previews.less +136 -136
  32. package/lib/css/components/links.less +218 -218
  33. package/lib/css/components/menu.less +47 -47
  34. package/lib/css/components/modals.less +133 -133
  35. package/lib/css/components/navigation.less +146 -146
  36. package/lib/css/components/notices.less +233 -233
  37. package/lib/css/components/page-titles.less +60 -60
  38. package/lib/css/components/pagination.less +55 -55
  39. package/lib/css/components/popovers.less +197 -197
  40. package/lib/css/components/post-summary.less +425 -425
  41. package/lib/css/components/progress-bars.less +330 -330
  42. package/lib/css/components/prose.less +503 -503
  43. package/lib/css/components/spinner.less +107 -107
  44. package/lib/css/components/tables.less +341 -341
  45. package/lib/css/components/tags.less +236 -236
  46. package/lib/css/components/toggle-switches.less +144 -144
  47. package/lib/css/components/topbar.less +427 -427
  48. package/lib/css/components/uploader.less +210 -210
  49. package/lib/css/components/user-cards.less +169 -169
  50. package/lib/css/components/widget-dynamic.less +33 -33
  51. package/lib/css/components/widget-static.less +273 -273
  52. package/lib/css/exports/constants-colors.less +1092 -1092
  53. package/lib/css/exports/constants-helpers.less +108 -108
  54. package/lib/css/exports/constants-type.less +153 -153
  55. package/lib/css/exports/exports.less +15 -15
  56. package/lib/css/exports/mixins.less +237 -237
  57. package/lib/css/stacks-dynamic.less +35 -35
  58. package/lib/css/stacks-static.less +86 -86
  59. package/lib/css/stacks.less +13 -13
  60. package/lib/ts/controllers/index.ts +7 -7
  61. package/lib/ts/controllers/s-expandable-control.ts +188 -188
  62. package/lib/ts/controllers/s-modal.ts +321 -321
  63. package/lib/ts/controllers/s-navigation-tablist.ts +117 -117
  64. package/lib/ts/controllers/s-popover.ts +547 -547
  65. package/lib/ts/controllers/s-table.ts +220 -220
  66. package/lib/ts/controllers/s-tooltip.ts +246 -246
  67. package/lib/ts/controllers/s-uploader.ts +172 -172
  68. package/lib/ts/index.ts +20 -20
  69. package/lib/ts/stacks.ts +88 -88
  70. package/lib/tsconfig.json +13 -13
  71. package/package.json +87 -87
@@ -1,237 +1,237 @@
1
- //
2
- // TAGS
3
- //
4
- // TABLE OF CONTENTS
5
- // • BASE STYLE
6
- // • STYLE VARIATIONS
7
- // • LAYOUTS & SIZES
8
- //
9
- // ===========================================================================
10
- // $ MIXIN
11
- // Any tag we use will always modify the same items, so to save time,
12
- // here's a mixin to state all that CSS.
13
- // ---------------------------------------------------------------------------
14
-
15
- .s-tag-styles(@border: transparent, @background: transparent, @color: inherit) {
16
- border-color: @border;
17
- background-color: @background;
18
- color: @color;
19
-
20
- .highcontrast-mode({
21
- border-color: currentColor;
22
- });
23
-
24
- .s-tag--dismiss {
25
- color: inherit;
26
- background-color: transparent;
27
-
28
- &:hover {
29
- color: @background;
30
- background-color: @color;
31
-
32
- .highcontrast-mode({
33
- color: var(--white); // We do not want this color to remain fixed
34
- });
35
- }
36
- }
37
- }
38
-
39
- .s-tag-selected-styles(@border: transparent, @background: transparent, @color: inherit) {
40
- border-color: @border;
41
- background-color: @background;
42
- color: @color;
43
-
44
- .highcontrast-mode({
45
- border-color: currentColor;
46
- });
47
- }
48
-
49
- .s-tag-hover-styles(@border-hover: transparent, @background-hover: transparent, @color-hover: inherit) {
50
- &:hover,
51
- &:focus,
52
- &:active {
53
- border-color: @border-hover;
54
- background-color: @background-hover;
55
- color: @color-hover;
56
-
57
- .highcontrast-mode({
58
- border-color: currentColor;
59
- });
60
- }
61
- }
62
-
63
-
64
- // ===========================================================================
65
- // $ BASE STYLE
66
- // The same style is applied to all tags. Do not modify the core style.
67
- // ---------------------------------------------------------------------------
68
- .s-tag {
69
- display: inline-flex;
70
- align-items: center;
71
- justify-content: center;
72
- min-width: 0;
73
- padding-left: var(--su4);
74
- padding-right: var(--su4);
75
- border-style: solid;
76
- border-width: 1px;
77
- border-radius: var(--br-sm);
78
- font-size: var(--fs-caption);
79
- line-height: 1.846153846;
80
- text-decoration: none;
81
- vertical-align: middle;
82
- white-space: nowrap;
83
-
84
- .s-tag-styles(var(--theme-tag-border-color), var(--theme-tag-background-color), var(--theme-tag-color));
85
-
86
- .highcontrast-mode({ text-decoration: none; });
87
-
88
- &.is-selected {
89
- .s-tag-selected-styles(transparent, var(--theme-secondary-200), var(--theme-secondary-900));
90
- }
91
-
92
- // -- SIZES
93
- &.s-tag__xs {
94
- font-size: var(--fs-fine);
95
- line-height: 1.4;
96
- padding-left: var(--su2);
97
- padding-right: var(--su2);
98
- }
99
- &.s-tag__sm {
100
- font-size: var(--fs-caption);
101
- line-height: 1.5;
102
- }
103
- &.s-tag__md {
104
- padding-left: var(--su6);
105
- padding-right: var(--su6);
106
- font-size: var(--fs-body2);
107
- line-height: 1.733333333;
108
- }
109
- &.s-tag__lg {
110
- padding-left: var(--su6);
111
- padding-right: var(--su6);
112
- border-radius: calc(var(--br-sm) + 1px);
113
- font-size: var(--fs-subheading);
114
- line-height: 1.684210526;
115
- }
116
- }
117
-
118
- a.s-tag:not(.is-selected) {
119
- .s-tag-hover-styles(var(--theme-tag-hover-border-color), var(--theme-tag-hover-background-color), var(--theme-tag-hover-color));
120
- }
121
-
122
- // $$ DISMISS ICON
123
- // Style adjustment to @Svg.ClearSm
124
- // ---------------------------------------------------------------------------
125
- .s-tag--dismiss {
126
- display: flex;
127
- align-content: center;
128
- align-self: center;
129
- justify-content: center;
130
- width: var(--su-static16);
131
- height: var(--su-static16);
132
- margin-left: var(--su4);
133
- padding: var(--su1);
134
- border-radius: var(--br-sm);
135
- cursor: pointer;
136
-
137
- &:hover {
138
- color: var(--white);
139
- }
140
- }
141
-
142
- // $$ SPONSOR IMAGE
143
- // The small sponsor favicon displayed within a tag
144
- // ---------------------------------------------------------------------------
145
- .s-tag--sponsor {
146
- display: inline-flex;
147
- align-self: center;
148
- margin: calc(var(--su1) * -1) var(--su4) calc(var(--su2) * -1) calc(var(--su2) * -1);
149
- max-width: calc(var(--su-static16) + var(--su-static2));
150
- border-radius: calc(var(--br-sm) - 1px);
151
-
152
- .svg-icon,
153
- img {
154
- width: 100%;
155
- height: 100%;
156
- }
157
- }
158
-
159
-
160
- // ===========================================================================
161
- // $ STYLE VARIATIONS
162
- // This is what can be modified on each community (for the most part).
163
- // ===========================================================================
164
- // $$ Required Tag
165
- // ---------------------------------------------------------------------------
166
- .s-tag__required {
167
- .s-tag-styles(var(--bc-darker), var(--black-075), var(--black-700));
168
-
169
- &.is-selected {
170
- .s-tag-selected-styles(var(--black-500), var(--black-200), var(--black-900));
171
- }
172
- }
173
- a.s-tag__required:not(.is-selected) {
174
- .s-tag-hover-styles(var(--black-300), var(--black-100), var(--black-800));
175
- }
176
-
177
- // $$ Moderator Tag
178
- // ---------------------------------------------------------------------------
179
- .s-tag__moderator {
180
- .s-tag-styles(var(--red-200), var(--red-050), var(--red-800));
181
-
182
- &.is-selected {
183
- .s-tag-selected-styles(var(--red-400), var(--red-200), var(--red-800));
184
- }
185
- }
186
- a.s-tag__moderator:not(.is-selected) {
187
- .s-tag-hover-styles(var(--red-300), var(--red-100), var(--red-900));
188
- }
189
-
190
- // $$ Muted Tag
191
- // ---------------------------------------------------------------------------
192
- .s-tag__muted {
193
- .s-tag-styles(transparent, var(--black-075), var(--black-700));
194
-
195
- &.is-selected {
196
- .s-tag-selected-styles(transparent, var(--black-200), var(--black-900));
197
- }
198
- }
199
- a.s-tag__muted:not(.is-selected) {
200
- .s-tag-hover-styles(transparent, var(--black-100), var(--black-800));
201
- }
202
-
203
- // $$ Tag with Icons (watched, ignored)
204
- // ---------------------------------------------------------------------------
205
- .s-tag__watched,
206
- .s-tag__ignored {
207
- position: relative;
208
- padding-left: 22px;
209
-
210
- &:before {
211
- content: "";
212
- display: block;
213
- width: 14px;
214
- height: 14px;
215
- margin-right: var(--su2);
216
- background-color: currentColor;
217
- position: absolute;
218
- left: 4px;
219
- top: calc(50% - 7px);
220
- -webkit-mask: var(--s-tag-icon) no-repeat center;
221
- mask: var(--s-tag-icon) no-repeat center;
222
- -webkit-mask-size: contain;
223
- mask-size: contain;
224
- }
225
- }
226
-
227
- // $$ Watched Tag
228
- // ---------------------------------------------------------------------------
229
- .s-tag__watched {
230
- --s-tag-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='M7.05 1C2.63 1 0 6.5 0 6.5S2.63 12 7.05 12C11.38 12 14 6.5 14 6.5S11.37 1 7.05 1ZM7 10.17A3.59 3.59 0 0 1 3.5 6.5 3.6 3.6 0 0 1 7 2.83c1.94 0 3.5 1.65 3.5 3.67A3.57 3.57 0 0 1 7 10.17Zm0-1.84c.97 0 1.75-.81 1.75-1.83S7.97 4.67 7 4.67s-1.75.81-1.75 1.83S6.03 8.33 7 8.33Z'/%3E%3C/svg%3E");
231
- }
232
-
233
- // $$ Ignored Tag
234
- // ---------------------------------------------------------------------------
235
- .s-tag__ignored {
236
- --s-tag-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='M3.52 7.38 1.58 9.26A12.38 12.38 0 0 1 0 7s2.63-5.14 7.05-5.14c.66 0 1.28.12 1.86.32L7.44 3.6a3.48 3.48 0 0 0-3.92 3.78ZM5.3 9.99c.5.28 1.1.44 1.71.44 1.94 0 3.5-1.53 3.5-3.43 0-.62-.17-1.21-.47-1.72L8.7 6.6a1.73 1.73 0 0 1-2.08 2.07L5.29 10Zm6.23-6.19A12.7 12.7 0 0 1 14 7s-2.63 5.14-6.95 5.14A6.1 6.1 0 0 1 4 11.3L2.27 13l-1.4-1.36L11.9 1l1.23 1.2-1.6 1.6Z'/%3E%3C/svg%3E");
1
+ //
2
+ // TAGS
3
+ //
4
+ // TABLE OF CONTENTS
5
+ // • BASE STYLE
6
+ // • STYLE VARIATIONS
7
+ // • LAYOUTS & SIZES
8
+ //
9
+ // ===========================================================================
10
+ // $ MIXIN
11
+ // Any tag we use will always modify the same items, so to save time,
12
+ // here's a mixin to state all that CSS.
13
+ // ---------------------------------------------------------------------------
14
+
15
+ .s-tag-styles(@border: transparent, @background: transparent, @color: inherit) {
16
+ border-color: @border;
17
+ background-color: @background;
18
+ color: @color;
19
+
20
+ .highcontrast-mode({
21
+ border-color: currentColor;
22
+ });
23
+
24
+ .s-tag--dismiss {
25
+ color: inherit;
26
+ background-color: transparent;
27
+
28
+ &:hover {
29
+ color: @background;
30
+ background-color: @color;
31
+
32
+ .highcontrast-mode({
33
+ color: var(--white); // We do not want this color to remain fixed
34
+ });
35
+ }
36
+ }
37
+ }
38
+
39
+ .s-tag-selected-styles(@border: transparent, @background: transparent, @color: inherit) {
40
+ border-color: @border;
41
+ background-color: @background;
42
+ color: @color;
43
+
44
+ .highcontrast-mode({
45
+ border-color: currentColor;
46
+ });
47
+ }
48
+
49
+ .s-tag-hover-styles(@border-hover: transparent, @background-hover: transparent, @color-hover: inherit) {
50
+ &:hover,
51
+ &:focus,
52
+ &:active {
53
+ border-color: @border-hover;
54
+ background-color: @background-hover;
55
+ color: @color-hover;
56
+
57
+ .highcontrast-mode({
58
+ border-color: currentColor;
59
+ });
60
+ }
61
+ }
62
+
63
+
64
+ // ===========================================================================
65
+ // $ BASE STYLE
66
+ // The same style is applied to all tags. Do not modify the core style.
67
+ // ---------------------------------------------------------------------------
68
+ .s-tag {
69
+ display: inline-flex;
70
+ align-items: center;
71
+ justify-content: center;
72
+ min-width: 0;
73
+ padding-left: var(--su4);
74
+ padding-right: var(--su4);
75
+ border-style: solid;
76
+ border-width: 1px;
77
+ border-radius: var(--br-sm);
78
+ font-size: var(--fs-caption);
79
+ line-height: 1.846153846;
80
+ text-decoration: none;
81
+ vertical-align: middle;
82
+ white-space: nowrap;
83
+
84
+ .s-tag-styles(var(--theme-tag-border-color), var(--theme-tag-background-color), var(--theme-tag-color));
85
+
86
+ .highcontrast-mode({ text-decoration: none; });
87
+
88
+ &.is-selected {
89
+ .s-tag-selected-styles(transparent, var(--theme-secondary-200), var(--theme-secondary-900));
90
+ }
91
+
92
+ // -- SIZES
93
+ &.s-tag__xs {
94
+ font-size: var(--fs-fine);
95
+ line-height: 1.4;
96
+ padding-left: var(--su2);
97
+ padding-right: var(--su2);
98
+ }
99
+ &.s-tag__sm {
100
+ font-size: var(--fs-caption);
101
+ line-height: 1.5;
102
+ }
103
+ &.s-tag__md {
104
+ padding-left: var(--su6);
105
+ padding-right: var(--su6);
106
+ font-size: var(--fs-body2);
107
+ line-height: 1.733333333;
108
+ }
109
+ &.s-tag__lg {
110
+ padding-left: var(--su6);
111
+ padding-right: var(--su6);
112
+ border-radius: calc(var(--br-sm) + 1px);
113
+ font-size: var(--fs-subheading);
114
+ line-height: 1.684210526;
115
+ }
116
+ }
117
+
118
+ a.s-tag:not(.is-selected) {
119
+ .s-tag-hover-styles(var(--theme-tag-hover-border-color), var(--theme-tag-hover-background-color), var(--theme-tag-hover-color));
120
+ }
121
+
122
+ // $$ DISMISS ICON
123
+ // Style adjustment to @Svg.ClearSm
124
+ // ---------------------------------------------------------------------------
125
+ .s-tag--dismiss {
126
+ display: flex;
127
+ align-content: center;
128
+ align-self: center;
129
+ justify-content: center;
130
+ width: var(--su-static16);
131
+ height: var(--su-static16);
132
+ margin-left: var(--su4);
133
+ padding: var(--su1);
134
+ border-radius: var(--br-sm);
135
+ cursor: pointer;
136
+
137
+ &:hover {
138
+ color: var(--white);
139
+ }
140
+ }
141
+
142
+ // $$ SPONSOR IMAGE
143
+ // The small sponsor favicon displayed within a tag
144
+ // ---------------------------------------------------------------------------
145
+ .s-tag--sponsor {
146
+ display: inline-flex;
147
+ align-self: center;
148
+ margin: calc(var(--su1) * -1) var(--su4) calc(var(--su2) * -1) calc(var(--su2) * -1);
149
+ max-width: calc(var(--su-static16) + var(--su-static2));
150
+ border-radius: calc(var(--br-sm) - 1px);
151
+
152
+ .svg-icon,
153
+ img {
154
+ width: 100%;
155
+ height: 100%;
156
+ }
157
+ }
158
+
159
+
160
+ // ===========================================================================
161
+ // $ STYLE VARIATIONS
162
+ // This is what can be modified on each community (for the most part).
163
+ // ===========================================================================
164
+ // $$ Required Tag
165
+ // ---------------------------------------------------------------------------
166
+ .s-tag__required {
167
+ .s-tag-styles(var(--bc-darker), var(--black-075), var(--black-700));
168
+
169
+ &.is-selected {
170
+ .s-tag-selected-styles(var(--black-500), var(--black-200), var(--black-900));
171
+ }
172
+ }
173
+ a.s-tag__required:not(.is-selected) {
174
+ .s-tag-hover-styles(var(--black-300), var(--black-100), var(--black-800));
175
+ }
176
+
177
+ // $$ Moderator Tag
178
+ // ---------------------------------------------------------------------------
179
+ .s-tag__moderator {
180
+ .s-tag-styles(var(--red-200), var(--red-050), var(--red-800));
181
+
182
+ &.is-selected {
183
+ .s-tag-selected-styles(var(--red-400), var(--red-200), var(--red-800));
184
+ }
185
+ }
186
+ a.s-tag__moderator:not(.is-selected) {
187
+ .s-tag-hover-styles(var(--red-300), var(--red-100), var(--red-900));
188
+ }
189
+
190
+ // $$ Muted Tag
191
+ // ---------------------------------------------------------------------------
192
+ .s-tag__muted {
193
+ .s-tag-styles(transparent, var(--black-075), var(--black-700));
194
+
195
+ &.is-selected {
196
+ .s-tag-selected-styles(transparent, var(--black-200), var(--black-900));
197
+ }
198
+ }
199
+ a.s-tag__muted:not(.is-selected) {
200
+ .s-tag-hover-styles(transparent, var(--black-100), var(--black-800));
201
+ }
202
+
203
+ // $$ Tag with Icons (watched, ignored)
204
+ // ---------------------------------------------------------------------------
205
+ .s-tag__watched,
206
+ .s-tag__ignored {
207
+ position: relative;
208
+ padding-left: 22px;
209
+
210
+ &:before {
211
+ content: "";
212
+ display: block;
213
+ width: 14px;
214
+ height: 14px;
215
+ margin-right: var(--su2);
216
+ background-color: currentColor;
217
+ position: absolute;
218
+ left: 4px;
219
+ top: calc(50% - 7px);
220
+ -webkit-mask: var(--s-tag-icon) no-repeat center;
221
+ mask: var(--s-tag-icon) no-repeat center;
222
+ -webkit-mask-size: contain;
223
+ mask-size: contain;
224
+ }
225
+ }
226
+
227
+ // $$ Watched Tag
228
+ // ---------------------------------------------------------------------------
229
+ .s-tag__watched {
230
+ --s-tag-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='M7.05 1C2.63 1 0 6.5 0 6.5S2.63 12 7.05 12C11.38 12 14 6.5 14 6.5S11.37 1 7.05 1ZM7 10.17A3.59 3.59 0 0 1 3.5 6.5 3.6 3.6 0 0 1 7 2.83c1.94 0 3.5 1.65 3.5 3.67A3.57 3.57 0 0 1 7 10.17Zm0-1.84c.97 0 1.75-.81 1.75-1.83S7.97 4.67 7 4.67s-1.75.81-1.75 1.83S6.03 8.33 7 8.33Z'/%3E%3C/svg%3E");
231
+ }
232
+
233
+ // $$ Ignored Tag
234
+ // ---------------------------------------------------------------------------
235
+ .s-tag__ignored {
236
+ --s-tag-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='M3.52 7.38 1.58 9.26A12.38 12.38 0 0 1 0 7s2.63-5.14 7.05-5.14c.66 0 1.28.12 1.86.32L7.44 3.6a3.48 3.48 0 0 0-3.92 3.78ZM5.3 9.99c.5.28 1.1.44 1.71.44 1.94 0 3.5-1.53 3.5-3.43 0-.62-.17-1.21-.47-1.72L8.7 6.6a1.73 1.73 0 0 1-2.08 2.07L5.29 10Zm6.23-6.19A12.7 12.7 0 0 1 14 7s-2.63 5.14-6.95 5.14A6.1 6.1 0 0 1 4 11.3L2.27 13l-1.4-1.36L11.9 1l1.23 1.2-1.6 1.6Z'/%3E%3C/svg%3E");
237
237
  }