The Incredible Overcomplexity of the Shadcn Radio Button
Donc on PEUT styler les boutons radio sans casser l'accessibilité ni recourir à des libs ou frameworks hippopotamesques.
Hop, dans mon snippetvamp.
La lecture de l'article est intéressante.
input[type="radio"] {
/* Disable the browser's default radio button styles */
appearance: none;
margin: 0;
/ Recreate the circle container /
border: 1px solid black;
background: white;
border-radius: 50%;
/ Center our dot in the container /
display: inline-grid;
place-content: center;
/ Use a pseudo-element to display our "dot" /
&::before {
content: "";
width: 0.75rem;
height: 0.75rem;
border-radius: 50%;
}
/ And display it when the radio button is checked /
&:checked::before {
background: black;
}
}

✍ Écrire un commentaire
les commentaires relevant du SPAM seront filtrés et dégagés direct...