feat: initialize Vue component library and aligned documentation
This commit is contained in:
@@ -0,0 +1,96 @@
|
||||
/* === Focus Ring === */
|
||||
@utility focus-ring {
|
||||
@apply ring-2 ring-focus ring-offset-0 ring-offset-background outline-none;
|
||||
/* Overrides the ring offset from the theme variables */
|
||||
--tw-ring-offset-width: var(--ring-offset-width);
|
||||
}
|
||||
|
||||
@utility focus-field-ring {
|
||||
@apply ring-2 ring-focus ring-offset-0 outline-none;
|
||||
/* No separation - ring sits directly against the element */
|
||||
--tw-ring-offset-width: 0px;
|
||||
}
|
||||
|
||||
@utility invalid-field-ring {
|
||||
/* Unfocused: show 1px outline */
|
||||
@apply outline-1 outline-danger outline-solid;
|
||||
--tw-ring-offset-width: 3px;
|
||||
|
||||
/* Focused: show 2px ring in danger color, remove outline */
|
||||
&:focus,
|
||||
&:focus-visible,
|
||||
&[data-focused="true"],
|
||||
&[data-focus-visible="true"],
|
||||
&:focus-within,
|
||||
&[data-focus-within="true"] {
|
||||
@apply ring-2 ring-danger ring-offset-0;
|
||||
--tw-ring-offset-width: 0px;
|
||||
}
|
||||
}
|
||||
|
||||
@utility no-highlight {
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Widens the pressable area of a control smaller than the 24px minimum target size
|
||||
* (WCAG 2.5.8) with a transparent centred overlay, leaving its size, its visible content
|
||||
* and the surrounding layout untouched. The host must establish a containing block
|
||||
* (`relative` or `absolute`), otherwise the overlay escapes to the nearest one.
|
||||
*/
|
||||
@utility touch-target {
|
||||
&::after {
|
||||
content: "";
|
||||
@apply absolute top-1/2 left-1/2 size-6 -translate-x-1/2 -translate-y-1/2;
|
||||
}
|
||||
}
|
||||
|
||||
/* === Statuses === */
|
||||
@utility status-focused {
|
||||
@apply focus-ring;
|
||||
}
|
||||
|
||||
@utility status-focused-field {
|
||||
@apply focus-field-ring;
|
||||
}
|
||||
|
||||
@utility status-invalid-field {
|
||||
@apply invalid-field-ring;
|
||||
}
|
||||
|
||||
@utility status-disabled {
|
||||
opacity: var(--disabled-opacity);
|
||||
cursor: var(--cursor-disabled);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
@utility status-pending {
|
||||
@apply pointer-events-none;
|
||||
}
|
||||
|
||||
/* === Scrollbars (standards-only; apply per scroll slot in component CSS) === */
|
||||
@utility scrollbar {
|
||||
scrollbar-width: var(--scrollbar-width);
|
||||
scrollbar-color: var(--scrollbar-color);
|
||||
scrollbar-gutter: var(--scrollbar-gutter);
|
||||
}
|
||||
|
||||
@utility scrollbar-thin {
|
||||
scrollbar-width: thin;
|
||||
scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
|
||||
scrollbar-gutter: auto;
|
||||
}
|
||||
|
||||
@utility scrollbar-default {
|
||||
scrollbar-width: auto;
|
||||
scrollbar-color: auto;
|
||||
scrollbar-gutter: auto;
|
||||
}
|
||||
|
||||
/* Direct properties only — does not inherit none to nested scroll slots */
|
||||
@utility scrollbar-none {
|
||||
scrollbar-width: none;
|
||||
scrollbar-color: auto;
|
||||
scrollbar-gutter: auto;
|
||||
-ms-overflow-style: none;
|
||||
}
|
||||
Reference in New Issue
Block a user