@stackoverflow/stacks 2.7.3 → 2.7.5
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/LICENSE.MD +9 -9
- package/README.md +158 -180
- package/dist/css/stacks.css +20 -13
- package/dist/css/stacks.min.css +1 -1
- package/dist/js/stacks.min.js +1 -1
- package/lib/atomic/border.less +139 -139
- package/lib/atomic/color.less +36 -36
- package/lib/atomic/flex.less +426 -426
- package/lib/atomic/gap.less +44 -44
- package/lib/atomic/grid.less +139 -139
- package/lib/atomic/misc.less +374 -374
- package/lib/atomic/spacing.less +98 -98
- package/lib/atomic/typography.less +266 -264
- package/lib/atomic/width-height.less +194 -194
- package/lib/base/body.less +44 -44
- package/lib/base/configuration-static.less +61 -61
- package/lib/base/fieldset.less +5 -5
- package/lib/base/icon.less +11 -11
- package/lib/base/internal.less +220 -220
- package/lib/base/reset-meyer.less +64 -64
- package/lib/base/reset-normalize.less +449 -449
- package/lib/base/reset.less +20 -20
- package/lib/components/activity-indicator/activity-indicator.less +53 -53
- package/lib/components/avatar/avatar.less +108 -108
- package/lib/components/award-bling/award-bling.less +31 -31
- package/lib/components/banner/banner.less +44 -44
- package/lib/components/banner/banner.ts +149 -149
- package/lib/components/block-link/block-link.less +82 -82
- package/lib/components/breadcrumbs/breadcrumbs.less +41 -41
- package/lib/components/button-group/button-group.less +82 -82
- package/lib/components/card/card.less +37 -37
- package/lib/components/check-control/check-control.less +17 -17
- package/lib/components/check-group/check-group.less +19 -19
- package/lib/components/checkbox_radio/checkbox_radio.less +159 -159
- package/lib/components/code-block/code-block.fixtures.ts +88 -88
- package/lib/components/code-block/code-block.less +116 -116
- package/lib/components/description/description.less +9 -9
- package/lib/components/empty-state/empty-state.less +16 -16
- package/lib/components/expandable/expandable.less +118 -118
- package/lib/components/input-fill/input-fill.less +35 -35
- package/lib/components/input-icon/input-icon.less +45 -45
- package/lib/components/input-message/input-message.less +49 -49
- package/lib/components/input_textarea/input_textarea.less +2 -7
- package/lib/components/label/label.less +116 -110
- package/lib/components/link-preview/link-preview.less +148 -148
- package/lib/components/menu/menu.less +41 -41
- package/lib/components/modal/modal.less +118 -118
- package/lib/components/modal/modal.ts +383 -383
- package/lib/components/navigation/navigation.less +136 -136
- package/lib/components/navigation/navigation.ts +128 -128
- package/lib/components/page-title/page-title.less +51 -51
- package/lib/components/popover/popover.less +159 -159
- package/lib/components/popover/popover.ts +651 -651
- package/lib/components/post-summary/post-summary.less +457 -457
- package/lib/components/progress-bar/progress-bar.less +291 -291
- package/lib/components/prose/prose.less +452 -452
- package/lib/components/select/select.less +138 -138
- package/lib/components/spinner/spinner.less +103 -103
- package/lib/components/table/table.ts +296 -296
- package/lib/components/table-container/table-container.less +4 -4
- package/lib/components/tag/tag.less +186 -186
- package/lib/components/toast/toast.less +35 -35
- package/lib/components/toast/toast.ts +357 -357
- package/lib/components/toggle-switch/toggle-switch.less +104 -104
- package/lib/components/topbar/topbar.less +553 -553
- package/lib/components/uploader/uploader.less +205 -205
- package/lib/components/user-card/user-card.less +129 -129
- package/lib/controllers.ts +33 -33
- package/lib/exports/color-mixins.less +283 -283
- package/lib/exports/constants-helpers.less +108 -108
- package/lib/exports/constants-type.less +155 -155
- package/lib/exports/exports.less +15 -15
- package/lib/exports/mixins.less +334 -333
- package/lib/exports/spacing-mixins.less +67 -67
- package/lib/index.ts +32 -32
- package/lib/input-utils.less +41 -41
- package/lib/stacks-dynamic.less +24 -24
- package/lib/stacks-static.less +93 -93
- package/lib/stacks.less +13 -13
- package/lib/test/assertions.ts +36 -36
- package/lib/test/less-test-utils.ts +28 -28
- package/lib/test/open-wc-testing-patch.d.ts +26 -26
- package/lib/tsconfig.build.json +4 -4
- package/lib/tsconfig.json +17 -17
- package/package.json +27 -23
|
@@ -1,82 +1,82 @@
|
|
|
1
|
-
.s-btn-group {
|
|
2
|
-
// CONTEXTUAL STYLES
|
|
3
|
-
#stacks-internals #screen-sm({
|
|
4
|
-
.s-btn {
|
|
5
|
-
--_bu-px: 0.4em;
|
|
6
|
-
|
|
7
|
-
&.s-btn__dropdown {
|
|
8
|
-
padding-right: 1.2em;
|
|
9
|
-
|
|
10
|
-
&:after {
|
|
11
|
-
right: var(--_bu-px);
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
}, @force-selector: true);
|
|
16
|
-
|
|
17
|
-
// CHILD ELEMENTS
|
|
18
|
-
form {
|
|
19
|
-
display: flex;
|
|
20
|
-
margin-right: calc(var(--su-static1) * -1); // -1px
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
// --_bu-py values set below to ensure btn-group height matches same-sized button height
|
|
24
|
-
// See https://github.com/StackEng/StackOverflow/pull/18992#pullrequestreview-1947490680
|
|
25
|
-
.s-btn {
|
|
26
|
-
--_bu-br: var(--br-sm);
|
|
27
|
-
--_bu-bc-hover: transparent;
|
|
28
|
-
--_bu-px: calc(var(--su12) - var(--su1)); // 11px
|
|
29
|
-
--_bu-py: calc(var(--su6) + 0.65px); // 6.65px
|
|
30
|
-
|
|
31
|
-
&.s-btn__xs {
|
|
32
|
-
--_bu-px: calc(var(--su8) - var(--su1)); // 7px
|
|
33
|
-
--_bu-py: calc(var(--su2) + 0.9px); // 2.9px
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
&.s-btn__sm {
|
|
37
|
-
--_bu-px: calc(var(--su8) + var(--su1)); // 9px
|
|
38
|
-
--_bu-py: calc(var(--su4) + (var(--su2) - 0.15px)); // 5.85px
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
&.s-btn__md {
|
|
42
|
-
--_bu-px: var(--su12);
|
|
43
|
-
--_bu-py: calc(var(--su8) + 0.15px); // 8.15px
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
&.is-selected,
|
|
47
|
-
&--radio:checked + .s-btn {
|
|
48
|
-
font-weight: bold;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.s-btn--badge {
|
|
52
|
-
// set negative margins so button height isn't affect by badge
|
|
53
|
-
margin-bottom: -100%;
|
|
54
|
-
margin-top: -100%;
|
|
55
|
-
font-weight: normal;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
& .s-btn--text {
|
|
59
|
-
&:before {
|
|
60
|
-
content: attr(data-text);
|
|
61
|
-
content: attr(data-text) / "";
|
|
62
|
-
font-weight: bold;
|
|
63
|
-
height: 0;
|
|
64
|
-
pointer-events: none;
|
|
65
|
-
user-select: none;
|
|
66
|
-
visibility: hidden;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
display: inline-flex;
|
|
70
|
-
flex-direction: column;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
white-space: nowrap; // When the buttons wrap, they get super tall and mess up the whole layout
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
// STATIC COMPONENT STYLES
|
|
77
|
-
border: var(--su-static1) solid var(--black-300);
|
|
78
|
-
border-radius: var(--br-md);
|
|
79
|
-
display: inline-flex;
|
|
80
|
-
flex-wrap: wrap;
|
|
81
|
-
padding: calc(var(--su-static4) - var(--su-static1));
|
|
82
|
-
}
|
|
1
|
+
.s-btn-group {
|
|
2
|
+
// CONTEXTUAL STYLES
|
|
3
|
+
#stacks-internals #screen-sm({
|
|
4
|
+
.s-btn {
|
|
5
|
+
--_bu-px: 0.4em;
|
|
6
|
+
|
|
7
|
+
&.s-btn__dropdown {
|
|
8
|
+
padding-right: 1.2em;
|
|
9
|
+
|
|
10
|
+
&:after {
|
|
11
|
+
right: var(--_bu-px);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}, @force-selector: true);
|
|
16
|
+
|
|
17
|
+
// CHILD ELEMENTS
|
|
18
|
+
form {
|
|
19
|
+
display: flex;
|
|
20
|
+
margin-right: calc(var(--su-static1) * -1); // -1px
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// --_bu-py values set below to ensure btn-group height matches same-sized button height
|
|
24
|
+
// See https://github.com/StackEng/StackOverflow/pull/18992#pullrequestreview-1947490680
|
|
25
|
+
.s-btn {
|
|
26
|
+
--_bu-br: var(--br-sm);
|
|
27
|
+
--_bu-bc-hover: transparent;
|
|
28
|
+
--_bu-px: calc(var(--su12) - var(--su1)); // 11px
|
|
29
|
+
--_bu-py: calc(var(--su6) + 0.65px); // 6.65px
|
|
30
|
+
|
|
31
|
+
&.s-btn__xs {
|
|
32
|
+
--_bu-px: calc(var(--su8) - var(--su1)); // 7px
|
|
33
|
+
--_bu-py: calc(var(--su2) + 0.9px); // 2.9px
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&.s-btn__sm {
|
|
37
|
+
--_bu-px: calc(var(--su8) + var(--su1)); // 9px
|
|
38
|
+
--_bu-py: calc(var(--su4) + (var(--su2) - 0.15px)); // 5.85px
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&.s-btn__md {
|
|
42
|
+
--_bu-px: var(--su12);
|
|
43
|
+
--_bu-py: calc(var(--su8) + 0.15px); // 8.15px
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&.is-selected,
|
|
47
|
+
&--radio:checked + .s-btn {
|
|
48
|
+
font-weight: bold;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.s-btn--badge {
|
|
52
|
+
// set negative margins so button height isn't affect by badge
|
|
53
|
+
margin-bottom: -100%;
|
|
54
|
+
margin-top: -100%;
|
|
55
|
+
font-weight: normal;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
& .s-btn--text {
|
|
59
|
+
&:before {
|
|
60
|
+
content: attr(data-text);
|
|
61
|
+
content: attr(data-text) / "";
|
|
62
|
+
font-weight: bold;
|
|
63
|
+
height: 0;
|
|
64
|
+
pointer-events: none;
|
|
65
|
+
user-select: none;
|
|
66
|
+
visibility: hidden;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
display: inline-flex;
|
|
70
|
+
flex-direction: column;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
white-space: nowrap; // When the buttons wrap, they get super tall and mess up the whole layout
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// STATIC COMPONENT STYLES
|
|
77
|
+
border: var(--su-static1) solid var(--black-300);
|
|
78
|
+
border-radius: var(--br-md);
|
|
79
|
+
display: inline-flex;
|
|
80
|
+
flex-wrap: wrap;
|
|
81
|
+
padding: calc(var(--su-static4) - var(--su-static1));
|
|
82
|
+
}
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
.s-card {
|
|
2
|
-
--_ca-bc: var(--bc-medium);
|
|
3
|
-
|
|
4
|
-
// CONTEXTUAL STYLES
|
|
5
|
-
a& {
|
|
6
|
-
text-decoration: none !important;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
// VARIANTS
|
|
10
|
-
&&__muted {
|
|
11
|
-
--_ca-bc: var(--bc-light);
|
|
12
|
-
|
|
13
|
-
// Dim only the first child card content
|
|
14
|
-
> * {
|
|
15
|
-
opacity: 0.65;
|
|
16
|
-
|
|
17
|
-
.dark-mode({
|
|
18
|
-
opacity: 0.7;
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
.highcontrast-mode({
|
|
22
|
-
opacity: 0.75;
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// CHILD ELEMENTS
|
|
28
|
-
> :last-child {
|
|
29
|
-
margin-bottom: 0;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
border: var(--su-static1) solid var(--_ca-bc);
|
|
33
|
-
|
|
34
|
-
background-color: var(--white);
|
|
35
|
-
border-radius: var(--br-sm);
|
|
36
|
-
padding: var(--su12);
|
|
37
|
-
}
|
|
1
|
+
.s-card {
|
|
2
|
+
--_ca-bc: var(--bc-medium);
|
|
3
|
+
|
|
4
|
+
// CONTEXTUAL STYLES
|
|
5
|
+
a& {
|
|
6
|
+
text-decoration: none !important;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
// VARIANTS
|
|
10
|
+
&&__muted {
|
|
11
|
+
--_ca-bc: var(--bc-light);
|
|
12
|
+
|
|
13
|
+
// Dim only the first child card content
|
|
14
|
+
> * {
|
|
15
|
+
opacity: 0.65;
|
|
16
|
+
|
|
17
|
+
.dark-mode({
|
|
18
|
+
opacity: 0.7;
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
.highcontrast-mode({
|
|
22
|
+
opacity: 0.75;
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// CHILD ELEMENTS
|
|
28
|
+
> :last-child {
|
|
29
|
+
margin-bottom: 0;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
border: var(--su-static1) solid var(--_ca-bc);
|
|
33
|
+
|
|
34
|
+
background-color: var(--white);
|
|
35
|
+
border-radius: var(--br-sm);
|
|
36
|
+
padding: var(--su12);
|
|
37
|
+
}
|
|
@@ -1,17 +1,17 @@
|
|
|
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
|
+
.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 +1,19 @@
|
|
|
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
|
-
}
|
|
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
|
+
}
|
|
@@ -1,159 +1,159 @@
|
|
|
1
|
-
.s-checkbox,
|
|
2
|
-
.s-radio {
|
|
3
|
-
--_ch-baw: var(--su-static1);
|
|
4
|
-
--_ch-bc: var(--bc-dark);
|
|
5
|
-
--_ch-bg: var(--white);
|
|
6
|
-
--_ch-bg-image: unset;
|
|
7
|
-
|
|
8
|
-
// CONTEXTUAL STYLES
|
|
9
|
-
fieldset[disabled] &,
|
|
10
|
-
&[disabled] {
|
|
11
|
-
cursor: not-allowed;
|
|
12
|
-
opacity: var(--_o-disabled-static);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.s-check-control & {
|
|
16
|
-
&[disabled] + .s-label {
|
|
17
|
-
&:extend(.is-disabled .s-label);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.s-check-group & {
|
|
22
|
-
margin-top: calc(var(--su2) + var(--su1)); // 3px
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
input& {
|
|
26
|
-
flex-shrink: 0;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// INTERACTION
|
|
30
|
-
&:focus {
|
|
31
|
-
.focus-styles();
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
background-color: var(--_ch-bg);
|
|
35
|
-
border: var(--_ch-baw) solid var(--_ch-bc);
|
|
36
|
-
|
|
37
|
-
appearance: none;
|
|
38
|
-
cursor: pointer;
|
|
39
|
-
font-size: inherit;
|
|
40
|
-
height: 1em;
|
|
41
|
-
margin: 0; // A guard against Core's default margins
|
|
42
|
-
outline: 0;
|
|
43
|
-
vertical-align: middle;
|
|
44
|
-
width: 1em;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.s-checkbox {
|
|
48
|
-
// Less variables for check svg fill color
|
|
49
|
-
@ch-bg-image-fill: .set-white()[default];
|
|
50
|
-
@ch-bg-image-fill-dark: .set-white-dark()[default];
|
|
51
|
-
|
|
52
|
-
// CONTEXTUAL STYLES
|
|
53
|
-
.dark-mode({
|
|
54
|
-
&:checked {
|
|
55
|
-
--_ch-bg-image: url("data:image/svg+xml;,%3Csvg width='11' height='11' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 3.41L8.59 2 4 6.59 2.41 5 1 6.41l3 3z' fill='@{ch-bg-image-fill-dark}'/%3E%3C/svg%3E");
|
|
56
|
-
}
|
|
57
|
-
&:indeterminate {
|
|
58
|
-
--_ch-bg-image: url("data:image/svg+xml;,%3Csvg width='11' height='11' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 4.5 h7 v2 h-7 z' fill='@{ch-bg-image-fill-dark}'/%3E%3C/svg%3E");
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
.highcontrast-dark-mode({
|
|
63
|
-
&:checked, &:indeterminate {
|
|
64
|
-
--_ch-bc: var(--blue-500) !important;
|
|
65
|
-
--_ch-bg: var(--blue-400);
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
@media (forced-colors: active) {
|
|
70
|
-
&:checked,
|
|
71
|
-
&:indeterminate {
|
|
72
|
-
--_ch-bg: ButtonText !important;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
// STATES
|
|
77
|
-
&:checked, &:indeterminate {
|
|
78
|
-
--_ch-bc: var(--theme-secondary-400) !important;
|
|
79
|
-
--_ch-bg: var(--theme-secondary-400);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
&:checked {
|
|
83
|
-
--_ch-bg-image: url("data:image/svg+xml;,%3Csvg width='11' height='11' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 3.41L8.59 2 4 6.59 2.41 5 1 6.41l3 3z' fill='@{ch-bg-image-fill}'/%3E%3C/svg%3E");
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
&:indeterminate {
|
|
87
|
-
--_ch-bg-image: url("data:image/svg+xml;,%3Csvg width='11' height='11' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 4.5 h7 v2 h-7 z' fill='@{ch-bg-image-fill}'/%3E%3C/svg%3E");
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
background-image: var(--_ch-bg-image);
|
|
91
|
-
|
|
92
|
-
background-position: center center;
|
|
93
|
-
background-repeat: no-repeat;
|
|
94
|
-
background-size: contain;
|
|
95
|
-
border-radius: var(--br-sm);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.s-radio {
|
|
99
|
-
|
|
100
|
-
// CONTEXTUAL STYLES
|
|
101
|
-
.highcontrast-dark-mode({
|
|
102
|
-
&:checked {
|
|
103
|
-
--_ch-bc: var(--blue-400);
|
|
104
|
-
outline: var(--su-static1) solid var(--black);
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
// STATES
|
|
109
|
-
&:checked {
|
|
110
|
-
--_ch-baw: 0.30769231em;
|
|
111
|
-
--_ch-bc: var(--theme-secondary-400);
|
|
112
|
-
--_ch-bg: var(--white);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
border-radius: var(--br-circle);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
.s-checkbox,
|
|
119
|
-
.s-radio:not(:checked) {
|
|
120
|
-
.validation-states(ch);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
.s-check-control { // TODO would _love_ to use .s-check instead, with no class on the input itself
|
|
124
|
-
--_cc-ai: center;
|
|
125
|
-
|
|
126
|
-
// CONTEXTUAL STYLES
|
|
127
|
-
.s-check-group & {
|
|
128
|
-
--_cc-ai: flex-start; // manually align the checkboxes and radios to the top of the group
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
// CHILD ELEMENTS
|
|
132
|
-
.s-label {
|
|
133
|
-
font-weight: normal;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
align-items: var(--_cc-ai);
|
|
137
|
-
display: flex;
|
|
138
|
-
gap: var(--su8);
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
.s-check-group {
|
|
142
|
-
--_cg-fd: column;
|
|
143
|
-
|
|
144
|
-
// MODIFIERS
|
|
145
|
-
&&__horizontal {
|
|
146
|
-
--_cg-fd: row;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
// CHILD ELEMENTS
|
|
150
|
-
// TODO HACK? <legend> isn't respecting gap...
|
|
151
|
-
legend.s-label {
|
|
152
|
-
margin-bottom: var(--su8);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
flex-direction: var(--_cg-fd);
|
|
156
|
-
|
|
157
|
-
display: flex;
|
|
158
|
-
gap: var(--su8);
|
|
159
|
-
}
|
|
1
|
+
.s-checkbox,
|
|
2
|
+
.s-radio {
|
|
3
|
+
--_ch-baw: var(--su-static1);
|
|
4
|
+
--_ch-bc: var(--bc-dark);
|
|
5
|
+
--_ch-bg: var(--white);
|
|
6
|
+
--_ch-bg-image: unset;
|
|
7
|
+
|
|
8
|
+
// CONTEXTUAL STYLES
|
|
9
|
+
fieldset[disabled] &,
|
|
10
|
+
&[disabled] {
|
|
11
|
+
cursor: not-allowed;
|
|
12
|
+
opacity: var(--_o-disabled-static);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.s-check-control & {
|
|
16
|
+
&[disabled] + .s-label {
|
|
17
|
+
&:extend(.is-disabled .s-label);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.s-check-group & {
|
|
22
|
+
margin-top: calc(var(--su2) + var(--su1)); // 3px
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
input& {
|
|
26
|
+
flex-shrink: 0;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// INTERACTION
|
|
30
|
+
&:focus {
|
|
31
|
+
.focus-styles();
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
background-color: var(--_ch-bg);
|
|
35
|
+
border: var(--_ch-baw) solid var(--_ch-bc);
|
|
36
|
+
|
|
37
|
+
appearance: none;
|
|
38
|
+
cursor: pointer;
|
|
39
|
+
font-size: inherit;
|
|
40
|
+
height: 1em;
|
|
41
|
+
margin: 0; // A guard against Core's default margins
|
|
42
|
+
outline: 0;
|
|
43
|
+
vertical-align: middle;
|
|
44
|
+
width: 1em;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.s-checkbox {
|
|
48
|
+
// Less variables for check svg fill color
|
|
49
|
+
@ch-bg-image-fill: .set-white()[default];
|
|
50
|
+
@ch-bg-image-fill-dark: .set-white-dark()[default];
|
|
51
|
+
|
|
52
|
+
// CONTEXTUAL STYLES
|
|
53
|
+
.dark-mode({
|
|
54
|
+
&:checked {
|
|
55
|
+
--_ch-bg-image: url("data:image/svg+xml;,%3Csvg width='11' height='11' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 3.41L8.59 2 4 6.59 2.41 5 1 6.41l3 3z' fill='@{ch-bg-image-fill-dark}'/%3E%3C/svg%3E");
|
|
56
|
+
}
|
|
57
|
+
&:indeterminate {
|
|
58
|
+
--_ch-bg-image: url("data:image/svg+xml;,%3Csvg width='11' height='11' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 4.5 h7 v2 h-7 z' fill='@{ch-bg-image-fill-dark}'/%3E%3C/svg%3E");
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
.highcontrast-dark-mode({
|
|
63
|
+
&:checked, &:indeterminate {
|
|
64
|
+
--_ch-bc: var(--blue-500) !important;
|
|
65
|
+
--_ch-bg: var(--blue-400);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
@media (forced-colors: active) {
|
|
70
|
+
&:checked,
|
|
71
|
+
&:indeterminate {
|
|
72
|
+
--_ch-bg: ButtonText !important;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// STATES
|
|
77
|
+
&:checked, &:indeterminate {
|
|
78
|
+
--_ch-bc: var(--theme-secondary-400) !important;
|
|
79
|
+
--_ch-bg: var(--theme-secondary-400);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
&:checked {
|
|
83
|
+
--_ch-bg-image: url("data:image/svg+xml;,%3Csvg width='11' height='11' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 3.41L8.59 2 4 6.59 2.41 5 1 6.41l3 3z' fill='@{ch-bg-image-fill}'/%3E%3C/svg%3E");
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
&:indeterminate {
|
|
87
|
+
--_ch-bg-image: url("data:image/svg+xml;,%3Csvg width='11' height='11' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 4.5 h7 v2 h-7 z' fill='@{ch-bg-image-fill}'/%3E%3C/svg%3E");
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
background-image: var(--_ch-bg-image);
|
|
91
|
+
|
|
92
|
+
background-position: center center;
|
|
93
|
+
background-repeat: no-repeat;
|
|
94
|
+
background-size: contain;
|
|
95
|
+
border-radius: var(--br-sm);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.s-radio {
|
|
99
|
+
|
|
100
|
+
// CONTEXTUAL STYLES
|
|
101
|
+
.highcontrast-dark-mode({
|
|
102
|
+
&:checked {
|
|
103
|
+
--_ch-bc: var(--blue-400);
|
|
104
|
+
outline: var(--su-static1) solid var(--black);
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
// STATES
|
|
109
|
+
&:checked {
|
|
110
|
+
--_ch-baw: 0.30769231em;
|
|
111
|
+
--_ch-bc: var(--theme-secondary-400);
|
|
112
|
+
--_ch-bg: var(--white);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
border-radius: var(--br-circle);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.s-checkbox,
|
|
119
|
+
.s-radio:not(:checked) {
|
|
120
|
+
.validation-states(ch);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.s-check-control { // TODO would _love_ to use .s-check instead, with no class on the input itself
|
|
124
|
+
--_cc-ai: center;
|
|
125
|
+
|
|
126
|
+
// CONTEXTUAL STYLES
|
|
127
|
+
.s-check-group & {
|
|
128
|
+
--_cc-ai: flex-start; // manually align the checkboxes and radios to the top of the group
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// CHILD ELEMENTS
|
|
132
|
+
.s-label {
|
|
133
|
+
font-weight: normal;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
align-items: var(--_cc-ai);
|
|
137
|
+
display: flex;
|
|
138
|
+
gap: var(--su8);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.s-check-group {
|
|
142
|
+
--_cg-fd: column;
|
|
143
|
+
|
|
144
|
+
// MODIFIERS
|
|
145
|
+
&&__horizontal {
|
|
146
|
+
--_cg-fd: row;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// CHILD ELEMENTS
|
|
150
|
+
// TODO HACK? <legend> isn't respecting gap...
|
|
151
|
+
legend.s-label {
|
|
152
|
+
margin-bottom: var(--su8);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
flex-direction: var(--_cg-fd);
|
|
156
|
+
|
|
157
|
+
display: flex;
|
|
158
|
+
gap: var(--su8);
|
|
159
|
+
}
|