Skip to content

Instantly share code, notes, and snippets.

@rpsthecoder
Created July 17, 2018 11:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rpsthecoder/e045c240bf2378e3267dc86dff4c9237 to your computer and use it in GitHub Desktop.
Save rpsthecoder/e045c240bf2378e3267dc86dff4c9237 to your computer and use it in GitHub Desktop.
::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