@wwtdev/bsds-css 0.0.3

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/README.md ADDED
@@ -0,0 +1,7 @@
1
+ # BSDS CSS Framework
2
+
3
+ ## Developing Global Styles
4
+
5
+ When adding styles with "global" or "global-like" selectors, developers should also add the `:host` selector.
6
+
7
+ e.g., If you're adding styles with the `:root`, `html`, `body`, go ahead and slap a comma-separated `:host` selector there as well.
@@ -0,0 +1,62 @@
1
+ @mixin badge() {
2
+ .badge[data-position^='left']::before,
3
+ .badge:where(:not([data-position^='left']))::after {
4
+ align-items: center;
5
+ background: var(--bs-red-500);
6
+ border-radius: 0.5rem;
7
+ content: '';
8
+ display: inline-flex;
9
+ font-size: 0.8125rem;
10
+ font-variant-numeric: tabular-nums;
11
+ font-weight: 600;
12
+ height: 6px;
13
+ justify-content: center;
14
+ line-height: 1;
15
+ position: relative;
16
+ vertical-align: top;
17
+ width: 6px;
18
+ }
19
+
20
+ .pill .badge::before,
21
+ .pill .badge::after {
22
+ font-size: 0.8125em;
23
+ }
24
+
25
+ .badge[data-count]:where([data-position^='left'])::before,
26
+ .badge[data-count]:where(:not([data-position^='left']))::after {
27
+ color: white;
28
+ content: attr(data-count);
29
+ min-height: 1rem;
30
+ min-width: 1rem;
31
+ padding: 0 4px;
32
+ top: -0.0625rem;
33
+ vertical-align: unset;
34
+ width: auto;
35
+ }
36
+
37
+ .badge[data-count]::before {
38
+ margin-right: 0.25rem;
39
+ }
40
+
41
+ .badge[data-count]::after {
42
+ margin-left: 0.25rem;
43
+ }
44
+
45
+ .badge[data-count='0']::before,
46
+ .badge[data-count='0']::after {
47
+ display: none;
48
+ }
49
+
50
+ .badge[data-badge-color^='blue']::before,
51
+ .badge[data-badge-color^='blue']::after {
52
+ background: var(--bs-blue-500);
53
+ }
54
+
55
+ .badge[data-badge-color^='white']::before,
56
+ .badge[data-badge-color^='white']::after {
57
+ background: white;
58
+ color: var(--badge-text, var(--bs-black));
59
+ }
60
+
61
+ }
62
+
@@ -0,0 +1,192 @@
1
+ @mixin buttons() {
2
+ :where(button) {
3
+ background-color: inherit;
4
+ border-color: transparent;
5
+ color: inherit;
6
+ font-size: var(--bs-text-base);
7
+ position: relative;
8
+ padding: var(--bs-space-0);
9
+ text-decoration: none;
10
+ }
11
+
12
+ .button {
13
+ --btn-main: var(--bs-blue-400);
14
+ --btn-secondary: var(--bs-blue-300);
15
+ --btn-highlight: var(--bs-blue-100);
16
+ align-items: center;
17
+ background-color: var(--btn-main);
18
+ border: none;
19
+ border-radius: 0.25rem;
20
+ color: var(--bs-white);
21
+ cursor: pointer;
22
+ display: inline-flex;
23
+ font-size: var(--bs-text-md);
24
+ font-weight: 600;
25
+ line-height: 1.5;
26
+ outline: 2px solid transparent;
27
+ padding: var(--bs-space-1) var(--bs-space-4) calc(var(--bs-space-1) * 1.5);
28
+ position: relative;
29
+ text-decoration: none;
30
+ transition: all 100ms ease-in-out;
31
+ vertical-align: middle;
32
+ }
33
+
34
+
35
+ .button:hover {
36
+ background-color: var(--btn-secondary);
37
+ }
38
+
39
+ .button:active {
40
+ background-color: var(--btn-secondary);
41
+ transform: scale(0.97);
42
+ transform-origin: center;
43
+ box-shadow: inset 0px 0px 4px 1px var(--btn-main);
44
+ }
45
+
46
+ /* Button Focus Styles */
47
+ .button::before {
48
+ border-color: transparent;
49
+ border-radius: 0.5rem;
50
+ border-style: solid;
51
+ border-width: 0.125rem;
52
+ content: '';
53
+ height: calc(100% + 0.5rem);
54
+ inset: -0.25rem;
55
+ position: absolute;
56
+ transition: border-color 0.125s ease-in-out;
57
+ width: calc(100% + 0.5rem);
58
+ }
59
+
60
+ .button:focus::before {
61
+ border-color: var(--btn-main);
62
+ }
63
+
64
+ .button:focus-visible::before {
65
+ border-color: var(--btn-main);
66
+ box-shadow: none;
67
+ }
68
+
69
+ .button:focus:not(:focus-visible)::before {
70
+ border-color: transparent;
71
+ box-shadow: none;
72
+ }
73
+
74
+ /* Ghost Buttons */
75
+ .button:where([data-ghost]) {
76
+ --btn-light: var(--bs-blue-10);
77
+ --btn-secondary: var(--bs-blue-10);
78
+ background-color: transparent;
79
+ box-shadow: inset 0 0 0 1px var(--btn-main);
80
+ color: var(--btn-main);
81
+ }
82
+ .button:where([data-ghost])::before {
83
+ border-radius: 0.4375rem;
84
+ }
85
+ .button:where([data-ghost]):hover,
86
+ .button:where([data-ghost]):focus {
87
+ background-color: var(--btn-light);
88
+ }
89
+ .button:where([data-ghost]):active {
90
+ box-shadow:
91
+ inset 0 0 0 1px var(--btn-main),
92
+ inset 0px 0px 4px 1px var(--btn-highlight);
93
+ }
94
+
95
+ /* Button type */
96
+ .button:where([data-variant^='secondary']) {
97
+ --btn-main: var(--bs-plum-400);
98
+ --btn-secondary: var(--bs-plum-300);
99
+ --btn-light: var(--bs-plum-10);
100
+ --btn-highlight: var(--bs-plum-100);
101
+ }
102
+ .dark .button:where([data-variant^='secondary']) {
103
+ --btn-main: var(--bs-plum-200);
104
+ --btn-secondary: var(--bs-plum-300);
105
+ --btn-light: var(--bs-navy-400);
106
+ --btn-highlight: var(--bs-plum-400);
107
+ }
108
+ .button:where([data-variant^='positive']) {
109
+ --btn-main: var(--bs-purple-400);
110
+ --btn-secondary: var(--bs-purple-300);
111
+ --btn-light: var(--bs-purple-10);
112
+ --btn-highlight: var(--bs-purple-100);
113
+ }
114
+ .button:where([data-variant^='warning']) {
115
+ --btn-main: var(--bs-orange-warning);
116
+ --btn-secondary: var(--bs-orange-300);
117
+ --btn-light: var(--bs-orange-10);
118
+ --btn-highlight: var(--bs-orange-100);
119
+ }
120
+ .button:where([data-variant^='negative']) {
121
+ --btn-main: var(--bs-red-400);
122
+ --btn-secondary: var(--bs-red-300);
123
+ --btn-light: var(--bs-red-10);
124
+ --btn-highlight: var(--bs-red-100);
125
+ }
126
+
127
+ /* Text Button */
128
+ .button:where([data-text]) {
129
+ background-color: transparent;
130
+ color: var(--bs-blue-500);
131
+ cursor: pointer;
132
+ font-size: var(--bs-text-md);
133
+ font-weight: 400;
134
+ line-height: 150%;
135
+ }
136
+ .button:where([data-text]):hover {
137
+ background-color: transparent;
138
+ text-decoration: underline;
139
+ }
140
+ .button:where([data-text]):active {
141
+ box-shadow: none;
142
+ }
143
+
144
+ /* Button Size */
145
+ .button:where([data-size^='sm']) {
146
+ font-size: var(--bs-text-sm);
147
+ }
148
+ .button:where([data-text][data-size^='sm']) {
149
+ font-size: var(--bs-text-base);
150
+ }
151
+
152
+ /* Disabled Styling */
153
+ :where(button:disabled),
154
+ .button:where([aria-disabled='true']) /* for links as buttons */ {
155
+ pointer-events: none;
156
+ }
157
+ .button:where(:disabled),
158
+ .button:where([aria-disabled='true']) {
159
+ color: var(--bs-gray-400);
160
+ background-color: var(--bs-gray-200);
161
+ }
162
+
163
+ .button:where([data-ghost]):disabled,
164
+ .button:where([data-ghost])[aria-disabled='true'] {
165
+ box-shadow: inset 0 0 0 1px var(--bs-gray-400);
166
+ }
167
+
168
+ .button:where([data-text]):disabled,
169
+ .button:where([data-text][aria-disabled='true']) {
170
+ background-color: transparent;
171
+ }
172
+
173
+ /* Icon Height */
174
+ .button :where(svg:not([height])) {
175
+ height: var(--bs-text-base);
176
+ }
177
+
178
+ .button:where([data-size^='sm']) :where(svg:not([height])) {
179
+ height: var(--bs-text-xs);
180
+ }
181
+
182
+ /* links as buttons */
183
+ a.button {
184
+ align-items: center;
185
+ display: inline-flex;
186
+ outline: none;
187
+ vertical-align: middle;
188
+ }
189
+
190
+
191
+ }
192
+
@@ -0,0 +1,274 @@
1
+ @mixin form-elements() {
2
+ :where(label, legend) {
3
+ color: var(--bs-ink-base);
4
+ display: inline-block;
5
+ font-size: var(--bs-text-sm);
6
+ font-weight: 600;
7
+ line-height: var(--bs-leading-base);
8
+ width: 100%;
9
+ }
10
+
11
+ :where(.required) {
12
+ color: var(--bs-red-400);
13
+ }
14
+
15
+ :where(.disabled, .disabled .required) {
16
+ color: var(--bs-gray-400);
17
+ }
18
+
19
+ :where(label + input, label > input):not([type^='checkbox'], [type^='radio']),
20
+ :where(label + textarea, label > textarea),
21
+ :where(label + select, label > select) {
22
+ margin-top: 0.25rem;
23
+ }
24
+
25
+ :where(input):not([type^='checkbox'], [type^='radio'], [type^='file'], [type^='range']),
26
+ :where(textarea, select) {
27
+ appearance: none;
28
+ background-color: var(--input-bg, var(--bs-bg-base));
29
+ border: 1px solid var(--input-border, var(--bs-violet-300));
30
+ border-radius: 0.25rem;
31
+ color: var(--bs-ink-base);
32
+ font-size: var(--bs-text-base);
33
+ font-weight: 400;
34
+ line-height: var(--bs-leading-base);
35
+ min-height: 40px;
36
+ padding: 0.5rem 0.75rem;
37
+ width: 100%;
38
+ }
39
+
40
+ :where(input, textarea, select)::placeholder {
41
+ color: var(--bs-violet-200);
42
+ opacity: 1;
43
+ }
44
+
45
+ :where(input, textarea, select):focus {
46
+ box-shadow:
47
+ 0 0 0 2px var(--offset-color, var(--bs-bg-base)),
48
+ 0 0 0 4px var(--outline-color, var(--bs-blue-400));
49
+ outline: 2px solid transparent;
50
+ }
51
+ :where(.box) :where(input, textarea, select):focus {
52
+ --offset-color: var(--bs-bg-subtle);
53
+ }
54
+ :where(.box[data-invert]) :where(input, textarea, select):focus {
55
+ --offset-color: var(--bs-bg-invert);
56
+ }
57
+
58
+ :where(input, textarea, select)[required]:focus,
59
+ :where(input, textarea, select).error {
60
+ --outline-color: var(--bs-red-200);
61
+ }
62
+
63
+ :where(input, textarea, select):disabled {
64
+ background-color: var(--bs-gray-200);
65
+ border-color: var(--bs-gray-400);
66
+ color: var(--bs-gray-400);
67
+ }
68
+
69
+ :where(input, textarea, select):disabled::placeholder,
70
+ :where(input, textarea, select)[disabled]::placeholder {
71
+ color: var(--bs-gray-400);
72
+ opacity: 1;
73
+ }
74
+
75
+ /* Character Counter for Textarea */
76
+ :where(textarea + .character-count) {
77
+ color: var(--bs-ink-base);
78
+ font-size: var(--bs-text-xs);
79
+ font-weight: 400;
80
+ text-align: right;
81
+ }
82
+
83
+ :where(textarea[disabled] + .character-count) {
84
+ color: var(--bs-gray-400);
85
+ }
86
+
87
+ /* Select */
88
+
89
+ :where(select) {
90
+ /* URL Encoded SVG dropdown caret so there is something there */
91
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='%230A0B19' d='M8.048 13.375a.745.745 0 0 1-.526-.217L0 5.686l1.053-1.061 6.995 6.95 6.897-6.85 1.053 1.06-7.423 7.373a.745.745 0 0 1-.527.217Z'/%3E%3C/svg%3E");
92
+ background-position: right 0.75rem center;
93
+ background-repeat: no-repeat;
94
+ background-size: 1em 1em;
95
+ }
96
+ .dark :where(select) {
97
+ /* URL Encoded SVG dropdown caret so there is something there */
98
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='%23ffffff' d='M8.048 13.375a.745.745 0 0 1-.526-.217L0 5.686l1.053-1.061 6.995 6.95 6.897-6.85 1.053 1.06-7.423 7.373a.745.745 0 0 1-.527.217Z'/%3E%3C/svg%3E");
99
+ }
100
+
101
+ /* Checkboxes & Radios */
102
+ :where(.checkbox, .radio) {
103
+ display: flex;
104
+ align-items: center;
105
+ font-size: var(--bs-text-base);
106
+ font-weight: 400;
107
+ gap: 0.5em;
108
+ line-height: 115%;
109
+ }
110
+ :where(.checkbox, .radio) label {
111
+ font-size: var(--bs-text-base);
112
+ font-weight: 400;
113
+ line-height: 115%;
114
+ width: auto;
115
+ }
116
+
117
+ :where(input[type^='checkbox'], input[type^='radio']) {
118
+ --box-shadow: var(--bs-ink-base);
119
+
120
+ appearance: none;
121
+ background-color: var(--bg-base);
122
+ box-shadow: inset 0 0 0 0.125rem var(--box-shadow);
123
+ display: grid;
124
+ height: 1rem;
125
+ margin: 0;
126
+ place-content: center;
127
+ position: relative;
128
+ width: 1rem;
129
+ }
130
+ :where(input[type^='checkbox'], input[type^='radio']):focus {
131
+ box-shadow:
132
+ inset 0 0 0 0.125rem var(--box-shadow),
133
+ 0 0 0 2px var(--offset-color, var(--bs-bg-base)),
134
+ 0 0 0 4px var(--outline-color, var(--bs-blue-400));
135
+ }
136
+
137
+ :where(input[type^='checkbox'], input[type^='radio']).error {
138
+ --box-shadow: var(--bs-red-400);
139
+ }
140
+
141
+ :where(input[type^='checkbox']) {
142
+ border-radius: 0.125rem;
143
+ }
144
+
145
+ :where(input[type^='radio']) {
146
+ border-radius: 50%;
147
+ }
148
+
149
+ :where(.checkbox, .radio)[data-size='sm'],
150
+ :where(.checkbox, .radio)[data-size='sm'] label {
151
+ font-size: var(--bs-text-sm);
152
+ line-height: 100%;
153
+ }
154
+
155
+ :where(.checkbox, .radio)[data-size='sm'] input {
156
+ width: var(--bs-text-xs);
157
+ height: var(--bs-text-xs);
158
+ }
159
+
160
+ :where(input[type='checkbox'])::before {
161
+ --filled-size: 1rem;
162
+ --check-fill-color: var(--bs-blue-400);
163
+
164
+ content: '';
165
+ border-radius: 0.125rem;
166
+ box-shadow: inset var(--filled-size) var(--filled-size) var(--check-fill-color);
167
+ height: var(--filled-size);
168
+ visibility: hidden;
169
+ width: var(--filled-size);
170
+ }
171
+
172
+ :where(input[type^='checkbox'])::after {
173
+ border: solid var(--bs-white);
174
+ border-width: 0 0.125rem 0.125rem 0;
175
+ content: '';
176
+ height: 0.75em;
177
+ left: 50%;
178
+ position: absolute;
179
+ top: 50%;
180
+ transform-origin: center;
181
+ transform: translate(-50%, -60%) rotate(45deg);
182
+ visibility: hidden;
183
+ width: 0.375em;
184
+ }
185
+
186
+ :where(input[type='radio'])::before {
187
+ --filled-size: 1rem;
188
+ --radio-fill-color: var(--bs-blue-400);
189
+
190
+ background-color: var(--radio-fill-color);
191
+ border-radius: 50%;
192
+ box-sizing: content-box;
193
+ content: '';
194
+ height: var(--filled-size);
195
+ visibility: hidden;
196
+ width: var(--filled-size);
197
+ }
198
+
199
+ :where(input[type='radio'])::after {
200
+ --inner-size: 0.375rem;
201
+ --inner-fill-color: var(--bs-white);
202
+
203
+ background-color: var(--inner-fill-color);
204
+ border-radius: 50%;
205
+ box-sizing: content-box;
206
+ content: '';
207
+ height: var(--inner-size);
208
+ left: 50%;
209
+ position: absolute;
210
+ top: 50%;
211
+ transform: translate(-50%, -50%);
212
+ visibility: hidden;
213
+ width: var(--inner-size);
214
+ }
215
+
216
+ :where(input[type='checkbox']:checked, input[type='radio']:checked)::before,
217
+ :where(input[type='checkbox']:checked, input[type='radio']:checked)::after {
218
+ visibility: visible;
219
+ }
220
+
221
+ :where(.checkbox, .radio)[data-size='sm'] input::before {
222
+ --filled-size: var(--bs-text-xs);
223
+ }
224
+
225
+ :where(.checkbox[data-size='sm'] input[type='checkbox'])::after {
226
+ height: 0.5625;
227
+ width: 0.3125;
228
+ }
229
+
230
+ :where(.radio[data-size='sm'] input[type='radio'])::after {
231
+ --inner-size: 0.25rem;
232
+ }
233
+
234
+ :where(input[type='checkbox'], input[type='radio']):disabled {
235
+ --box-shadow: var(--bs-gray-400);
236
+ background-color: transparent;
237
+ }
238
+
239
+ :where(input[type='checkbox']):checked:disabled:before {
240
+ --check-fill-color: var(--bs-gray-400);
241
+ }
242
+
243
+ :where(input[type='radio']):checked:disabled:before {
244
+ --radio-fill-color: var(--bs-gray-400);
245
+ }
246
+
247
+ /* Errors and Messages */
248
+ :where(input).error {
249
+ border-color: var(--bs-red-400);
250
+ }
251
+
252
+ :where(.message) {
253
+ color: var(--bs-gray-400);
254
+ font-size: var(--bs-text-xs);
255
+ padding-top: 0.5rem;
256
+ }
257
+ :where(.message.error) {
258
+ color: var(--bs-red-400);
259
+ }
260
+
261
+ /* Fieldset */
262
+ :where(fieldset) {
263
+ border: none;
264
+ margin-left: 0;
265
+ margin-right: 0;
266
+ padding: 0;
267
+ }
268
+ :where(fieldset legend) {
269
+ margin-bottom: 0.25rem;
270
+ padding: 0;
271
+ }
272
+
273
+ }
274
+