Files
2026-07-13 12:12:04 +08:00

29 lines
785 B
CSS

/* Base label styles */
.label {
/* Base styling */
@apply text-sm font-medium text-foreground;
}
/*
* Exclude group-level components (RadioGroup, CheckboxGroup) and radio/checkbox items
* to ensure asterisks only appear on atomic form field labels and group labels,
* not on individual options within those groups
*/
.label--required,
[data-required="true"]:not([role="group"]):not([role="radiogroup"]):not([role="checkboxgroup"])
> .label,
[data-required="true"]:not([data-slot="radio"]):not([data-slot="checkbox"]) > .label {
@apply after:ml-0.5 after:text-danger after:content-['*'];
}
.label--disabled,
[data-disabled="true"] .label {
@apply status-disabled;
}
.label--invalid,
[data-invalid="true"] .label,
[aria-invalid="true"] .label {
@apply text-danger;
}