@coopdigital/styles 1.11.0 → 1.12.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.
- package/dist/components/Button.css +1 -1
- package/dist/components/Card.css +1 -1
- package/dist/components/Checkbox.css +1 -1
- package/dist/components/DatePicker.css +1 -1
- package/dist/components/Radio.css +1 -1
- package/dist/components/Searchbox.css +1 -1
- package/dist/components/TextInput.css +1 -1
- package/dist/components.css +1 -1
- package/dist/form.css +1 -1
- package/dist/foundations.css +1 -1
- package/dist/reset.css +1 -1
- package/dist/typography/headings.css +1 -1
- package/dist/typography/links.css +1 -1
- package/dist/typography/text.css +1 -1
- package/dist/typography.css +1 -1
- package/package.json +3 -3
- package/presets/uno/index.js +1 -1
- package/src/components/Button.scss +5 -0
- package/src/components/Card.scss +22 -26
- package/src/components/Checkbox.scss +10 -10
- package/src/components/DatePicker.scss +6 -0
- package/src/components/Radio.scss +9 -8
- package/src/components/Searchbox.scss +7 -6
- package/src/components/TextInput.scss +54 -31
- package/src/form.scss +51 -28
- package/src/reset.scss +9 -4
- package/src/typography/headings.scss +1 -10
- package/src/typography/links.scss +1 -1
- package/src/typography/text.scss +84 -14
package/src/components/Card.scss
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
@use "../breakpoints.scss" as *;
|
|
2
2
|
|
|
3
3
|
@mixin card-vertical {
|
|
4
|
-
--card-direction: column;
|
|
5
|
-
--card-image-max-width: 100%;
|
|
6
4
|
--card-image-border-radius: var(--ui-border-radius-lg) var(--ui-border-radius-lg) 0 0;
|
|
5
|
+
--card-template: "image" auto "content" 1fr;
|
|
7
6
|
}
|
|
8
7
|
|
|
9
8
|
@mixin card-horizontal {
|
|
10
|
-
--card-direction: row;
|
|
11
|
-
--card-image-max-width: calc(100% / 3);
|
|
12
9
|
--card-image-border-radius: var(--ui-border-radius-lg) 0 0 var(--ui-border-radius-lg);
|
|
10
|
+
--card-template: "image content" / 4fr 8fr;
|
|
13
11
|
}
|
|
14
12
|
|
|
15
13
|
.coop-card {
|
|
@@ -17,8 +15,8 @@
|
|
|
17
15
|
|
|
18
16
|
position: relative;
|
|
19
17
|
|
|
20
|
-
display:
|
|
21
|
-
|
|
18
|
+
display: grid;
|
|
19
|
+
grid-template: var(--card-template);
|
|
22
20
|
|
|
23
21
|
border-radius: var(--ui-border-radius-lg);
|
|
24
22
|
|
|
@@ -32,14 +30,14 @@
|
|
|
32
30
|
@include card-horizontal;
|
|
33
31
|
|
|
34
32
|
&:has(img[data-align="right"]):not([data-adaptive]) {
|
|
35
|
-
--card-direction: row-reverse;
|
|
36
33
|
--card-image-border-radius: 0 var(--ui-border-radius-lg) var(--ui-border-radius-lg) 0;
|
|
34
|
+
--card-template: "content image" / 8fr 4fr;
|
|
37
35
|
}
|
|
38
36
|
|
|
39
|
-
&:has(img[data-align="
|
|
37
|
+
&:has(img[data-align="right"])[data-adaptive] {
|
|
40
38
|
@media (min-width: $mq-md) {
|
|
41
|
-
--card-direction: row-reverse;
|
|
42
39
|
--card-image-border-radius: 0 var(--ui-border-radius-lg) var(--ui-border-radius-lg) 0;
|
|
40
|
+
--card-template: "content image" / 8fr 4fr;
|
|
43
41
|
}
|
|
44
42
|
}
|
|
45
43
|
|
|
@@ -58,9 +56,13 @@
|
|
|
58
56
|
}
|
|
59
57
|
}
|
|
60
58
|
|
|
59
|
+
&:not([class*="bg"]) {
|
|
60
|
+
background: var(--color-white);
|
|
61
|
+
}
|
|
62
|
+
|
|
61
63
|
picture {
|
|
62
64
|
overflow: hidden;
|
|
63
|
-
|
|
65
|
+
grid-area: image;
|
|
64
66
|
margin: 0;
|
|
65
67
|
border-radius: var(--card-image-border-radius);
|
|
66
68
|
|
|
@@ -85,7 +87,7 @@
|
|
|
85
87
|
|
|
86
88
|
&--link:is(a) {
|
|
87
89
|
color: inherit;
|
|
88
|
-
text-decoration:
|
|
90
|
+
text-decoration: inherit;
|
|
89
91
|
outline: 0;
|
|
90
92
|
|
|
91
93
|
&::before {
|
|
@@ -110,25 +112,14 @@
|
|
|
110
112
|
|
|
111
113
|
&--content {
|
|
112
114
|
display: flex;
|
|
115
|
+
grid-area: content;
|
|
113
116
|
flex-direction: column;
|
|
114
117
|
gap: var(--spacing-8);
|
|
115
|
-
// align-self: center;
|
|
116
118
|
|
|
117
119
|
padding: var(--spacing-24);
|
|
118
120
|
}
|
|
119
121
|
|
|
120
|
-
&--
|
|
121
|
-
display: flex;
|
|
122
|
-
flex-grow: 1;
|
|
123
|
-
gap: var(--spacing-12);
|
|
124
|
-
align-items: flex-start;
|
|
125
|
-
justify-content: space-between;
|
|
126
|
-
|
|
127
|
-
width: 100%;
|
|
128
|
-
border-radius: var(--ui-border-radius-lg);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
&--inner:is(a) {
|
|
122
|
+
&--content:is(a) {
|
|
132
123
|
color: inherit;
|
|
133
124
|
text-decoration: inherit;
|
|
134
125
|
}
|
|
@@ -137,6 +128,7 @@
|
|
|
137
128
|
pointer-events: none;
|
|
138
129
|
|
|
139
130
|
display: flex;
|
|
131
|
+
grid-area: content;
|
|
140
132
|
align-self: center;
|
|
141
133
|
justify-content: flex-end;
|
|
142
134
|
|
|
@@ -187,8 +179,12 @@
|
|
|
187
179
|
}
|
|
188
180
|
}
|
|
189
181
|
|
|
190
|
-
&:
|
|
191
|
-
|
|
182
|
+
&:has(.coop-card--icon) &--content {
|
|
183
|
+
width: calc(100% - 2rem);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
&:has(a):hover,
|
|
187
|
+
&:has(a):focus-visible {
|
|
192
188
|
box-shadow: var(--ui-shadow-hover);
|
|
193
189
|
|
|
194
190
|
.coop-card--icon {
|
|
@@ -17,15 +17,15 @@ input[type="checkbox"] {
|
|
|
17
17
|
outline: 0;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
input[type="checkbox"] +
|
|
20
|
+
input[type="checkbox"] + label {
|
|
21
21
|
min-height: var(--form-field-size);
|
|
22
22
|
|
|
23
23
|
&::before {
|
|
24
24
|
content: "";
|
|
25
25
|
|
|
26
26
|
position: absolute;
|
|
27
|
-
top: 0;
|
|
28
|
-
left: 0;
|
|
27
|
+
top: var(--form-field-padding-y, 0);
|
|
28
|
+
left: var(--form-field-padding-x, 0);
|
|
29
29
|
|
|
30
30
|
display: block;
|
|
31
31
|
|
|
@@ -41,11 +41,11 @@ input[type="checkbox"] + div label {
|
|
|
41
41
|
content: "";
|
|
42
42
|
|
|
43
43
|
position: absolute;
|
|
44
|
-
top: calc(var(--form-field-size) / 5);
|
|
45
|
-
left:
|
|
44
|
+
top: calc(var(--form-field-padding-y) + var(--form-field-size) / 5);
|
|
45
|
+
left: var(--form-field-padding-x);
|
|
46
46
|
transform: scale(0.6) rotate(-45deg);
|
|
47
47
|
|
|
48
|
-
width: var(--form-field-size);
|
|
48
|
+
width: calc(var(--form-field-size));
|
|
49
49
|
height: calc(var(--form-field-size) / 2);
|
|
50
50
|
border: solid;
|
|
51
51
|
border-width: 0 0 calc(var(--form-field-size) / 4) calc(var(--form-field-size) / 4);
|
|
@@ -55,12 +55,12 @@ input[type="checkbox"] + div label {
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
input[type="checkbox"]:checked +
|
|
58
|
+
input[type="checkbox"]:checked + label::after {
|
|
59
59
|
opacity: 1;
|
|
60
60
|
animation: coop-checkbox-pop 0.2s ease-out forwards;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
input[type="checkbox"]:indeterminate +
|
|
63
|
+
input[type="checkbox"]:indeterminate + label::after {
|
|
64
64
|
top: calc(var(--form-field-size) / 4);
|
|
65
65
|
transform: scale(0.5);
|
|
66
66
|
|
|
@@ -72,11 +72,11 @@ input[type="checkbox"]:indeterminate + div label::after {
|
|
|
72
72
|
background: var(--color-grey-600);
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
input[type="checkbox"]:not(:disabled) +
|
|
75
|
+
input[type="checkbox"]:not(:disabled) + label {
|
|
76
76
|
cursor: pointer;
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
input[type="checkbox"]:focus +
|
|
79
|
+
input[type="checkbox"]:focus + label::before {
|
|
80
80
|
outline: 2px solid var(--color-focus);
|
|
81
81
|
outline-offset: 3px;
|
|
82
82
|
}
|
|
@@ -17,15 +17,15 @@ input[type="radio"] {
|
|
|
17
17
|
outline: 0;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
input[type="radio"] +
|
|
20
|
+
input[type="radio"] + label {
|
|
21
21
|
min-height: var(--form-field-size);
|
|
22
22
|
|
|
23
23
|
&::before {
|
|
24
24
|
content: "";
|
|
25
25
|
|
|
26
26
|
position: absolute;
|
|
27
|
-
top: 0;
|
|
28
|
-
left: 0;
|
|
27
|
+
top: var(--form-field-padding-y, 0);
|
|
28
|
+
left: var(--form-field-padding-x, 0);
|
|
29
29
|
|
|
30
30
|
display: block;
|
|
31
31
|
|
|
@@ -41,8 +41,9 @@ input[type="radio"] + div label {
|
|
|
41
41
|
content: "";
|
|
42
42
|
|
|
43
43
|
position: absolute;
|
|
44
|
-
top: calc(var(--form-field-size) / 4);
|
|
45
|
-
left: calc(var(--form-field-size) / 4);
|
|
44
|
+
top: calc(var(--form-field-padding-y) + var(--form-field-size) / 4);
|
|
45
|
+
left: calc(var(--form-field-padding-x) + var(--form-field-size) / 4);
|
|
46
|
+
// left: 8px;
|
|
46
47
|
|
|
47
48
|
width: calc(var(--form-field-size) / 2);
|
|
48
49
|
height: calc(var(--form-field-size) / 2);
|
|
@@ -53,16 +54,16 @@ input[type="radio"] + div label {
|
|
|
53
54
|
}
|
|
54
55
|
}
|
|
55
56
|
|
|
56
|
-
input[type="radio"]:checked +
|
|
57
|
+
input[type="radio"]:checked + label::after {
|
|
57
58
|
opacity: 1;
|
|
58
59
|
animation: coop-radio-pop 0.2s ease-out forwards;
|
|
59
60
|
}
|
|
60
61
|
|
|
61
|
-
input[type="radio"]:not(:disabled) +
|
|
62
|
+
input[type="radio"]:not(:disabled) + label {
|
|
62
63
|
cursor: pointer;
|
|
63
64
|
}
|
|
64
65
|
|
|
65
|
-
input[type="radio"]:focus +
|
|
66
|
+
input[type="radio"]:focus + label::before {
|
|
66
67
|
outline: 2px solid var(--color-focus);
|
|
67
68
|
outline-offset: 3px;
|
|
68
69
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
@use "../breakpoints.scss" as *;
|
|
2
2
|
|
|
3
3
|
.coop-searchbox {
|
|
4
|
-
$ghost-variants: ("green", "blue");
|
|
5
|
-
|
|
6
4
|
display: flex;
|
|
7
5
|
flex-direction: column;
|
|
8
6
|
gap: 0.5rem;
|
|
@@ -46,7 +44,7 @@
|
|
|
46
44
|
}
|
|
47
45
|
}
|
|
48
46
|
|
|
49
|
-
|
|
47
|
+
input {
|
|
50
48
|
border-color: var(--border-color, var(--color-grey-500));
|
|
51
49
|
border-style: solid;
|
|
52
50
|
border-width: 2px;
|
|
@@ -58,8 +56,10 @@
|
|
|
58
56
|
width: 100%;
|
|
59
57
|
}
|
|
60
58
|
|
|
61
|
-
|
|
62
|
-
border-
|
|
59
|
+
input:focus-visible {
|
|
60
|
+
border-color: var(--border-color);
|
|
61
|
+
// border-radius: var(--ui-border-radius-lg);
|
|
62
|
+
border-radius: var(--ui-border-radius-md) 0 0 var(--ui-border-radius-md);
|
|
63
63
|
outline: 0;
|
|
64
64
|
}
|
|
65
65
|
|
|
@@ -70,7 +70,8 @@
|
|
|
70
70
|
border-width: 2px;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
|
|
73
|
+
input,
|
|
74
|
+
input:focus-visible {
|
|
74
75
|
border: 0;
|
|
75
76
|
}
|
|
76
77
|
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
input,
|
|
2
2
|
.coop-text-input {
|
|
3
|
+
--text-input-padding: 0 calc(var(--form-field-size) / 2 - 4px);
|
|
4
|
+
--text-input-height: calc(var(--form-field-size) + var(--spacing-16));
|
|
5
|
+
|
|
3
6
|
position: relative;
|
|
4
7
|
|
|
5
8
|
display: block;
|
|
6
9
|
|
|
7
10
|
width: 100%;
|
|
11
|
+
border-color: var(--form-field-border);
|
|
12
|
+
border-style: solid;
|
|
13
|
+
border-width: 2px;
|
|
8
14
|
border-radius: var(--ui-border-radius-sm);
|
|
9
15
|
|
|
16
|
+
font-size: var(--form-font-size);
|
|
10
17
|
line-height: 1;
|
|
11
18
|
color: var(--color-text-default);
|
|
12
19
|
|
|
@@ -25,6 +32,15 @@ input,
|
|
|
25
32
|
&:disabled {
|
|
26
33
|
background: var(--color-grey-300);
|
|
27
34
|
}
|
|
35
|
+
|
|
36
|
+
&:focus-visible {
|
|
37
|
+
border-color: var(--color-black);
|
|
38
|
+
border-radius: var(--ui-border-radius-sm);
|
|
39
|
+
|
|
40
|
+
background: var(--color-white);
|
|
41
|
+
outline: 2px solid var(--color-focus);
|
|
42
|
+
outline-offset: 3px;
|
|
43
|
+
}
|
|
28
44
|
}
|
|
29
45
|
|
|
30
46
|
input:not([type="checkbox"], [type="radio"]) {
|
|
@@ -32,24 +48,15 @@ input:not([type="checkbox"], [type="radio"]) {
|
|
|
32
48
|
padding: var(--text-input-padding);
|
|
33
49
|
}
|
|
34
50
|
|
|
35
|
-
.coop-text-input,
|
|
36
51
|
.coop-text-input--prefix,
|
|
37
52
|
.coop-text-input--suffix {
|
|
38
|
-
|
|
39
|
-
align-items: center;
|
|
53
|
+
justify-content: center;
|
|
40
54
|
|
|
41
|
-
padding: var(--text-input-padding);
|
|
42
|
-
border-color: inherit;
|
|
43
55
|
border-style: solid;
|
|
44
56
|
border-width: 2px;
|
|
45
57
|
|
|
46
|
-
transition: border-color 0.1s ease-out;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.coop-text-input--prefix,
|
|
50
|
-
.coop-text-input--suffix {
|
|
51
|
-
justify-content: center;
|
|
52
58
|
white-space: nowrap;
|
|
59
|
+
|
|
53
60
|
background-color: var(--color-tint-brown);
|
|
54
61
|
|
|
55
62
|
&[data-inline] {
|
|
@@ -57,26 +64,6 @@ input:not([type="checkbox"], [type="radio"]) {
|
|
|
57
64
|
}
|
|
58
65
|
}
|
|
59
66
|
|
|
60
|
-
.coop-text-input--prefix {
|
|
61
|
-
border-top-left-radius: var(--ui-border-radius-sm);
|
|
62
|
-
border-bottom-left-radius: var(--ui-border-radius-sm);
|
|
63
|
-
|
|
64
|
-
&[data-inline] {
|
|
65
|
-
padding-right: 0;
|
|
66
|
-
border-right: 0;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.coop-text-input--suffix {
|
|
71
|
-
border-top-right-radius: var(--ui-border-radius-sm);
|
|
72
|
-
border-bottom-right-radius: var(--ui-border-radius-sm);
|
|
73
|
-
|
|
74
|
-
&[data-inline] {
|
|
75
|
-
padding-left: 0;
|
|
76
|
-
border-left: 0;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
67
|
.coop-text-input-wrapper {
|
|
81
68
|
--text-input-padding: 0 calc(var(--form-field-size) / 2 - 4px);
|
|
82
69
|
--text-input-height: calc(var(--form-field-size) + var(--spacing-16));
|
|
@@ -114,6 +101,10 @@ input:not([type="checkbox"], [type="radio"]) {
|
|
|
114
101
|
outline-offset: 3px;
|
|
115
102
|
|
|
116
103
|
transition: none;
|
|
104
|
+
|
|
105
|
+
input {
|
|
106
|
+
outline: 0;
|
|
107
|
+
}
|
|
117
108
|
}
|
|
118
109
|
|
|
119
110
|
&:has(.coop-text-input--prefix) .coop-text-input {
|
|
@@ -127,4 +118,36 @@ input:not([type="checkbox"], [type="radio"]) {
|
|
|
127
118
|
border-top-right-radius: 0;
|
|
128
119
|
border-bottom-right-radius: 0;
|
|
129
120
|
}
|
|
121
|
+
|
|
122
|
+
.coop-text-input,
|
|
123
|
+
.coop-text-input--prefix,
|
|
124
|
+
.coop-text-input--suffix {
|
|
125
|
+
display: flex;
|
|
126
|
+
align-items: center;
|
|
127
|
+
|
|
128
|
+
padding: var(--text-input-padding);
|
|
129
|
+
border-color: inherit;
|
|
130
|
+
|
|
131
|
+
transition: border-color 0.1s ease-out;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.coop-text-input--prefix {
|
|
135
|
+
border-top-left-radius: var(--ui-border-radius-sm);
|
|
136
|
+
border-bottom-left-radius: var(--ui-border-radius-sm);
|
|
137
|
+
|
|
138
|
+
&[data-inline] {
|
|
139
|
+
padding-right: 0;
|
|
140
|
+
border-right: 0;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.coop-text-input--suffix {
|
|
145
|
+
border-top-right-radius: var(--ui-border-radius-sm);
|
|
146
|
+
border-bottom-right-radius: var(--ui-border-radius-sm);
|
|
147
|
+
|
|
148
|
+
&[data-inline] {
|
|
149
|
+
padding-left: 0;
|
|
150
|
+
border-left: 0;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
130
153
|
}
|
package/src/form.scss
CHANGED
|
@@ -5,6 +5,10 @@
|
|
|
5
5
|
display: flex;
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
gap: var(--spacing-32);
|
|
8
|
+
|
|
9
|
+
:where(h1, h2, h3, h4, h5, h6) {
|
|
10
|
+
margin-bottom: 0;
|
|
11
|
+
}
|
|
8
12
|
}
|
|
9
13
|
|
|
10
14
|
/* Single fields */
|
|
@@ -15,6 +19,8 @@
|
|
|
15
19
|
--form-field-size: var(--spacing-32);
|
|
16
20
|
--form-field-gap: var(--spacing-8);
|
|
17
21
|
--form-field-hint-offset: -2px;
|
|
22
|
+
--form-field-padding-x: 0px;
|
|
23
|
+
--form-field-padding-y: 0px;
|
|
18
24
|
|
|
19
25
|
position: relative;
|
|
20
26
|
display: flex;
|
|
@@ -22,7 +28,7 @@
|
|
|
22
28
|
gap: var(--form-field-gap);
|
|
23
29
|
}
|
|
24
30
|
|
|
25
|
-
|
|
31
|
+
:is(input, select, textarea) {
|
|
26
32
|
scroll-margin-top: 6.25rem;
|
|
27
33
|
}
|
|
28
34
|
|
|
@@ -31,7 +37,7 @@
|
|
|
31
37
|
}
|
|
32
38
|
|
|
33
39
|
@media (min-width: $mq-md) {
|
|
34
|
-
.coop-field:has(
|
|
40
|
+
.coop-field:has(:is(input, select, textarea):not([data-size])),
|
|
35
41
|
.coop-fieldset:not([data-size]) .coop-field {
|
|
36
42
|
--form-field-size: var(--spacing-40);
|
|
37
43
|
--form-font-size: var(--text-size-20);
|
|
@@ -39,39 +45,27 @@
|
|
|
39
45
|
}
|
|
40
46
|
}
|
|
41
47
|
|
|
42
|
-
.coop-field:has(
|
|
48
|
+
.coop-field:has(:is(input, select, textarea)[data-size="sm"]),
|
|
43
49
|
.coop-fieldset[data-size="sm"] .coop-field {
|
|
44
50
|
--form-field-size: var(--spacing-24);
|
|
45
51
|
--form-font-size: var(--text-size-16);
|
|
46
52
|
--form-field-hint-offset: 0px;
|
|
47
53
|
}
|
|
48
54
|
|
|
49
|
-
.coop-field:has(
|
|
55
|
+
.coop-field:has(:is(input, select, textarea)[data-size="md"]),
|
|
50
56
|
.coop-fieldset[data-size="md"] .coop-field {
|
|
51
57
|
--form-field-size: var(--spacing-32);
|
|
52
58
|
--form-font-size: var(--text-size-18);
|
|
53
59
|
--form-field-hint-offset: -2px;
|
|
54
60
|
}
|
|
55
61
|
|
|
56
|
-
.coop-field:has(
|
|
62
|
+
.coop-field:has(:is(input, select, textarea)[data-size="lg"]),
|
|
57
63
|
.coop-fieldset[data-size="lg"] .coop-field {
|
|
58
64
|
--form-field-size: var(--spacing-40);
|
|
59
65
|
--form-font-size: var(--text-size-20);
|
|
60
66
|
--form-field-hint-offset: -4px;
|
|
61
67
|
}
|
|
62
68
|
|
|
63
|
-
.coop-field-control {
|
|
64
|
-
position: relative;
|
|
65
|
-
display: flex;
|
|
66
|
-
align-items: center;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.coop-field-markers {
|
|
70
|
-
display: flex;
|
|
71
|
-
flex-direction: column;
|
|
72
|
-
flex-grow: 1;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
69
|
.coop-field-error {
|
|
76
70
|
display: block;
|
|
77
71
|
color: var(--color-error);
|
|
@@ -82,6 +76,11 @@
|
|
|
82
76
|
color: var(--color-text-alt);
|
|
83
77
|
}
|
|
84
78
|
|
|
79
|
+
.coop-field-hint,
|
|
80
|
+
.coop-field-error {
|
|
81
|
+
margin-top: -8px;
|
|
82
|
+
}
|
|
83
|
+
|
|
85
84
|
.coop-field-label {
|
|
86
85
|
display: flex;
|
|
87
86
|
align-items: center;
|
|
@@ -102,13 +101,27 @@
|
|
|
102
101
|
|
|
103
102
|
/* Field variants */
|
|
104
103
|
.coop-field.coop-field-inline {
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
display: grid;
|
|
105
|
+
grid-template-columns: auto 1fr;
|
|
106
|
+
gap: var(--spacing-6) var(--spacing-12);
|
|
107
|
+
align-items: center;
|
|
108
|
+
|
|
109
|
+
> *:not(input) {
|
|
110
|
+
grid-column: 2;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
input {
|
|
114
|
+
grid-column: 1;
|
|
115
|
+
margin-top: 0;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.coop-field-label {
|
|
119
|
+
margin-bottom: 0;
|
|
107
120
|
}
|
|
108
121
|
|
|
109
122
|
.coop-field-label + .coop-field-hint,
|
|
110
123
|
.coop-field-label + .coop-field-error {
|
|
111
|
-
margin-
|
|
124
|
+
margin-bottom: 0;
|
|
112
125
|
}
|
|
113
126
|
}
|
|
114
127
|
|
|
@@ -117,7 +130,10 @@
|
|
|
117
130
|
--form-field-border: var(--color-grey-700);
|
|
118
131
|
--form-field-border-width: 2px;
|
|
119
132
|
|
|
120
|
-
padding:
|
|
133
|
+
--form-field-padding-x: var(--spacing-16);
|
|
134
|
+
--form-field-padding-y: var(--spacing-16);
|
|
135
|
+
|
|
136
|
+
padding: var(--form-field-padding-y) var(--form-field-padding-x);
|
|
121
137
|
border-radius: var(--ui-border-radius-sm);
|
|
122
138
|
box-shadow: inset 0 0 0 var(--form-field-border-width) var(--form-field-border);
|
|
123
139
|
transition: box-shadow 0.1s ease-out;
|
|
@@ -151,8 +167,11 @@
|
|
|
151
167
|
/* Fieldsets */
|
|
152
168
|
|
|
153
169
|
.coop-fieldset {
|
|
170
|
+
--form-field-gap: var(--spacing-8);
|
|
171
|
+
|
|
154
172
|
display: flex;
|
|
155
173
|
flex-direction: column;
|
|
174
|
+
gap: var(--form-field-gap);
|
|
156
175
|
|
|
157
176
|
width: 100%;
|
|
158
177
|
margin: 0;
|
|
@@ -164,14 +183,12 @@
|
|
|
164
183
|
display: flex;
|
|
165
184
|
flex-direction: column;
|
|
166
185
|
gap: var(--spacing-8) var(--spacing-32);
|
|
167
|
-
|
|
168
|
-
&:not(:first-child) {
|
|
169
|
-
margin-top: var(--spacing-8);
|
|
170
|
-
}
|
|
171
186
|
}
|
|
172
187
|
|
|
173
188
|
.coop-fieldset-fields[data-orientation="horizontal"] {
|
|
174
|
-
|
|
189
|
+
@media (min-width: $mq-sm) {
|
|
190
|
+
flex-flow: row wrap;
|
|
191
|
+
}
|
|
175
192
|
}
|
|
176
193
|
|
|
177
194
|
/* Error states */
|
|
@@ -180,6 +197,8 @@
|
|
|
180
197
|
.coop-field:not(.coop-fieldset[data-error="true"] .coop-field, .coop-field[data-hide-error="true"]):is([data-error="true"]),
|
|
181
198
|
.coop-field:not(.coop-fieldset[data-error="true"] .coop-field, .coop-field[data-hide-error="true"]):has(:user-invalid),
|
|
182
199
|
.coop-fieldset:not([data-hide-error="true"]):is([data-error="true"]) {
|
|
200
|
+
--form-field-padding-x:var(--spacing-16);
|
|
201
|
+
|
|
183
202
|
padding-left: var(--spacing-16);
|
|
184
203
|
border-left: 4px solid var(--color-error);
|
|
185
204
|
}
|
|
@@ -201,10 +220,10 @@
|
|
|
201
220
|
// }
|
|
202
221
|
|
|
203
222
|
/* Disabled states */
|
|
204
|
-
.coop-field:has(
|
|
223
|
+
.coop-field:has(:is(input, select, textarea):disabled),
|
|
205
224
|
.coop-fieldset:disabled,
|
|
206
225
|
.coop-fieldset:disabled .coop-field,
|
|
207
|
-
.coop-fieldset-fields[data-boxed] .coop-field:has(
|
|
226
|
+
.coop-fieldset-fields[data-boxed] .coop-field:has(:is(input, select, textarea):disabled) {
|
|
208
227
|
--form-field-border: var(--color-grey-500);
|
|
209
228
|
--form-field-border-width: 2px;
|
|
210
229
|
|
|
@@ -236,6 +255,10 @@
|
|
|
236
255
|
outline-offset: 3px;
|
|
237
256
|
}
|
|
238
257
|
|
|
258
|
+
&--heading {
|
|
259
|
+
margin-bottom: var(--spacing-8);
|
|
260
|
+
}
|
|
261
|
+
|
|
239
262
|
&--errors {
|
|
240
263
|
padding-top: var(--spacing-12);
|
|
241
264
|
color: var(--color-error);
|
package/src/reset.scss
CHANGED
|
@@ -449,14 +449,19 @@ p {
|
|
|
449
449
|
}
|
|
450
450
|
|
|
451
451
|
ul,
|
|
452
|
-
ol
|
|
453
|
-
|
|
454
|
-
margin-inline-start: var(--spacing-24);
|
|
452
|
+
ol {
|
|
453
|
+
margin-left: var(--spacing-32);
|
|
455
454
|
padding: 0;
|
|
456
455
|
}
|
|
457
456
|
|
|
457
|
+
dd {
|
|
458
|
+
margin-bottom: var(--spacing-16);
|
|
459
|
+
margin-left: var(--spacing-12);
|
|
460
|
+
}
|
|
461
|
+
|
|
458
462
|
dt {
|
|
459
|
-
|
|
463
|
+
margin-bottom: var(--spacing-4);
|
|
464
|
+
font-weight: 600;
|
|
460
465
|
}
|
|
461
466
|
|
|
462
467
|
@media (prefers-reduced-motion: reduce) {
|
|
@@ -1,16 +1,6 @@
|
|
|
1
1
|
@use "../breakpoints.scss" as *;
|
|
2
2
|
|
|
3
3
|
/* Common */
|
|
4
|
-
h1,
|
|
5
|
-
h2,
|
|
6
|
-
h3,
|
|
7
|
-
h4,
|
|
8
|
-
h5,
|
|
9
|
-
h6,
|
|
10
|
-
strong {
|
|
11
|
-
font-weight: 600;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
4
|
h1,
|
|
15
5
|
h2,
|
|
16
6
|
h3,
|
|
@@ -19,6 +9,7 @@ h5,
|
|
|
19
9
|
h6 {
|
|
20
10
|
margin-top: 0;
|
|
21
11
|
margin-bottom: var(--spacing-8);
|
|
12
|
+
font-weight: 600;
|
|
22
13
|
}
|
|
23
14
|
|
|
24
15
|
/* Using Avenir */
|