@wwtdev/bsds-css 1.6.4 → 1.7.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.
@@ -0,0 +1,119 @@
1
+ @mixin dropdown-options() {
2
+ /* Option list */
3
+ .bs-dropdown-options {
4
+ list-style: none;
5
+ padding: 0;
6
+ }
7
+
8
+ .bs-dropdown-options :where(li:first-child) {
9
+ margin-top: 0.5rem;
10
+ }
11
+
12
+ /* Option list item */
13
+ .bs-dropdown-options :where(li) {
14
+ align-items: center;
15
+ border-bottom: 2px solid transparent;
16
+ border-left: 4px solid transparent;
17
+ border-radius: 3px;
18
+ border-right: 2px solid transparent;
19
+ border-top: 2px solid transparent;
20
+ color: var(--bs-ink-base);
21
+ column-gap: 0.5rem;
22
+ cursor: pointer;
23
+ display: grid;
24
+ margin-bottom: 0.5rem;
25
+ padding-bottom: 0.25rem;
26
+ padding-left: 0.5rem;
27
+ padding-right: 0.75rem;
28
+ padding-top: 0.25rem;
29
+ row-gap: 0.125rem;
30
+ }
31
+
32
+ /* Variant: 2-col */
33
+ .bs-dropdown-options :where(li[data-variant~="2-col"]) {
34
+ grid-template-columns: min-content 1fr;
35
+ }
36
+
37
+ /* Variant: description */
38
+ .bs-dropdown-options :where(li:not([data-variant~="2-col"])[data-variant~="description"] :nth-child(2)) {
39
+ color: var(--bs-ink-light);
40
+ font-size: var(--bs-text-xs);
41
+ height: 1.125rem;
42
+ line-height: 1.125rem;
43
+ }
44
+
45
+ /* Variant: 2-col description */
46
+ .bs-dropdown-options :where(li[data-variant~="2-col"][data-variant~="description"] :nth-child(3)) {
47
+ color: var(--bs-ink-light);
48
+ font-size: var(--bs-text-xs);
49
+ grid-column-start: 2;
50
+ height: 1.125rem;
51
+ line-height: 1.125rem;
52
+ }
53
+
54
+ /* Hover or data-selected */
55
+ .bs-dropdown-options :where(li:hover),
56
+ .bs-dropdown-options :where(li[data-selected]) {
57
+ background-color: var(--bs-bg-subtle);
58
+ border-left: 4px solid var(--bs-blue-400);
59
+ color: var(--bs-blue-400);
60
+ outline: none;
61
+ }
62
+
63
+ /* Variant: negative */
64
+ .bs-dropdown-options :where(li[data-variant~="negative"]:hover),
65
+ .bs-dropdown-options :where(li[data-variant~="negative"][data-selected]),
66
+ .bs-dropdown-options :where(li[data-variant~="negative"][data-selected]:hover) {
67
+ /* 25% alpha version of --bs-red-400 */
68
+ background-color: rgba(248, 169, 170, 0.25);
69
+ border-left: 4px solid var(--bs-red-500);
70
+ color: var(--bs-red-500);
71
+ }
72
+
73
+ /* Hover or data-selected for 2-col/description variants */
74
+ .bs-dropdown-options :where(li:not([data-variant~="2-col"])[data-variant~="description"]:hover :nth-child(2)),
75
+ .bs-dropdown-options :where(li[data-variant~="2-col"][data-variant~="description"]:hover :nth-child(3)),
76
+ .bs-dropdown-options :where(li:not([data-variant~="2-col"])[data-variant~="description"][data-selected] :nth-child(2)),
77
+ .bs-dropdown-options :where(li[data-variant~="2-col"][data-variant~="description"][data-selected] :nth-child(3)) {
78
+ color: var(--bs-blue-400);
79
+ }
80
+
81
+ /* Hover or data-selected for negative + 2-col/description variants */
82
+ .bs-dropdown-options :where(li[data-variant~="negative"]:not([data-variant~="2-col"])[data-variant~="description"]:hover :nth-child(2)),
83
+ .bs-dropdown-options :where(li[data-variant~="negative"][data-variant~="2-col"][data-variant~="description"]:hover :nth-child(3)),
84
+ .bs-dropdown-options :where(li[data-variant~="negative"]:not([data-variant~="2-col"])[data-variant~="description"][data-selected] :nth-child(2)),
85
+ .bs-dropdown-options :where(li[data-variant~="negative"][data-variant~="2-col"][data-variant~="description"][data-selected] :nth-child(3)) {
86
+ color: var(--bs-red-500);
87
+ }
88
+
89
+ /* List option mouse click focus (do not show) */
90
+ .bs-dropdown-options :where(li:focus:not(:focus-visible)){
91
+ outline: none;
92
+ }
93
+
94
+ /* data-variant="negative" list option mouse click focus (do not show) */
95
+ .bs-dropdown-options :where(li[data-variant~="negative"]:focus:not(:focus-visible)) {
96
+ outline: none;
97
+ }
98
+
99
+ /* List option keyboard navigation focus */
100
+ .bs-dropdown-options :where(li:focus-visible) {
101
+ --focus-border-color: var(--bs-blue-400);
102
+ border: 2px solid var(--focus-border-color);
103
+ outline: none;
104
+ padding-left: 0.625rem;
105
+ }
106
+
107
+ /* Navigation focus on a selected element should preserve 4px left border */
108
+ .bs-dropdown-options :where(li[data-selected]:focus-visible) {
109
+ border-left: 4px solid var(--focus-border-color);
110
+ padding-left: 0.5rem;
111
+ }
112
+
113
+ /* data-variant="negative" list option keyboard navigation focus */
114
+ .bs-dropdown-options :where(li[data-variant~="negative"]:focus-visible) {
115
+ --focus-border-color: var(--bs-red-200);
116
+ }
117
+
118
+ }
119
+
@@ -1,24 +1,21 @@
1
1
  @mixin dropdown() {
2
- /* Positioning the parent */
3
- .bs-dropdown {
2
+ /* Parent */
3
+ .bs-dropdown-parent {
4
4
  display: inline-block;
5
5
  position: relative;
6
6
  }
7
7
 
8
- /* Option list */
9
- .bs-dropdown :where(ul) {
8
+ /* Content */
9
+ .bs-dropdown {
10
10
  background-color: var(--bs-white);
11
11
  border-radius: 4px;
12
12
  bottom: auto;
13
13
  box-shadow: var(--bs-shadow-contentMedium);
14
14
  line-height: 1.5rem;
15
- list-style: none;
16
15
  margin: 0;
17
16
  max-height: 0;
18
- max-width: 16.875rem;
19
17
  opacity: 0;
20
18
  overflow-y: auto;
21
- padding: 0;
22
19
  position: absolute;
23
20
  top: calc(100% + 0.5rem);
24
21
  transition-duration: 75ms;
@@ -27,167 +24,45 @@
27
24
  z-index: 999;
28
25
  }
29
26
 
30
- /* (not) data-variant="fit" */
31
- .bs-dropdown:not([data-variant="fit"]) :where(ul) {
32
- width: 16.875rem;
33
- }
34
-
35
- /* data-shown */
36
- .bs-dropdown:where([data-shown]) :where(ul) {
37
- max-height: 20rem;
38
- opacity: 1;
39
- padding-top: 0.75rem;
40
- }
41
-
42
- /* data-position="top" */
43
- .bs-dropdown:where([data-position="top"]) :where(ul) {
44
- bottom: calc(100% + 0.5rem);
45
- top: auto;
46
- }
47
-
48
- /* data-justify="center" */
49
- .bs-dropdown:where([data-justify="center"]) :where(ul) {
50
- left: 50%;
51
- transform: translateX(-50%);
52
- }
53
-
54
- /* Option list item */
55
- .bs-dropdown :where(ul li) {
56
- align-items: center;
57
- border-bottom: 2px solid transparent;
58
- border-left: 4px solid transparent;
59
- border-radius: 3px;
60
- border-right: 2px solid transparent;
61
- border-top: 2px solid transparent;
62
- color: var(--bs-ink-base);
63
- column-gap: 0.5rem;
64
- cursor: pointer;
65
- display: grid;
66
- margin-bottom: 0.5rem;
67
- padding-bottom: 0.25rem;
68
- padding-left: 0.5rem;
69
- padding-right: 0.75rem;
70
- padding-top: 0.25rem;
71
- row-gap: 0.125rem;
72
- }
73
-
74
- /* data-variant="search" (search input) */
75
- .bs-dropdown :where(ul li[data-variant~="search"]) {
76
- border-left: none;
77
- cursor: default;
78
- display: block;
79
- }
80
-
81
- /* data-variant="break" (list item) */
82
- .bs-dropdown :where(ul li[data-variant~="break"]) {
83
- border-left: none;
84
- cursor: default;
85
- display: block;
86
- padding: 0;
87
- }
88
-
89
- /* data-variant="break" (actual line break) */
90
- .bs-dropdown :where(ul li[data-variant~="break"] hr) {
91
- background: var(--bs-navy-200);
92
- }
93
-
94
- /* data-variant="2-col" */
95
- .bs-dropdown :where(ul li[data-variant~="2-col"]) {
96
- grid-template-columns: min-content 1fr;
97
- }
98
-
99
- /* data-variant="description" */
100
- /* Description will be the 2nd child in a 1-column item */
101
- .bs-dropdown :where(ul li:not([data-variant~="2-col"])[data-variant~="description"] :nth-child(2)) {
102
- color: var(--bs-ink-light);
103
- font-size: var(--bs-text-xs);
104
- height: 1.125rem;
105
- line-height: 1.125rem;
106
- }
107
-
108
- /* data-variant="2-col description" */
109
- /* Description will be the 3rd child in a 2-column item */
110
- .bs-dropdown :where(ul li[data-variant~="2-col"][data-variant~="description"] :nth-child(3)) {
111
- color: var(--bs-ink-light);
112
- font-size: var(--bs-text-xs);
113
- grid-column-start: 2;
114
- height: 1.125rem;
115
- line-height: 1.125rem;
116
- }
117
-
118
- /* List item hover or data-selected */
119
- .bs-dropdown :where(ul li:hover),
120
- .bs-dropdown :where(ul li[data-selected]) {
121
- background-color: var(--bs-bg-subtle);
122
- border-left: 4px solid var(--bs-blue-400);
123
- color: var(--bs-blue-400);
124
- outline: none;
27
+ /* Sizing */
28
+ .bs-dropdown:where([data-width="sm"]) {
29
+ width: 10rem;
125
30
  }
126
31
 
127
- /* data-variant="search" or data-variant="break" hover */
128
- .bs-dropdown :where(ul li[data-variant~="search"]:hover),
129
- .bs-dropdown :where(ul li[data-variant~="break"]:hover) {
130
- background-color: transparent;
131
- border-left: none;
132
- color: var(--bs-ink-base);
32
+ .bs-dropdown:where([data-width="md"]),
33
+ .bs-dropdown:where(:not([data-width])) {
34
+ width: 20rem;
133
35
  }
134
36
 
135
- /* data-variant="negative" hover, data-selected, and both */
136
- .bs-dropdown :where(ul li[data-variant~="negative"]:hover),
137
- .bs-dropdown :where(ul li[data-variant~="negative"][data-selected]),
138
- .bs-dropdown :where(ul li[data-variant~="negative"][data-selected]:hover) {
139
- /* 25% alpha version of --bs-red-400 */
140
- background-color: rgba(248, 169, 170, 0.25);
141
- border-left: 4px solid var(--bs-red-500);
142
- color: var(--bs-red-500);
37
+ .bs-dropdown:where([data-width="lg"]) {
38
+ width: 40rem;
143
39
  }
144
40
 
145
- /* data-variant="description" or data-variant="2-col description" hover or data-selected */
146
- .bs-dropdown :where(ul li:not([data-variant~="2-col"])[data-variant~="description"]:hover :nth-child(2)),
147
- .bs-dropdown :where(ul li[data-variant~="2-col"][data-variant~="description"]:hover :nth-child(3)),
148
- .bs-dropdown :where(ul li:not([data-variant~="2-col"])[data-variant~="description"][data-selected] :nth-child(2)),
149
- .bs-dropdown :where(ul li[data-variant~="2-col"][data-variant~="description"][data-selected] :nth-child(3)) {
150
- color: var(--bs-blue-400);
41
+ .bs-dropdown:where([data-width="content"]) {
42
+ width: auto;
151
43
  }
152
44
 
153
- /* data-variant="negative description" or data-variant="2-col negative description" hover or data-selected */
154
- .bs-dropdown :where(ul li[data-variant~="negative"]:not([data-variant~="2-col"])[data-variant~="description"]:hover :nth-child(2)),
155
- .bs-dropdown :where(ul li[data-variant~="negative"][data-variant~="2-col"][data-variant~="description"]:hover :nth-child(3)),
156
- .bs-dropdown :where(ul li[data-variant~="negative"]:not([data-variant~="2-col"])[data-variant~="description"][data-selected] :nth-child(2)),
157
- .bs-dropdown :where(ul li[data-variant~="negative"][data-variant~="2-col"][data-variant~="description"][data-selected] :nth-child(3)) {
158
- color: var(--bs-red-500);
45
+ .bs-dropdown-parent:where([data-width="toggle"]) :where(.bs-dropdown) {
46
+ width: 100%;
159
47
  }
160
48
 
161
- /* List option mouse click focus (do not show) */
162
- .bs-dropdown :where(ul li:focus:not(:focus-visible)){
163
- outline: none;
164
- }
165
-
166
- /* data-variant="negative" list option mouse click focus (do not show) */
167
- li[data-variant~="negative"]:focus:not(:focus-visible) {
168
- outline: none;
169
- }
170
-
171
- /* List option keyboard navigation focus */
172
- .bs-dropdown :where(ul li:focus-visible) {
173
- --focus-border-color: var(--bs-blue-400);
174
- border: 2px solid var(--focus-border-color);
175
- outline: none;
176
- padding-left: 0.625rem;
49
+ /* data-shown */
50
+ .bs-dropdown:where([data-shown]) {
51
+ max-height: 20rem;
52
+ opacity: 1;
177
53
  }
178
54
 
179
- /* Navigation focus on a selected element should preserve 4px left border */
180
- .bs-dropdown :where(ul li[data-selected]:focus-visible) {
181
- border-left: 4px solid var(--focus-border-color);
182
- padding-left: 0.5rem;
55
+ /* data-top */
56
+ .bs-dropdown:where([data-top]) {
57
+ bottom: calc(100% + 0.5rem);
58
+ top: auto;
183
59
  }
184
60
 
185
- /* data-variant="negative" list option keyboard navigation focus */
186
- .bs-dropdown :where(ul li[data-variant~="negative"]:focus-visible) {
187
- --focus-border-color: var(--bs-red-200);
61
+ /* data-justify="center" */
62
+ .bs-dropdown-parent:where([data-center]) :where(.bs-dropdown) {
63
+ left: 50%;
64
+ transform: translateX(-50%);
188
65
  }
189
66
 
190
-
191
-
192
67
  }
193
68
 
@@ -63,50 +63,52 @@
63
63
  }
64
64
 
65
65
  .bs-toast:where([data-dismissed]) {
66
- animation-duration: 200ms;
66
+ animation-duration: 200ms;
67
67
  animation-fill-mode: forwards;
68
68
  animation-name: slideDown;
69
69
  animation-timing-function: ease;
70
70
  }
71
71
 
72
- .bs-toast :where(.bs-toast-header) {
72
+ .bs-toast-header {
73
73
  align-items: center;
74
74
  color: var(--bs-ink-base);
75
75
  display: flex;
76
76
  gap: 0.5rem;
77
- padding-left: 1rem;
78
- padding-right: 1rem;
79
- padding-top: 1rem;
77
+ padding: 1rem;
80
78
  }
81
79
 
82
- .bs-toast :where(.bs-toast-header .bs-toast-header-icon) {
80
+ .bs-toast-header :where(.bs-toast-header-icon) {
83
81
  color: var(--bs-blue-400);
84
82
  }
85
83
 
86
- .bs-toast :where(h5) {
84
+ .bs-toast-header :where(h5) {
87
85
  font-weight: 400;
88
86
  }
89
87
 
90
- .bs-toast :where(.bs-toast-content) {
88
+ .bs-toast-body {
91
89
  border-bottom: 1px solid var(--bs-border);
92
90
  color: var(--bs-ink-light);
93
91
  padding-bottom: 1rem;
94
92
  padding-left: 1rem;
95
93
  padding-right: 1rem;
96
- padding-top: 0.25rem;
97
94
  }
98
95
 
99
- .bs-toast :where(.bs-toast-actions) {
96
+ .bs-toast-actions {
100
97
  /* Mobile - Buttons will be stacked */
101
98
  display: flex;
102
- flex-direction: column-reverse;
99
+ flex-direction: row;
103
100
  gap: 1rem;
101
+ justify-content: flex-end;
104
102
  padding-bottom: 0.5rem;
105
103
  padding-left: 1rem;
106
104
  padding-right: 1rem;
107
105
  padding-top: 0.5rem;
108
106
  }
109
107
 
108
+ .bs-toast-actions:where([data-stacked]) {
109
+ flex-direction: column-reverse;
110
+ }
111
+
110
112
  /* Warning Toast Styles */
111
113
  .bs-toast:where([data-variant^='warning']) {
112
114
  border-top: 4px solid var(--bs-orange-warning);
@@ -163,7 +165,7 @@
163
165
  }
164
166
 
165
167
  .bs-toast:where([data-dismissed]) {
166
- animation-duration: 200ms;
168
+ animation-duration: 200ms;
167
169
  animation-fill-mode: forwards;
168
170
  animation-name: slideRight;
169
171
  animation-timing-function: ease;
@@ -180,7 +182,7 @@
180
182
  transform: translateX(calc(100% + 1.5rem));
181
183
  }
182
184
  }
183
-
185
+
184
186
  @keyframes slideLeft {
185
187
  0% {
186
188
  opacity: 0;
@@ -192,12 +194,9 @@
192
194
  }
193
195
  }
194
196
 
195
- .bs-toast :where(.bs-toast-actions) {
196
- /* Non-mobile - Buttons will be side-by-side */
197
+ .bs-toast-actions:where([data-stacked]) {
197
198
  flex-direction: row;
198
- justify-content: flex-end;
199
199
  }
200
-
201
200
  }
202
201
 
203
202
  }
@@ -0,0 +1,115 @@
1
+ /* Option list */
2
+ .bs-dropdown-options {
3
+ list-style: none;
4
+ padding: 0;
5
+ }
6
+
7
+ .bs-dropdown-options :where(li:first-child) {
8
+ margin-top: 0.5rem;
9
+ }
10
+
11
+ /* Option list item */
12
+ .bs-dropdown-options :where(li) {
13
+ align-items: center;
14
+ border-bottom: 2px solid transparent;
15
+ border-left: 4px solid transparent;
16
+ border-radius: 3px;
17
+ border-right: 2px solid transparent;
18
+ border-top: 2px solid transparent;
19
+ color: var(--bs-ink-base);
20
+ column-gap: 0.5rem;
21
+ cursor: pointer;
22
+ display: grid;
23
+ margin-bottom: 0.5rem;
24
+ padding-bottom: 0.25rem;
25
+ padding-left: 0.5rem;
26
+ padding-right: 0.75rem;
27
+ padding-top: 0.25rem;
28
+ row-gap: 0.125rem;
29
+ }
30
+
31
+ /* Variant: 2-col */
32
+ .bs-dropdown-options :where(li[data-variant~="2-col"]) {
33
+ grid-template-columns: min-content 1fr;
34
+ }
35
+
36
+ /* Variant: description */
37
+ .bs-dropdown-options :where(li:not([data-variant~="2-col"])[data-variant~="description"] :nth-child(2)) {
38
+ color: var(--bs-ink-light);
39
+ font-size: var(--bs-text-xs);
40
+ height: 1.125rem;
41
+ line-height: 1.125rem;
42
+ }
43
+
44
+ /* Variant: 2-col description */
45
+ .bs-dropdown-options :where(li[data-variant~="2-col"][data-variant~="description"] :nth-child(3)) {
46
+ color: var(--bs-ink-light);
47
+ font-size: var(--bs-text-xs);
48
+ grid-column-start: 2;
49
+ height: 1.125rem;
50
+ line-height: 1.125rem;
51
+ }
52
+
53
+ /* Hover or data-selected */
54
+ .bs-dropdown-options :where(li:hover),
55
+ .bs-dropdown-options :where(li[data-selected]) {
56
+ background-color: var(--bs-bg-subtle);
57
+ border-left: 4px solid var(--bs-blue-400);
58
+ color: var(--bs-blue-400);
59
+ outline: none;
60
+ }
61
+
62
+ /* Variant: negative */
63
+ .bs-dropdown-options :where(li[data-variant~="negative"]:hover),
64
+ .bs-dropdown-options :where(li[data-variant~="negative"][data-selected]),
65
+ .bs-dropdown-options :where(li[data-variant~="negative"][data-selected]:hover) {
66
+ /* 25% alpha version of --bs-red-400 */
67
+ background-color: rgba(248, 169, 170, 0.25);
68
+ border-left: 4px solid var(--bs-red-500);
69
+ color: var(--bs-red-500);
70
+ }
71
+
72
+ /* Hover or data-selected for 2-col/description variants */
73
+ .bs-dropdown-options :where(li:not([data-variant~="2-col"])[data-variant~="description"]:hover :nth-child(2)),
74
+ .bs-dropdown-options :where(li[data-variant~="2-col"][data-variant~="description"]:hover :nth-child(3)),
75
+ .bs-dropdown-options :where(li:not([data-variant~="2-col"])[data-variant~="description"][data-selected] :nth-child(2)),
76
+ .bs-dropdown-options :where(li[data-variant~="2-col"][data-variant~="description"][data-selected] :nth-child(3)) {
77
+ color: var(--bs-blue-400);
78
+ }
79
+
80
+ /* Hover or data-selected for negative + 2-col/description variants */
81
+ .bs-dropdown-options :where(li[data-variant~="negative"]:not([data-variant~="2-col"])[data-variant~="description"]:hover :nth-child(2)),
82
+ .bs-dropdown-options :where(li[data-variant~="negative"][data-variant~="2-col"][data-variant~="description"]:hover :nth-child(3)),
83
+ .bs-dropdown-options :where(li[data-variant~="negative"]:not([data-variant~="2-col"])[data-variant~="description"][data-selected] :nth-child(2)),
84
+ .bs-dropdown-options :where(li[data-variant~="negative"][data-variant~="2-col"][data-variant~="description"][data-selected] :nth-child(3)) {
85
+ color: var(--bs-red-500);
86
+ }
87
+
88
+ /* List option mouse click focus (do not show) */
89
+ .bs-dropdown-options :where(li:focus:not(:focus-visible)){
90
+ outline: none;
91
+ }
92
+
93
+ /* data-variant="negative" list option mouse click focus (do not show) */
94
+ .bs-dropdown-options :where(li[data-variant~="negative"]:focus:not(:focus-visible)) {
95
+ outline: none;
96
+ }
97
+
98
+ /* List option keyboard navigation focus */
99
+ .bs-dropdown-options :where(li:focus-visible) {
100
+ --focus-border-color: var(--bs-blue-400);
101
+ border: 2px solid var(--focus-border-color);
102
+ outline: none;
103
+ padding-left: 0.625rem;
104
+ }
105
+
106
+ /* Navigation focus on a selected element should preserve 4px left border */
107
+ .bs-dropdown-options :where(li[data-selected]:focus-visible) {
108
+ border-left: 4px solid var(--focus-border-color);
109
+ padding-left: 0.5rem;
110
+ }
111
+
112
+ /* data-variant="negative" list option keyboard navigation focus */
113
+ .bs-dropdown-options :where(li[data-variant~="negative"]:focus-visible) {
114
+ --focus-border-color: var(--bs-red-200);
115
+ }