vunor 0.3.1 → 0.3.2
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 +2 -0
- package/dist/theme.mjs +7 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -287,6 +287,8 @@ Each includes hover, active, and focus states. Hover and press do not paint on a
|
|
|
287
287
|
<button class="scope-error c8-flat">Cancel</button>
|
|
288
288
|
```
|
|
289
289
|
|
|
290
|
+
The `btn` layout primitive fades a disabled element to opacity 0.8. That is a default: `disabled-soft` (0.4) or a `disabled:opacity-*` utility replaces it, whether written on the element or composed with `btn` in your own shortcut (`'my-btn': 'btn disabled-soft'`).
|
|
291
|
+
|
|
290
292
|
### Inputable Styles (`i8`)
|
|
291
293
|
|
|
292
294
|
Input field design variants:
|
package/dist/theme.mjs
CHANGED
|
@@ -33,6 +33,11 @@ const toastShortcuts = defineShortcuts({
|
|
|
33
33
|
const disabledSelectors = ":disabled,[disabled],[aria-disabled=true],[data-disabled]";
|
|
34
34
|
/** Variant prefix that matches while the element is disabled. */
|
|
35
35
|
const whenDisabled = `[&:is(${disabledSelectors})]:`;
|
|
36
|
+
/**
|
|
37
|
+
* Variant prefix for a default disabled paint: matches while the element is
|
|
38
|
+
* disabled and adds no specificity, so any other disabled rule overrides it.
|
|
39
|
+
*/
|
|
40
|
+
const whenDisabledDefault = `[&:where(${disabledSelectors})]:`;
|
|
36
41
|
/** Variant prefix that matches only while the element is not disabled. */
|
|
37
42
|
const whenEnabled = `[&:not(${disabledSelectors})]:`;
|
|
38
43
|
//#endregion
|
|
@@ -244,7 +249,8 @@ const btn = defineShortcuts({
|
|
|
244
249
|
"[&.btn-round]:": btnRound,
|
|
245
250
|
"[&.btn-square]:": btnSquare,
|
|
246
251
|
"[&.btn-round.btn-square]:": "px-0 [--btn-icon-pull:0]",
|
|
247
|
-
[
|
|
252
|
+
[whenDisabledDefault]: "opacity-80",
|
|
253
|
+
[whenDisabled]: "cursor-not-allowed",
|
|
248
254
|
"[&>span]:data-[loading]:": "opacity-0 pointer-events-none",
|
|
249
255
|
"[&>div:not(.loading-indicator-wrapper)]:data-[loading]:": "opacity-0 pointer-events-none",
|
|
250
256
|
"[&>.loading-indicator-wrapper]:": "absolute left-0 top-0 right-0 bottom-0 flex items-center justify-center cursor-wait"
|