@wwtdev/bsds-css 2.0.9 → 2.1.1

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.
@@ -2,7 +2,7 @@
2
2
  --btn-main: var(--bs-blue-base);
3
3
  --btn-secondary: var(--bs-blue-medium);
4
4
  --btn-highlight: var(--bs-blue-100);
5
- --btn-padding: .25rem .75rem .375rem;
5
+ --btn-padding: .25rem .75rem;
6
6
  --btn-focus-pseudo-width: calc(100% + 0.5rem);
7
7
  align-items: center;
8
8
  background-color: var(--btn-main);
@@ -11,8 +11,9 @@
11
11
  color: var(--bs-white);
12
12
  cursor: pointer;
13
13
  display: inline-flex;
14
- font-size: var(--bs-text-md);
14
+ font-size: var(--btn-text-size, var(--bs-text-md));
15
15
  font-weight: 600;
16
+ height: var(--btn-height, 2.5rem);
16
17
  justify-content: center;
17
18
  line-height: 1.5;
18
19
  outline: 2px solid transparent;
@@ -34,7 +35,7 @@
34
35
  box-shadow: inset 0px 0px 4px 1px var(--btn-main);
35
36
  }
36
37
 
37
- /* Button Focus Styles */
38
+ /* ------------ Focus Styles ------------ */
38
39
  .bs-button::before {
39
40
  border-color: transparent;
40
41
  border-radius: 0.5rem;
@@ -64,7 +65,7 @@
64
65
  box-shadow: none;
65
66
  }
66
67
 
67
- /* Ghost Buttons */
68
+ /* ------------ Ghost Buttons ------------ */
68
69
  .bs-button:where([data-ghost]:not([data-ghost="false"])) {
69
70
  --btn-light: var(--bs-blue-10);
70
71
  --btn-secondary: var(--bs-blue-10);
@@ -85,7 +86,7 @@
85
86
  inset 0px 0px 4px 1px var(--btn-highlight);
86
87
  }
87
88
 
88
- /* Button type */
89
+ /* ------------ Button type ------------ */
89
90
  .bs-button:where([data-variant^='secondary']) {
90
91
  --btn-main: var(--bs-plum-400);
91
92
  --btn-secondary: var(--bs-plum-300);
@@ -117,14 +118,15 @@
117
118
  --btn-highlight: var(--bs-red-100);
118
119
  }
119
120
 
120
- /* Text Button */
121
+ /* ------------ Text Button ------------ */
121
122
  .bs-button:where([data-text]:not([data-text="false"])) {
122
- --btn-padding: 0 0;
123
- --btn-focus-pseudo-width: calc(100% + 1.25rem); /* text btns don't have side padding, but we do want focus outline to look padded */
123
+ --btn-height: auto;
124
+ --btn-padding: 0;
125
+ --btn-focus-pseudo-width: calc(100% + 1rem); /* text btns don't have side padding, but we do want focus outline to look padded */
126
+ --btn-text-size: var(--bs-text-md);
124
127
  background-color: transparent;
125
128
  color: var(--bs-blue-500);
126
129
  cursor: pointer;
127
- font-size: var(--bs-text-md);
128
130
  font-weight: 400;
129
131
  line-height: 150%;
130
132
  }
@@ -140,15 +142,29 @@
140
142
  box-shadow: none;
141
143
  }
142
144
 
143
- /* Button Size */
145
+ /* ------------ Button Size -------------- */
144
146
  .bs-button:where([data-size^='sm']) {
145
- font-size: var(--bs-text-sm);
147
+ --btn-height: 1.75rem;
148
+ --btn-padding: .25rem .75rem .375rem;
149
+ --btn-text-size: var(--bs-text-sm);
150
+ }
151
+
152
+ .bs-button:where([data-size][data-text]:not([data-text="false"])) {
153
+ --btn-height: auto;
154
+ --btn-padding: 0;
155
+ }
156
+
157
+ .bs-button:where([data-size^='sm'][data-text]:not([data-text="false"])) {
158
+ --btn-text-size: var(--bs-text-base);
146
159
  }
147
- .bs-button:where([data-size^='sm']):where([data-text]:not([data-text="false"])) {
148
- font-size: var(--bs-text-base);
160
+
161
+ /* Size XS only applies to text buttons */
162
+ .bs-button:where([data-size^='xs'][data-text]:not([data-text="false"])) {
163
+ --btn-text-size: var(--bs-text-sm);
149
164
  }
150
165
 
151
- /* Disabled Styling */
166
+
167
+ /* ------------ Disabled Styling ------------ */
152
168
  :where(button:disabled),
153
169
  .bs-button:where(:disabled),
154
170
  .bs-button:where([aria-disabled="true"]) /* for links as buttons */ {
@@ -170,16 +186,7 @@
170
186
  background-color: transparent;
171
187
  }
172
188
 
173
- /* Icon Height */
174
- .bs-button :where(svg:not([height])) {
175
- height: var(--bs-text-base);
176
- }
177
-
178
- .bs-button:where([data-size^='sm']) :where(svg:not([height])) {
179
- height: var(--bs-text-xs);
180
- }
181
-
182
- /* links as buttons */
189
+ /* ------------ links as buttons ------------ */
183
190
  a.bs-button {
184
191
  align-items: center;
185
192
  display: inline-flex;
@@ -39,7 +39,7 @@ a.bs-circle-button {
39
39
  height: calc(100% + 0.5rem);
40
40
  inset: -0.25rem;
41
41
  position: absolute;
42
- transition: border-color 0.125s ease-in-out;
42
+ transition: border-color 125ms ease-in-out, transform 100ms ease-in-out;
43
43
  width: calc(100% + 0.5rem);
44
44
  }
45
45
 
@@ -100,10 +100,12 @@ a.bs-circle-button {
100
100
  box-shadow: inset 0px 0px 4px 1px var(--btn-main);
101
101
  }
102
102
 
103
- .bs-circle-button:where([data-direction="right"]):hover :where(.bs-circle-button-icon) {
103
+ .bs-circle-button:where([data-direction="right"]):hover :where(.bs-circle-button-icon),
104
+ .bs-circle-button:where([data-direction="right"]):hover::before {
104
105
  transform: translateX(.25rem);
105
106
  }
106
- .bs-circle-button:where([data-direction="left"]):hover :where(.bs-circle-button-icon) {
107
+ .bs-circle-button:where([data-direction="left"]):hover :where(.bs-circle-button-icon),
108
+ .bs-circle-button:where([data-direction="left"]):hover::before {
107
109
  transform: translateX(-.25rem);
108
110
  }
109
111
 
@@ -0,0 +1,97 @@
1
+ /*
2
+ custom properties:
3
+ --filterbtn-caret-size
4
+ --filterbtn-caret-transform
5
+ --filterbtn-color
6
+ --filterbtn-focus-color
7
+ --filterbtn-height
8
+ --filterbtn-text-size
9
+ --filterbtn-weight
10
+ */
11
+
12
+ button:where(.bs-filter-button) {
13
+ flex-shrink: 0;
14
+ }
15
+
16
+ .bs-filter-button {
17
+ align-items: center;
18
+ border-radius: 0.25rem;
19
+ color: var(--filterbtn-color, var(--bs-ink-blue));
20
+ column-gap: 0.5rem;
21
+ cursor: pointer;
22
+ display: inline-flex;
23
+ font-size: var(--filterbtn-text-size, var(--bs-text-base));
24
+ font-weight: var(--filterbtn-weight, 400);
25
+ height: var(--filterbtn-height, 2rem);
26
+ line-height: 1.5;
27
+ outline: solid var(--filterbtn-focus-color, transparent) .125rem;
28
+ outline-offset: -.125rem;
29
+ padding-inline: .5rem;
30
+ transition: outline-color 100ms ease-in-out;
31
+ width: max-content;
32
+ }
33
+
34
+ .bs-filter-button :where(.bs-icon),
35
+ .bs-filter-button :where(span:has(svg:only-child)) {
36
+ display: block;
37
+ height: var(--filterbtn-caret-size, 1rem);
38
+ line-height: 1;
39
+ transform: var(--filterbtn-caret-transform, rotate(0deg));
40
+ transform-origin: center;
41
+ transition: var(--bs-trans-rotate180);
42
+ width: var(--filterbtn-caret-size, 1rem);
43
+ }
44
+
45
+ .bs-filter-button:where([data-size="sm"],[data-size="xs"]) {
46
+ --filterbtn-height: 1.75rem;
47
+ --filterbtn-text-size: var(--bs-text-sm);
48
+ --filterbtn-caret-size: .75rem;
49
+ }
50
+
51
+ .bs-filter-button:where([data-size="sm"]) {
52
+ --filterbtn-text-size: var(--bs-text-sm);
53
+ }
54
+
55
+ .bs-filter-button:where([data-size="xs"]) {
56
+ --filterbtn-text-size: var(--bs-text-xs);
57
+ --filterbtn-weight: 600;
58
+ }
59
+
60
+ /* Hover state */
61
+ .bs-filter-button:hover {
62
+ --filterbtn-color: var(--bs-blue-base);
63
+ }
64
+
65
+ /* Focus state */
66
+ .bs-filter-button:where(:focus-visible) {
67
+ --filterbtn-focus-color: var(--bs-blue-base);
68
+ }
69
+
70
+ /* Filter open state */
71
+ .bs-filter-button:where([aria-expanded="true"],[data-open="true"]) {
72
+ --filterbtn-caret-transform: rotate(180deg);
73
+ }
74
+
75
+ /* Badge non-standard color */
76
+ .bs-filter-button :where(.bs-badge) {
77
+ --badge-bg: var(--bs-ink-blue);
78
+ }
79
+
80
+ :where(.dark) .bs-filter-button :where(.bs-badge) {
81
+ --badge-bg: var(--bs-blue-medium);
82
+ }
83
+
84
+ .bs-filter-button:hover :where(.bs-badge) {
85
+ --badge-bg: var(--filterbtn-color);
86
+ }
87
+
88
+ /* Disabled state */
89
+ .bs-filter-button:where(:disabled) {
90
+ --filterbtn-color: var(--bs-ink-disabled);
91
+ cursor: default;
92
+ }
93
+
94
+ .bs-filter-button:where(:disabled) :where(.bs-badge) {
95
+ --badge-bg: var(--bs-bg-disabled);
96
+ --badge-text: var(--bs-ink-disabled);
97
+ }
@@ -10,7 +10,7 @@
10
10
  border-radius: .25rem;
11
11
  color: var(--bs-ink-base);
12
12
  display: flex;
13
- height: 2.5rem;
13
+ height: var(--input-addon-height, 2.5rem);
14
14
  overflow: hidden;
15
15
  padding: 0;
16
16
  pointer-events: none;
@@ -52,7 +52,7 @@ and issues with box-sizing
52
52
  flex-shrink: 0;
53
53
  position: relative;
54
54
  }
55
- .bs-input-addon > :where([data-autowidth]:not([data-autowidth="false"]), .bs-input-addon, bs-input) {
55
+ .bs-input-addon > :where([data-autowidth]:not([data-autowidth="false"]), .bs-input-addon, bs-input, .bs-input) {
56
56
  flex-grow: 1;
57
57
  flex-shrink: 1;
58
58
  }
@@ -73,6 +73,7 @@ and issues with box-sizing
73
73
  .bs-input-addon > *,
74
74
  .bs-input-addon :where(input, select),
75
75
  .bs-input-addon :is(bs-input, bs-select) :where(input, select),
76
+ .bs-input-addon :is(input, select):where(.bs-input, .bs-select),
76
77
  .bs-input-addon :where(.bs-input-addon) {
77
78
  --input-border: transparent;
78
79
  --input-border-width: 0px;
@@ -82,9 +83,11 @@ and issues with box-sizing
82
83
  --input-addon-nested-border: transparent;
83
84
  }
84
85
 
85
- .bs-input-addon :where(:focus-within) :where(input, select),
86
+ .bs-input-addon :where(:focus-within) :where(input, select, button),
86
87
  .bs-input-addon :where(:focus-within) :is(bs-input, bs-select) :where(input, select),
87
- .bs-input-addon :where(input, select):where(:focus, :focus-within, :focus-visible),
88
+ .bs-input-addon :where(:focus-within) :is(input, select, button):where(.bs-input, .bs-select),
89
+ .bs-input-addon :where(input, select, button):where(:focus, :focus-within, :focus-visible),
90
+ .bs-input-addon :is(input, select):where(.bs-input, .bs-select):where(:focus, :focus-within, :focus-visible),
88
91
  .bs-input-addon :is(bs-input, bs-select) :where(input, select):where(:focus, :focus-within, :focus-visible) {
89
92
  --input-border: transparent;
90
93
  box-shadow: none;
@@ -138,6 +141,7 @@ and issues with box-sizing
138
141
  .bs-input-addon:where(:not([data-multifocus]):focus-within),
139
142
  .bs-input-addon:where([data-multifocus="false"]:focus-within),
140
143
  .bs-input-addon:where([data-multifocus]:not([data-multifocus="false"])) :where(input, select):where(:focus, :focus-within, :focus-visible),
144
+ .bs-input-addon:where([data-multifocus]:not([data-multifocus="false"])) :is(input, select):where(.bs-input, .bs-select):where(:focus, :focus-within, :focus-visible),
141
145
  .bs-input-addon:where([data-multifocus]:not([data-multifocus="false"])) :is(bs-input, bs-select) :where(input, select):where(:focus, :focus-within, :focus-visible) {
142
146
  --input-border: var(--focus-border);
143
147
  position: relative;
@@ -153,11 +157,13 @@ and issues with box-sizing
153
157
  z-index: 1;
154
158
  }
155
159
 
156
- .bs-input-addon:where([data-multifocus]:not([data-multifocus="false"])) > :where(:not(.bs-input-addon)) > :where(input:focus, select:focus),
160
+ .bs-input-addon:where([data-multifocus]:not([data-multifocus="false"])) > :where(:not(.bs-input-addon)) > :where(input:focus, select:focus, button:focus),
161
+ .bs-input-addon:where([data-multifocus]:not([data-multifocus="false"])) > :is(input, select):where(.bs-input, .bs-select):where(:focus),
157
162
  .bs-input-addon:where([data-multifocus]:not([data-multifocus="false"])) > :is(bs-input, bs-select) :where(input:focus, select:focus),
158
- .bs-input-addon:where([data-multifocus]:not([data-multifocus="false"])) > :where(input:focus, select:focus) {
163
+ .bs-input-addon:where([data-multifocus]:not([data-multifocus="false"])) > :where(input:focus, select:focus, button:focus) {
159
164
  border-radius: .25rem;
160
165
  box-shadow: var(--focus-border) 0px 0px 0px 1px inset;
166
+ z-index: 1;
161
167
  }
162
168
 
163
169
  .bs-input-addon:where(:not([data-multifocus]):focus-within)::after,
@@ -182,7 +188,7 @@ and issues with box-sizing
182
188
 
183
189
  /* -------- Disabled styles -------- */
184
190
  .bs-input-addon:where([data-disabled]:not([data-disabled="false"])),
185
- .bs-input-addon:where([data-disabled]:not([data-disabled="false"])) bs-button .bs-button {
191
+ .bs-input-addon:where([data-disabled]:not([data-disabled="false"])) .bs-button {
186
192
  --input-bg: var(--bs-gray-200);
187
193
  --input-border: var(--bs-gray-400);
188
194
  color: var(--bs-gray-400);
@@ -7,12 +7,13 @@
7
7
  box-sizing: content-box;
8
8
  }
9
9
 
10
- .bs-input-search:where(.bs-input-addon) :where([data-component="bs-icon-search"]) {
11
- --icon-size: 1.75rem;
12
- padding-left: 0.75rem;
10
+ .bs-input-search :where([data-component="bs-icon-search"]) {
11
+ --icon-size: var(--search-icon-size, 1.75rem);
12
+ padding: var(--search-icon-padding, 0 0 0 .75rem);
13
13
  }
14
14
 
15
- .bs-input-search:where(.bs-input-addon) :where(button) {
15
+ /* Clear Button */
16
+ .bs-input-search button {
16
17
  align-items: center;
17
18
  background-color: transparent;
18
19
  cursor: pointer;
@@ -23,8 +24,37 @@
23
24
  transition: transform 100ms ease-in-out;
24
25
  }
25
26
 
26
- .bs-input-search:where(.bs-input-addon) :where(button:active) {
27
+ .bs-input-search button:where(:active) {
27
28
  transform: scale(0.97);
28
29
  transform-origin: center;
29
30
  box-shadow: inset 0px 0px 4px 1px var(--bs-blue-base);
30
31
  }
32
+
33
+ .bs-input-search button:where(:focus) {
34
+ border-radius: .25rem;
35
+ box-shadow: var(--focus-border) 0px 0px 0px 1px inset;
36
+ z-index: 1;
37
+ }
38
+
39
+
40
+ /* Filter variant */
41
+
42
+ .bs-input-search:where([data-variant="filter"]) {
43
+ --focus-border: transparent;
44
+ --input-border: transparent;
45
+ --input-addon-height: 1.5rem;
46
+ --input-caret: var(--bs-blue-base);
47
+ --input-padding-block: 0 0.125rem;
48
+ --input-padding-inline: 0.5rem;
49
+ --input-placeholder: var(--bs-ink-light);
50
+ --input-text-size: var(--bs-text-sm);
51
+ --search-icon-size: 1rem;
52
+ --search-icon-padding: 0;
53
+ }
54
+
55
+ /* -------- Disabled styles -------- */
56
+ .bs-input-addon:where([data-variant="filter"][data-disabled="true"]),
57
+ .bs-input-addon:where([data-variant="filter"][data-disabled="true"]) :is(.bs-button, .bs-input) {
58
+ --input-bg: var(--bs-bg-base);
59
+ --input-border: transparent;
60
+ }
@@ -4,26 +4,36 @@
4
4
  margin-top: 0.25rem;
5
5
  }
6
6
 
7
+ /*
8
+ Custom properties:
9
+ --input-bg (background color)
10
+ --input-border (border color)
11
+ --input-border-width (border width)
12
+ --input-caret (caret color)
13
+ --input-padding-block (padding block)
14
+ --input-padding-inline (padding inline)
15
+ --input-placeholder (placeholder color)
16
+ --input-text-size (font size)
17
+ */
18
+
7
19
  input:where(:not([type='checkbox'], [type='radio'], [type='file'], [type='range'])),
8
20
  textarea,
9
21
  select,
10
22
  :is(.bs-input, .bs-select, .bs-textarea) {
11
- --input-bg: var(--bs-bg-base);
12
- --input-border: var(--bs-violet-medium);
13
23
  appearance: none;
14
- background-color: var(--input-bg);
15
- border-color: var(--input-border);
24
+ background-color: var(--input-bg, var(--bs-bg-base));
25
+ border-color: var(--input-border, var(--bs-violet-medium));
16
26
  border-radius: 0.25rem;
17
27
  border-style: solid;
18
28
  border-width: var(--input-border-width, 1px);
19
- caret-color: var(--bs-blue-base);
29
+ caret-color: var(--input-caret, var(--bs-blue-base));
20
30
  color: var(--bs-ink-base);
21
- font-size: var(--bs-text-base);
31
+ font-size: var(--input-text-size, var(--bs-text-base));
22
32
  font-weight: 400;
23
33
  height: 2.5rem;
24
34
  line-height: var(--bs-leading-base);
25
- min-height: 2.5rem;
26
- padding-inline: 0.75rem;
35
+ padding-block: var(--input-padding-block, 0.0625rem);
36
+ padding-inline: var(--input-padding-inline, 0.75rem);
27
37
  }
28
38
 
29
39
  input:where(:not([type='checkbox'], [type='radio'], [type='file'], [type='range'])),
@@ -48,7 +58,7 @@ textarea {
48
58
 
49
59
  :is(input, textarea, select)::placeholder,
50
60
  :is(.bs-input, .bs-select, .bs-textarea)::placeholder {
51
- color: var(--bs-violet-lightest);
61
+ color: var(--input-placeholder, var(--bs-violet-lightest));
52
62
  }
53
63
  :is(input, textarea, select):where(:focus-visible)::placeholder,
54
64
  :is(.bs-input, .bs-select, .bs-textarea):where(:focus-visible)::placeholder {
@@ -58,6 +68,7 @@ textarea {
58
68
  :is(input:where(:not([type='checkbox'], [type='radio'])), textarea, select):where(:focus-visible),
59
69
  :is(.bs-input, .bs-select, .bs-textarea):where(:focus-visible) {
60
70
  --input-border: var(--bs-blue-base);
71
+ outline-style: none;
61
72
  outline-width: 0px;
62
73
  }
63
74
 
@@ -811,6 +811,15 @@ a:where(.bs-link):where(:focus:not(:focus-visible)) {
811
811
  box-shadow: var(--bs-shadow-profilePhoto);
812
812
  }
813
813
 
814
+ :root {
815
+ /* get design sign off on these first
816
+ --bs-trans-color: color 100ms ease-in-out;
817
+ --bs-trans-outline-color: outline-color 100ms ease-in-out;
818
+ */
819
+
820
+ --bs-trans-rotate180: transform 200ms ease-in-out;
821
+ }
822
+
814
823
  /* Specificity should be either (0, 1, 0) (class-based) or (0, 0, 1) (element-based) for each selector */
815
824
 
816
825
  .box {