Improve design for checkboxes, switches and radios

This commit is contained in:
Massedil
2025-12-03 18:59:51 +01:00
parent 3ea44b73a6
commit ec565e2b67
3 changed files with 27 additions and 17 deletions

View File

@@ -246,18 +246,17 @@ body {
} }
/* Radio */ /* Radio */
.radio { .o-radio__input:checked {
@apply mr-2; /* override a CSS prop (background-image url on `[type="radio"]:checked`) set by default by tailwind
that alter the oruga o-radio design */
background-image:none;
} }
.form-radio { /* Checkbox */
@apply bg-none text-primary border-primary accent-primary; .o-checkbox__input:checked {
} /* We want the current color for the checked mark
.radio-label { instead of oruga default white */
@apply pl-2; border-color: transparent;
} background-color: currentColor;
.o-field--addons .o-radio:not(:only-child) input {
@apply rounded-full;
} }
/* Editor */ /* Editor */

View File

@@ -28,6 +28,23 @@
} }
} }
:root {
/* TODO Try to change the primary color but without success */
--oruga-primary: #1e7d97;
--oruga-variant-primary: #1e7d97;
/* So force change the primary color for each component */
--oruga-radio-active-background-color: #1e7d97;
--oruga-switch-checked-background: #1e7d97;
/* We want transparent background for buttons
instead of oruga default primay color */
--oruga-checkbox-background-color: white;
--oruga-checkbox-active-background-color: white;
}
@media (prefers-color-scheme: dark) { @media (prefers-color-scheme: dark) {
:root { :root {
--oruga-variant-primary: #1e7d97; --oruga-variant-primary: #1e7d97;

View File

@@ -95,12 +95,6 @@ export const orugaConfig = {
select: { select: {
selectClass: "select", selectClass: "select",
}, },
radio: {
rootClass: "radio",
inputCheckedClass: "radio-checked",
inputClass: "form-radio",
labelClass: "radio-label",
},
notification: { notification: {
rootClass: "notification", rootClass: "notification",
variantClass: (variant: string) => { variantClass: (variant: string) => {