Skip to content

Commit 30ad7fe

Browse files
authored
feat(b-form-rating): new b-form-rating custom component (#5132)
Co-authored-by: Jacob Müller
1 parent a2e465b commit 30ad7fe

File tree

14 files changed

+1680
-73
lines changed

14 files changed

+1680
-73
lines changed

src/components/form-rating/README.md

Lines changed: 493 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
.b-rating {
2+
text-align: center;
3+
4+
&.d-inline-flex {
5+
width: auto;
6+
}
7+
8+
.b-rating-star,
9+
.b-rating-value {
10+
padding: 0 0.25em;
11+
}
12+
13+
.b-rating-value {
14+
// Keep the stars from moving when value changes (usually)
15+
min-width: 2.5em;
16+
}
17+
18+
.b-rating-star {
19+
display: inline-flex;
20+
justify-content: center;
21+
22+
.b-rating-icon {
23+
display: inline-flex;
24+
transition: all 0.15s ease-in-out;
25+
}
26+
}
27+
28+
&.disabled,
29+
&:disabled {
30+
background-color: $input-disabled-bg;
31+
color: $text-muted;
32+
}
33+
34+
&:not(.disabled):not(.readonly) {
35+
.b-rating-star {
36+
cursor: pointer;
37+
}
38+
39+
// Zoom focused or hovered icons
40+
&:focus:not(:hover) .b-rating-star.focused,
41+
.b-rating-star:hover {
42+
.b-rating-icon {
43+
transform: scale(1.5);
44+
}
45+
}
46+
}
47+
48+
// Flip the half icon if RTL mode
49+
// We transform the outer star wrapper so that we do not
50+
// interfere with the hover/focus transform above
51+
&[dir="rtl"] {
52+
.b-rating-star-half {
53+
transform: scale(-1, 1);
54+
}
55+
}
56+
}

0 commit comments

Comments
 (0)