@stackoverflow/stacks 3.0.0-beta.13 → 3.0.0-beta.14
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.
- package/dist/css/stacks.css +386 -185
- package/dist/css/stacks.min.css +1 -1
- package/lib/components/checkbox_radio/checkbox_radio.less +195 -113
- package/lib/components/description/description.less +15 -1
- package/lib/components/empty-state/empty-state.less +17 -6
- package/lib/components/form-group/form-group.less +25 -0
- package/lib/components/input_textarea/input_textarea.less +13 -12
- package/lib/components/menu/menu.less +5 -22
- package/lib/components/table/table.less +0 -8
- package/lib/components/vote/vote.less +134 -0
- package/lib/stacks-static.less +2 -2
- package/lib/tsconfig.json +1 -1
- package/package.json +1 -1
- package/lib/components/check-control/check-control.less +0 -17
- package/lib/components/check-group/check-group.less +0 -19
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
.s-vote {
|
|
2
|
+
--_vo-fd: column;
|
|
3
|
+
--_vo-child-bg: var(--black-150);
|
|
4
|
+
--_vo-child-br: unset;
|
|
5
|
+
--_vo-child-fd: var(--_vo-fd);
|
|
6
|
+
--_vo-child-g: calc(var(--su8) + var(--su2)); // 10px
|
|
7
|
+
--_vo-child-h: unset;
|
|
8
|
+
--_vo-child-w: calc(var(--su48) + var(--su2)); // 50px
|
|
9
|
+
--_vo-child-p: unset;
|
|
10
|
+
|
|
11
|
+
// CHILD ELEMENTS
|
|
12
|
+
&:not(&__horizontal){
|
|
13
|
+
:first-child {
|
|
14
|
+
--_vo-child-p: calc(var(--su12) + var(--su2)) 0 calc(var(--su12) - var(--su2)); // 14px 0 10px
|
|
15
|
+
--_vo-child-br: var(--br-pill) var(--br-pill) 0 0;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
:last-child {
|
|
19
|
+
--_vo-child-p: calc(var(--su12) - var(--su2)) 0 calc(var(--su12) + var(--su2)); // 10px 0 14px
|
|
20
|
+
--_vo-child-br: 0 0 var(--br-pill) var(--br-pill);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
:only-child {
|
|
24
|
+
--_vo-child-br: var(--br-pill);
|
|
25
|
+
--_vo-child-g: calc(var(--su16) + var(--su4)); // 18px
|
|
26
|
+
--_vo-child-p: calc(var(--su12) + var(--su2)) 0; // 14px 0
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// MODIFIERS
|
|
31
|
+
&&__expanded {
|
|
32
|
+
--_vo-child-g: var(--su2);
|
|
33
|
+
--_vo-child-p: 0;
|
|
34
|
+
|
|
35
|
+
.s-vote {
|
|
36
|
+
&--total {
|
|
37
|
+
display: none;
|
|
38
|
+
}
|
|
39
|
+
&--upvotes,
|
|
40
|
+
&--downvotes {
|
|
41
|
+
display: block;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&&__horizontal {
|
|
47
|
+
--_vo-fd: row;
|
|
48
|
+
--_vo-child-h: var(--su32);
|
|
49
|
+
--_vo-child-p: 0 var(--su4);
|
|
50
|
+
--_vo-child-w: unset;
|
|
51
|
+
|
|
52
|
+
:first-child {
|
|
53
|
+
--_vo-child-p: 0 var(--su6) 0 calc(var(--su8) + var(--su2)); // 0 6px 0 10px
|
|
54
|
+
--_vo-child-br: var(--br-pill) 0 0 var(--br-pill);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
:last-child {
|
|
58
|
+
--_vo-child-p: 0 calc(var(--su8) + var(--su2)) 0 var(--su6); // 0 10px 0 6px
|
|
59
|
+
--_vo-child-br: 0 var(--br-pill) var(--br-pill) 0;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.s-vote--votes:last-child:not(:only-child) {
|
|
63
|
+
--_vo-child-p: 0 calc(var(--su12) + var(--su2)) 0 var(--su4); // 0 14px 0 4px
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
:only-child {
|
|
67
|
+
--_vo-child-br: var(--br-pill);
|
|
68
|
+
--_vo-child-g: calc(var(--su8) + var(--su2)); // 10px
|
|
69
|
+
--_vo-child-p: 0 calc(var(--su12) + var(--su2)) 0 calc(var(--su8) + var(--su2)); // 0 10px
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// CHILD ELEMENTS
|
|
74
|
+
> button {
|
|
75
|
+
// Reset button styles
|
|
76
|
+
appearance: none;
|
|
77
|
+
-webkit-appearance: none;
|
|
78
|
+
background: none;
|
|
79
|
+
border: 0;
|
|
80
|
+
color: inherit;
|
|
81
|
+
cursor: pointer;
|
|
82
|
+
font: inherit;
|
|
83
|
+
margin: 0;
|
|
84
|
+
padding: 0;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
& &--btn,
|
|
88
|
+
& > &--votes {
|
|
89
|
+
background-color: var(--_vo-child-bg);
|
|
90
|
+
border-radius: var(--_vo-child-br);
|
|
91
|
+
flex-direction: var(--_vo-child-fd);
|
|
92
|
+
gap: var(--_vo-child-g);
|
|
93
|
+
height: var(--_vo-child-h);
|
|
94
|
+
padding: var(--_vo-child-p);
|
|
95
|
+
width: var(--_vo-child-w);
|
|
96
|
+
|
|
97
|
+
align-items: center;
|
|
98
|
+
display: inline-flex;
|
|
99
|
+
justify-content: center;
|
|
100
|
+
overflow: hidden;
|
|
101
|
+
font-weight: 600;
|
|
102
|
+
text-align: center;
|
|
103
|
+
white-space: nowrap;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
& &--upvotes,
|
|
107
|
+
& &--downvotes {
|
|
108
|
+
display: none;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
& &--upvotes {
|
|
112
|
+
color: var(--green-500);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
& &--downvotes {
|
|
116
|
+
color: var(--red-500);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// INTERACTION
|
|
120
|
+
> button,
|
|
121
|
+
& &--btn {
|
|
122
|
+
&:focus-visible {
|
|
123
|
+
.focus-styles(true, false);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
&:hover {
|
|
127
|
+
--_vo-child-bg: var(--black-200);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
flex-direction: var(--_vo-fd);
|
|
132
|
+
|
|
133
|
+
display: flex;
|
|
134
|
+
}
|
package/lib/stacks-static.less
CHANGED
|
@@ -17,9 +17,8 @@
|
|
|
17
17
|
@import "components/button/button.less";
|
|
18
18
|
@import "components/button-group/button-group.less";
|
|
19
19
|
@import "components/card/card.less";
|
|
20
|
-
@import "components/check-control/check-control.less";
|
|
21
|
-
@import "components/check-group/check-group.less";
|
|
22
20
|
@import "components/checkbox_radio/checkbox_radio.less";
|
|
21
|
+
@import "components/form-group/form-group.less";
|
|
23
22
|
@import "components/code-block/code-block.less";
|
|
24
23
|
@import "components/description/description.less";
|
|
25
24
|
@import "components/empty-state/empty-state.less";
|
|
@@ -53,6 +52,7 @@
|
|
|
53
52
|
@import "components/topbar/topbar.less";
|
|
54
53
|
@import "components/uploader/uploader.less";
|
|
55
54
|
@import "components/user-card/user-card.less";
|
|
55
|
+
@import "components/vote/vote.less";
|
|
56
56
|
|
|
57
57
|
// LESS CONSTANTS AND MIXINS
|
|
58
58
|
@import "exports/exports.less";
|
package/lib/tsconfig.json
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stackoverflow/stacks",
|
|
3
3
|
"description": "Stack Overflow’s CSS and Design Pattern Library. Stacks is an atomic CSS library with classes and components for rapidly building Stack Overflow.",
|
|
4
|
-
"version": "3.0.0-beta.
|
|
4
|
+
"version": "3.0.0-beta.14",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
7
7
|
"lib",
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
.s-check-control { // TODO would _love_ to use .s-check instead, with no class on the input itself
|
|
2
|
-
--_cc-ai: center;
|
|
3
|
-
|
|
4
|
-
// CONTEXTUAL STYLES
|
|
5
|
-
.s-check-group & {
|
|
6
|
-
--_cc-ai: flex-start; // manually align the checkboxes and radios to the top of the group
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
// CHILD ELEMENTS
|
|
10
|
-
.s-label {
|
|
11
|
-
font-weight: normal;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
align-items: var(--_cc-ai);
|
|
15
|
-
display: flex;
|
|
16
|
-
gap: var(--su8);
|
|
17
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
.s-check-group {
|
|
2
|
-
--_cg-fd: column;
|
|
3
|
-
|
|
4
|
-
// MODIFIERS
|
|
5
|
-
&&__horizontal {
|
|
6
|
-
--_cg-fd: row;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
// CHILD ELEMENTS
|
|
10
|
-
// TODO HACK? <legend> isn't respecting gap...
|
|
11
|
-
legend.s-label {
|
|
12
|
-
margin-bottom: var(--su8);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
flex-direction: var(--_cg-fd);
|
|
16
|
-
|
|
17
|
-
display: flex;
|
|
18
|
-
gap: var(--su8);
|
|
19
|
-
}
|