A unique code pen project showcasing a pure css star rating interface can be found at: https://codepen.io/yaworek/pen/JJpEaZ
Below is the custom css part:
/***
* Custom Pure CSS Star Rating Widget for Bootstrap 4
*
* www.TheMastercut.co
*
***/
@import url(//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css);
/* Styling headings and links */
h1[alt="Unique"] {color: white;}
a[href], a[href]:hover {color: grey; font-size: 0.5em; text-decoration: none}
.starrating > input {display: none;} /* Hide radio buttons */
.starrating > label:before {
content: "\f005"; /* Star icon */
margin: 2px;
font-size: 2em;
font-family: FontAwesome;
display: inline-block;
text-shadow: 0px 0px 3px #000;
}
.starrating > label
{
color: #FFFFFF; /* Default color when not selected */
}
.starrating > input:checked ~ label
{ color: #ffca08 ; } /* Yellow color when star is checked */
.starrating > input:hover ~ label
{ color: #ffca08 ; } /* Yellow color on hover */
This design utilizes both radio buttons and css to showcase the ratings. The goal is to include additional rating sets, such as 5 sets for 5 books. However, the current css setup resets the chosen ratings for one set when selecting ratings for another set.
If interested in exploring an added rating set with this issue, check out the following code pen link: https://codepen.io/brainyprb/pen/BvoqLE
The question arises - Is it possible to resolve this challenge using only css? Or would implementing javascript/jquery be necessary?