Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
::root{
counter-reset: selectedRadioCount, unSelectedRadioCount;
}
label+input[type='radio']{
counter-increment: unSelectedRadioCount;
}
label+input[type='radio']:checked{
counter-increment: selectedRadioCount;
}
input[type="radio"]:not(label+input[type='radio']):checked{
counter-increment: unSelectedRadioCount -1 selectedRadioCount;
}
#unSelectedRadioCount::after{
content: counter(unSelectedRadioCount)
}
#selectedRadioCount::after{
content: counter(selectedRadioCount)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment