Skip to main content

Product Rating

Product Rating

The star rating. The stars are decorative and the rating is written out, so a screen reader says "4.5 out of 5" instead of reading five images.

Props

PropTypeDefaultWhat it does
Star sizetext1remAny CSS length. The text beside them keeps its own size, so a bigger star does not drag the sentence with it.
Star colortext#b45309
Show the text beside the starson / offonOff leaves the stars alone — what a product card usually wants. The sentence stays for screen readers and is the only thing that says the number: the stars themselves are hidden from them, because five images read one by one are not a rating.
Ratingtext{this.fecommerce.rating}Comes from the product being shown. Inside a loop it follows each product by itself when the loop’s item is called «this»; with any other name, bind it to that name.
Rating labeltext{this.fecommerce.rating_label}Comes from the product being shown. Inside a loop it follows each product by itself when the loop’s item is called «this»; with any other name, bind it to that name.

Variables of its own

VariableDefaultWhat it controls
--fe-woo-rating-size1remHow big each star is.
--fe-woo-rating-filled#b45309A filled star. Amber on its own account, for the same reason as the sale price.
--fe-woo-rating-empty#d1d5dbThe rest of the five.
--fe-woo-rating-text-colorvar(--fe-woo-muted, #4b5563)The «4.5 out of 5» written beside them.
--fe-woo-rating-text-sizevar(--fe-woo-text-m, 0.88rem)Its size.