@stackoverflow/stacks 1.4.2 → 1.6.0

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 (31) hide show
  1. package/dist/css/stacks.css +3565 -2093
  2. package/dist/css/stacks.min.css +1 -1
  3. package/lib/css/atomic/colors.less +1 -1
  4. package/lib/css/atomic/flex.less +53 -2
  5. package/lib/css/components/activity-indicator.less +3 -3
  6. package/lib/css/components/badges.less +11 -11
  7. package/lib/css/components/button-groups.less +59 -83
  8. package/lib/css/components/buttons.less +384 -585
  9. package/lib/css/components/code-blocks.less +98 -125
  10. package/lib/css/components/expandable.less +69 -59
  11. package/lib/css/components/inputs.less +38 -24
  12. package/lib/css/components/link-previews.less +110 -122
  13. package/lib/css/components/links.less +0 -16
  14. package/lib/css/components/modals.less +95 -120
  15. package/lib/css/components/notices.less +187 -180
  16. package/lib/css/components/popovers.less +132 -181
  17. package/lib/css/components/post-summary.less +0 -9
  18. package/lib/css/components/progress-bars.less +236 -297
  19. package/lib/css/components/prose.less +293 -380
  20. package/lib/css/components/sidebar-widgets.less +251 -0
  21. package/lib/css/components/spinner.less +54 -104
  22. package/lib/css/components/tables.less +0 -24
  23. package/lib/css/components/toggle-switches.less +69 -120
  24. package/lib/css/components/topbar.less +10 -11
  25. package/lib/css/components/user-cards.less +91 -144
  26. package/lib/css/stacks-dynamic.less +0 -1
  27. package/lib/css/stacks-static.less +1 -1
  28. package/package.json +11 -11
  29. package/lib/css/components/_styles-template.less +0 -78
  30. package/lib/css/components/widget-dynamic.less +0 -33
  31. package/lib/css/components/widget-static.less +0 -274
@@ -1,14 +1,3 @@
1
- //
2
- // STACK OVERFLOW
3
- // TOPBAR
4
- //
5
- // This CSS comes from Stacks, our CSS & Pattern library for rapidly building
6
- // Stack Overflow. For documentation of all these classes and how to contribute,
7
- // visit https://stackoverflow.design/
8
- //
9
- // ============================================================================
10
- // $ BASE STYLE
11
- // ----------------------------------------------------------------------------
12
1
  .topbar-notice-styles(@border: transparent, @background: transparent, @color: inherit) {
13
2
  border-color: @border;
14
3
  background-color: @background;
@@ -252,6 +241,15 @@
252
241
  // ===========================================================================
253
242
  // $ CONTENT & CTAS
254
243
  // ---------------------------------------------------------------------------
244
+ .s-topbar--navigation {
245
+ display: flex;
246
+ height: 100%;
247
+
248
+ overflow-x: auto; // Allow this content to scroll if it gets too long
249
+ @scrollbar-styles(); // Style the scrollbars
250
+ margin-left: auto; // Push this section as far to the right as possible
251
+ }
252
+
255
253
  .s-topbar .s-topbar--content {
256
254
  display: flex;
257
255
  height: 100%;
@@ -261,6 +259,7 @@
261
259
  display: inline-flex;
262
260
  }
263
261
 
262
+ // TODO remove once all topbars include necessary nav.s-topbar--navigation wrapper elements
264
263
  overflow-x: auto; // Allow this content to scroll if it gets too long
265
264
  @scrollbar-styles(); // Style the scrollbars
266
265
  margin-left: auto; // Push this section as far to the right as possible
@@ -1,173 +1,120 @@
1
- //
2
- // STACK OVERFLOW
3
- // USER CARDS
4
- //
5
- // This CSS comes from Stacks, our CSS & Pattern library for rapidly building
6
- // Stack Overflow. For documentation of all these classes and how to contribute,
7
- // visit https://stackoverflow.design/
8
- //
9
- // ============================================================================
10
- // $ BASE
11
- // ----------------------------------------------------------------------------
12
-
13
1
  .s-user-card {
14
- display: grid;
15
- grid-template-columns: auto 1fr;
16
- column-gap: var(--su8);
17
- row-gap: var(--su4);
18
- align-items: center;
19
- line-height: 1;
20
- padding: var(--su8);
21
-
22
- // ===========================================================================
23
- // $ STYLE VARIATIONS
24
- // Modify the presentation of the user card
25
- // ===========================================================================
26
- // $$ Highlighted
27
- // ---------------------------------------------------------------------------
28
- &.s-user-card__highlighted {
29
- background-color: var(--theme-secondary-050);
30
- border-radius: var(--br-md);
31
-
32
- .s-user-card--time {
33
- color: var(--black-600);
34
- }
35
-
36
- .s-user-card--type {
37
- color: var(--black-700);
38
- }
2
+ --_uc-ai: center;
3
+ --_uc-bg: unset;
4
+ --_uc-bar: unset;
5
+ --_uc-d: grid;
6
+ --_uc-fc: unset;
7
+ --_uc-g: var(--su4) var(--su8);
8
+ --_uc-p: var(--su8);
9
+ --_uc-info-ai: unset;
10
+ --_uc-info-fd: column;
11
+ --_uc-link-fs: var(--fs-caption);
12
+ --_uc-link-ws: unset;
13
+ --_uc-rep-fc: unset;
14
+ --_uc-time-fc: var(--black-500);
15
+ --_uc-time-ws: unset;
16
+ --_uc-type-fc: var(--theme-primary-400);
17
+
18
+ // MODIFIERS
19
+ &&__deleted {
20
+ --_uc-fc: var(--black-500);
21
+ }
22
+ &&__highlighted {
23
+ --_uc-bg: var(--theme-secondary-050);
24
+ --_uc-bar: var(--br-md);
25
+ --_uc-time-fc: var(--black-600);
26
+ --_uc-type-fc: var(--black-700);
39
27
  }
40
28
 
41
- // $$ Full meta data
42
- // ---------------------------------------------------------------------------
43
- &.s-user-card__full {
44
- align-items: flex-start;
29
+ // VARIANTS
30
+ &&__minimal,
31
+ &&__small {
32
+ --_uc-d: flex;
33
+ --_uc-g: var(--su4);
34
+ --_uc-p: 0;
35
+ --_uc-info-ai: center;
36
+ --_uc-info-fd: row;
45
37
 
46
- .s-user-card--link {
47
- font-size: var(--fs-body2);
48
- }
38
+ }
39
+ &&__full {
40
+ --_uc-ai: flex-start;
41
+ --_uc-link-fs: var(--fs-body2);
42
+ }
43
+ &&__minimal {
44
+ --_uc-link-ws: nowrap;
45
+ --_uc-rep-fc: var(--black-600);
46
+ --_uc-time-ws: nowrap;
49
47
  }
50
48
 
51
- // $$ Deleted
52
- // ---------------------------------------------------------------------------
53
- &.s-user-card__deleted {
49
+ // CHILD ELEMENTS
50
+ & &--location,
51
+ & &--role {
52
+ font-size: var(--fs-caption);
54
53
  color: var(--black-500);
55
54
  }
55
+ & &--awards {
56
+ li {
57
+ font-size: var(--fs-caption);
58
+ }
56
59
 
57
- // $$ Small size
58
- // ---------------------------------------------------------------------------
59
- &.s-user-card__small {
60
- display: flex;
60
+ .list-reset;
61
61
  align-items: center;
62
- gap: var(--su4);
63
- padding: 0;
64
-
65
- .s-user-card--info {
66
- flex-direction: row;
67
- align-items: center;
68
- }
62
+ display: flex;
63
+ gap: var(--su6);
69
64
  }
65
+ & &--info {
66
+ align-items: var(--_uc-info-ai);
67
+ flex-direction: var(--_uc-info-fd);
70
68
 
71
- // $$ A minimal presentation
72
- // ---------------------------------------------------------------------------
73
- &.s-user-card__minimal {
74
69
  display: flex;
75
- align-items: center;
76
70
  gap: var(--su4);
77
- padding: 0;
78
-
79
- .s-user-card--time {
80
- white-space: nowrap;
81
- }
82
-
83
- .s-user-card--link {
84
- white-space: nowrap;
85
- }
71
+ }
72
+ & &--link {
73
+ font-size: var(--_uc-link-fs);
74
+ white-space: var(--_uc-link-ws);
86
75
 
87
- .s-user-card--rep {
88
- color: var(--black-600);
89
- }
76
+ align-items: center;
77
+ flex-wrap: wrap;
78
+ min-width: 0; // Allow things to wrap
79
+ overflow-wrap: break-word;
80
+ }
81
+ & &--rep {
82
+ color: var(--_uc-rep-fc);
90
83
 
91
- .s-user-card--info {
92
- flex-direction: row;
93
- align-items: center;
94
- }
84
+ font-weight: 700;
95
85
  }
86
+ & &--tags {
87
+ align-items: center;
88
+ min-width: 0; // Allow things to wrap
89
+ flex-wrap: wrap;
90
+ }
91
+ & &--time {
92
+ color: var(--_uc-time-fc);
93
+ white-space: var(--_uc-time-ws);
96
94
 
97
- .s-user-card--type {
98
- grid-column: ~"1 / 3";
99
95
  font-size: var(--fs-caption);
100
- color: var(--theme-primary-400);
101
-
96
+ grid-column: ~"1 / 3";
97
+ grid-row: ~"1 / 2";
98
+ }
99
+ & &--type {
102
100
  a {
103
101
  color: inherit;
104
102
  }
105
- }
106
- }
107
103
 
108
- // $ USER CARD TIME
109
- // Optional element used for displaying time since an action happened
110
- // ---------------------------------------------------------------------------
111
- .s-user-card--time {
112
- grid-column: ~"1 / 3";
113
- grid-row: ~"1 / 2";
114
- color: var(--black-500);
115
- font-size: var(--fs-caption);
116
- }
104
+ color: var(--_uc-type-fc);
117
105
 
118
- // $ USER INFO CONTAINER
119
- // An optional container for extra meta info that applies a
120
- // vertical grid layout
121
- // ---------------------------------------------------------------------------
122
- .s-user-card--info {
123
- display: flex;
124
- flex-direction: column;
125
- gap: var(--su4);
126
- }
127
-
128
- // $ USER LINK
129
- // Styles the link to the user's profile appropriately
130
- // ---------------------------------------------------------------------------
131
- .s-user-card--link {
132
- min-width: 0; // Allow things to wrap
133
- font-size: var(--fs-caption);
134
- align-items: center;
135
- flex-wrap: wrap;
136
- overflow-wrap: break-word;
137
- }
138
-
139
- // $ AWARDS CONTAINER
140
- // A container for reputation and various awards
141
- // ---------------------------------------------------------------------------
142
- .s-user-card--awards {
143
- .list-reset;
144
- display: flex;
145
- align-items: center;
146
- gap: var(--su6);
147
-
148
- li {
149
106
  font-size: var(--fs-caption);
107
+ grid-column: ~"1 / 3";
150
108
  }
151
- }
152
-
153
- .s-user-card--rep {
154
- font-weight: 700;
155
- }
156
109
 
157
- // $ USER META DATA
158
- // Add the proper styling to various user data
159
- // ---------------------------------------------------------------------------
160
- .s-user-card--location,
161
- .s-user-card--role {
162
- font-size: var(--fs-caption);
163
- color: var(--black-500);
164
- }
110
+ align-items: var(--_uc-ai);
111
+ background-color: var(--_uc-bg);
112
+ border-radius: var(--_uc-bar);
113
+ color: var(--_uc-fc);
114
+ display: var(--_uc-d);
115
+ gap: var(--_uc-g);
165
116
 
166
- // $ TAGS CONTAINER
167
- // Apply layout to a bunch of child tags
168
- // ---------------------------------------------------------------------------
169
- .s-user-card--tags {
170
- min-width: 0; // Allow things to wrap
171
- align-items: center;
172
- flex-wrap: wrap;
117
+ grid-template-columns: auto 1fr;
118
+ line-height: 1;
119
+ padding: var(--_uc-p);
173
120
  }
@@ -24,7 +24,6 @@
24
24
  @import "components/notices.less";
25
25
  @import "components/tags.less";
26
26
  @import "components/pagination.less";
27
- @import "components/widget-dynamic.less";
28
27
 
29
28
  // -- LESS CONSTANTS AND MIXINS
30
29
  @import "exports/exports.less";
@@ -37,13 +37,13 @@
37
37
  @import "components/post-summary.less";
38
38
  @import "components/progress-bars.less";
39
39
  @import "components/prose.less";
40
+ @import "components/sidebar-widgets.less";
40
41
  @import "components/spinner.less";
41
42
  @import "components/tables.less";
42
43
  @import "components/toggle-switches.less";
43
44
  @import "components/topbar.less";
44
45
  @import "components/uploader.less";
45
46
  @import "components/user-cards.less";
46
- @import "components/widget-static.less";
47
47
 
48
48
  // -- LESS CONSTANTS AND MIXINS
49
49
  @import "exports/exports.less";
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "type": "git",
6
6
  "url": "https://github.com/StackExchange/Stacks.git"
7
7
  },
8
- "version": "1.4.2",
8
+ "version": "1.6.0",
9
9
  "files": [
10
10
  "dist",
11
11
  "lib"
@@ -38,16 +38,16 @@
38
38
  "@highlightjs/cdn-assets": "^11.6.0",
39
39
  "@stackoverflow/stacks-editor": "^0.8.2",
40
40
  "@stackoverflow/stacks-icons": "^3.1.0",
41
- "@typescript-eslint/eslint-plugin": "^5.40.0",
42
- "@typescript-eslint/parser": "^5.40.0",
43
- "backstopjs": "^6.1.3",
44
- "concurrently": "^7.4.0",
45
- "css-loader": "^6.7.1",
46
- "cssnano": "^5.1.13",
41
+ "@typescript-eslint/eslint-plugin": "^5.42.0",
42
+ "@typescript-eslint/parser": "^5.44.0",
43
+ "backstopjs": "^6.1.4",
44
+ "concurrently": "^7.5.0",
45
+ "css-loader": "^6.7.2",
46
+ "cssnano": "^5.1.14",
47
47
  "docsearch.js": "^2.6.3",
48
48
  "eleventy-plugin-highlightjs": "^1.1.0",
49
49
  "eleventy-plugin-nesting-toc": "^1.3.0",
50
- "eslint": "^8.25.0",
50
+ "eslint": "^8.27.0",
51
51
  "eslint-config-prettier": "^8.5.0",
52
52
  "eslint-plugin-no-unsanitized": "^4.0.1",
53
53
  "jquery": "^3.6.1",
@@ -58,14 +58,14 @@
58
58
  "postcss-less": "^6.0.0",
59
59
  "postcss-loader": "^7.0.1",
60
60
  "prettier": "^2.7.1",
61
- "stylelint": "^14.13.0",
61
+ "stylelint": "^14.15.0",
62
62
  "stylelint-config-recommended": "^9.0.0",
63
63
  "stylelint-config-standard": "^29.0.0",
64
64
  "terser-webpack-plugin": "^5.3.6",
65
65
  "ts-loader": "^9.4.1",
66
66
  "typescript": "^4.8.4",
67
- "webpack": "^5.74.0",
68
- "webpack-cli": "^4.10.0",
67
+ "webpack": "^5.75.0",
68
+ "webpack-cli": "^5.0.0",
69
69
  "webpack-merge": "^5.8.0"
70
70
  },
71
71
  "browserslist": [
@@ -1,78 +0,0 @@
1
- // This is an example of the expected structure for component-specific styles
2
- // In some cases, deviations from this structure are warranted if we need to maintain a legacy structure
3
- .s-component-name {
4
- // BASE COMPONENT-SPECIFIC CUSTOM PROPERTIES
5
- // --_{component-abbreviation}-{property-shorthand}: {value};
6
- --_cn-bg: var(--blue-500);
7
- --_cn-h: var(--su-static16);
8
- --_cn-fd: row-reverse;
9
- // VARIANT CUSTOM PROPERTIES
10
- // --_{component-abbreviation}-{property-shorthand}-{variant-name}: {value};
11
- --_cn-fc-filled: var(--green-500);
12
- // CHILD COMPONENT CUSTOM PROPERTIES
13
- // --_{component-abreviation}-{child-component-name}-{property-shorthand}: {value};
14
- --_cn-image-bg: var(--red-500);
15
-
16
- // CONTEXTUAL STYLES
17
- // These may include themes/modes, responsive styles, or modifications based on parent containers
18
- .highcontrast-mode({
19
- --_cn-bg: var(--black-400);
20
-
21
- .s-avatar--letter {
22
- --_cn-image-bg: var(--white);
23
- }
24
- });
25
- .s-special-parent & {
26
- --_cn-bg: transparent;
27
- }
28
-
29
- // STATES
30
- // These are generally classes prefixed with `.is-` or `.has-`
31
- &.is-selected {
32
- --_cn-bg: var(--orange-200);
33
- }
34
-
35
- // MODIFIERS
36
- // Modifiers are considered to be classes that can be combined with other modifiers outside of their respective groupings without collisions
37
- // Sizes
38
- &&__xs {
39
- --_cn-h: var(--su-static2);
40
- }
41
- &&__sm {
42
- --_cn-h: var(--su-static12);
43
- }
44
- // Orientation
45
- &&__vertical {
46
- --_cn-fd: column;
47
- }
48
-
49
- // VARIANTS
50
- // Variants are expected to be used exclusive of one another. In other words, you should only use one variant class at a time
51
- &&__info {
52
- --_cn-bg: var(--yellow-100);
53
-
54
- &.s-component-name__filled {
55
- --_cn-bg-filled: var(--yellow-800);
56
- }
57
- }
58
-
59
- // CHILD ELEMENTS
60
- & &--image {
61
- background-color: var(--_cn-image-bg);
62
- }
63
-
64
- // INTERACTION
65
- &:hover {
66
- --_cn-bg: var(--_black-050);
67
- }
68
-
69
- // STYLES MODIFIED BY COMPONENT-SPECIFIC CUSTOM PROPERTIES
70
- background-color: var(--_cn-bg-filled, var(--_cn-bg));
71
- flex-direction: var(--_cn-fd);
72
- height: var(--_cn-h);
73
-
74
- // STATIC COMPONENT STYLES
75
- display: flex;
76
- position: relative;
77
- vertical-align: bottom;
78
- }
@@ -1,33 +0,0 @@
1
- //
2
- // STACK OVERFLOW
3
- // SIDEBAR WIDGET -- DYNAMIC PARTS
4
- //
5
- // This CSS comes from Stacks, our CSS & Pattern library for rapidly building
6
- // Stack Overflow. For documentation of all these classes and how to contribute,
7
- // visit https://stackoverflow.design/
8
- //
9
- // This file only sets the colors for the "current color" highlight when the
10
- // widget is used for navigation. This is the only part of the widget that is
11
- // dynamically configurable; the rest can be served in the static part of Stacks
12
- // and is in widget-static.less.
13
-
14
- .s-sidebarwidget--item {
15
- &,
16
- & > :first-child {
17
- &[aria-current="true"],
18
- &[aria-current="page"] {
19
- &:before {
20
- border-left-color: var(--theme-primary-color);
21
- }
22
- }
23
- }
24
- }
25
-
26
- .s-sidebarwidget--subnav {
27
- li {
28
- &[aria-current="true"],
29
- &[aria-current="page"] {
30
- #stacks-internals #bullet-arrow(var(--theme-primary-color));
31
- }
32
- }
33
- }