@leftium/nimble.css 0.2.0 → 0.4.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/src/_forms.scss CHANGED
@@ -41,7 +41,7 @@
41
41
 
42
42
  // When a validation message <small> immediately follows an input,
43
43
  // pull it up tight against the field and let it carry the spacing instead.
44
- :where(input, select, textarea) + :where(small) {
44
+ :where(input:not([type="submit"], [type="button"], [type="reset"]), select, textarea) + :where(small) {
45
45
  display: block;
46
46
  margin-top: calc(var(#{$prefix}spacing) * -0.75); // pull up under the input
47
47
  margin-bottom: var(#{$prefix}spacing);
@@ -60,11 +60,11 @@
60
60
  }
61
61
 
62
62
  // Color validation messages to match the field state
63
- :where(input, select, textarea)[aria-invalid="false"] + :where(small) {
63
+ :where(input:not([type="submit"], [type="button"], [type="reset"]), select, textarea)[aria-invalid="false"] + :where(small) {
64
64
  color: var(#{$prefix}valid);
65
65
  }
66
66
 
67
- :where(input, select, textarea)[aria-invalid="true"] + :where(small) {
67
+ :where(input:not([type="submit"], [type="button"], [type="reset"]), select, textarea)[aria-invalid="true"] + :where(small) {
68
68
  color: var(#{$prefix}invalid);
69
69
  }
70
70
 
@@ -79,6 +79,12 @@
79
79
  font-weight: 600;
80
80
  }
81
81
 
82
+ // file and range are short/inline controls — increase the label gap to match
83
+ // the visual weight of the spacing above and beside them.
84
+ :where(label:has(+ [type="file"], + [type="range"])) {
85
+ margin-bottom: 0.5em;
86
+ }
87
+
82
88
  // ----- Fieldset -----
83
89
 
84
90
  :where(fieldset) {
@@ -108,13 +114,20 @@
108
114
  display: flex;
109
115
  align-items: center;
110
116
  gap: 0.35em;
111
- margin-bottom: var(#{$prefix}spacing);
117
+ margin-bottom: 0.5em;
112
118
  }
113
119
 
114
- // Radio options in a group sit close together; only the last one
115
- // carries the full field-gap to the next element.
116
- :where(label:has([type="radio"])) {
117
- margin-bottom: 0.35em;
120
+ // Last checkbox/radio label in a group drops its bottom margin
121
+ // so the parent element controls spacing to the next sibling.
122
+ :where(label:has([type="checkbox"], [type="radio"]):last-child) {
123
+ margin-bottom: 0;
124
+ }
125
+
126
+ // ----- Search (pill shape) -----
127
+
128
+ :where([type="search"]) {
129
+ border-radius: 5rem;
130
+ padding-inline: 1.25em;
118
131
  }
119
132
 
120
133
  // ----- Range -----
@@ -122,6 +135,7 @@
122
135
  :where([type="range"]) {
123
136
  accent-color: var(#{$prefix}primary);
124
137
  width: 100%;
138
+ margin-bottom: var(#{$prefix}spacing);
125
139
  }
126
140
 
127
141
  // ----- Datalist-connected inputs -----
@@ -139,6 +153,7 @@
139
153
  font: inherit;
140
154
  cursor: pointer;
141
155
  max-width: 100%; // Prevent native file input from overflowing container (iOS Safari)
156
+ margin-bottom: var(#{$prefix}spacing);
142
157
  }
143
158
 
144
159
  :where([type="file"])::file-selector-button {
@@ -171,6 +186,7 @@
171
186
 
172
187
  :where([type="color"]) {
173
188
  --_color-size: calc(1em * 1.5 + 1em + 2px); // Match text input height
189
+ margin-bottom: var(#{$prefix}spacing);
174
190
 
175
191
  --_color-pad: 0.25em;
176
192
 
@@ -198,7 +214,7 @@
198
214
  // Minimal switch styling — relies on native checkbox with role="switch"
199
215
  // Browsers with :has() support get enhanced label alignment
200
216
  :where(label:has([type="checkbox"][role="switch"])) {
201
- display: inline-flex;
217
+ display: flex;
202
218
  align-items: center;
203
219
  gap: 0.5em;
204
220
  }
package/src/_select.scss CHANGED
@@ -26,6 +26,9 @@
26
26
 
27
27
  // Drop-down picker
28
28
  :where(select)::picker(select) {
29
+ position-area: block-end;
30
+ position-try-order: normal;
31
+ position-try-fallbacks: flip-block;
29
32
  border: 1px solid var(#{$prefix}border);
30
33
  border-radius: var(#{$prefix}radius);
31
34
  background-color: var(#{$prefix}surface-1);
@@ -22,6 +22,7 @@
22
22
  @use 'tables';
23
23
  @use 'code';
24
24
  @use 'media';
25
+ @use 'article';
25
26
  @use 'details';
26
27
  @use 'dialog';
27
28
  @use 'print';
package/src/nimble.scss CHANGED
@@ -22,6 +22,7 @@
22
22
  @use 'tables';
23
23
  @use 'code';
24
24
  @use 'media';
25
+ @use 'article';
25
26
  @use 'details';
26
27
  @use 'dialog';
27
28
  @use 'print';