+
-
`}
-css={``}
+css={`
+.container {
+ background-color: rgba(0, 0, 0, .1);
+ border-radius: 9999px;
+ display: inline-flex;
+ padding: 4px;
+}
+
+.container__label {
+ border-radius: 9999px;
+ cursor: pointer;
+ padding: 4px 8px;
+}
+
+.container__label--selected {
+ /* For selected radio only */
+ background-color: #357edd;
+ color: #fff;
+}
+
+.container__input {
+ display: none
+}
+`}
>
= () => {
-.p-rating {
+
+
+
+
+
+
+
+`}
+css={`
+.rating {
/* Center the content */
align-items: center;
display: flex;
@@ -33,8 +41,8 @@ html={`
font-size: 32px;
}
-.p-rating .p-rating-star:hover,
-.p-rating .p-rating-star:hover ~ .p-rating-star {
+.rating__star:hover,
+.rating__star:hover ~ .rating__star {
color: transparent;
}
@@ -42,15 +50,15 @@ html={`
Make all previous stars selected when hover on a star
Note that we use \`flex-direction: row-reverse\` on the container
*/
-.p-rating .p-rating-star:hover:before,
-.p-rating .p-rating-star:hover ~ .p-rating-star:before {
+.rating__star:hover:before,
+.rating__star:hover ~ .rating__star:before {
color: #00449e;
content: '\\2605';
left: 0;
position: absolute;
}
-.p-rating-star {
+.rating__star {
/* Reset styles for button */
background-color: transparent;
border: transparent;
@@ -60,17 +68,7 @@ Note that we use \`flex-direction: row-reverse\` on the container
/* Used to position the hover state */
position: relative;
}
-
-
-
-
-
-
-
-
-
`}
-css={``}
>
+.container__input {
+ border-color: transparent;
+ /* Take available width */
+ flex: 1;
+}
`}
-css={``}
>
= () => {
+`}
+css={`
+.container {
/* Content is centered horizontally */
align-items: center;
display: flex;
/* Size */
height: 32px;
-">
-
-
+.container__left {
+ height: 2px;
-
-
+ /* Rounded border */
+ border-radius: 9999px;
-
-
-
+.container__right {
+ /* Take the remaining width */
+ flex: 1;
+ height: 2px;
+
+ /* Colors */
+ background-color: rgba(0, 0, 0, .3);
+}
`}
-css={``}
>