-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcomponent-rating.css
More file actions
64 lines (55 loc) · 1.17 KB
/
component-rating.css
File metadata and controls
64 lines (55 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
.product--no-media .rating-wrapper {
text-align: center;
}
.rating {
display: inline-block;
margin: 0;
}
.product .rating-star {
--letter-spacing: 0.8;
--font-size: 1.7;
}
.card-wrapper .rating-star {
--letter-spacing: 0.7;
--font-size: 1.4;
}
.rating-star {
--color-rating-star: rgb(var(--color-foreground));
--percent: calc(
(
var(--rating) / var(--rating-max) + var(--rating-decimal) * var(--font-size) /
(var(--rating-max) * (var(--letter-spacing) + var(--font-size)))
) * 100%
);
letter-spacing: calc(var(--letter-spacing) * 1rem);
font-size: calc(var(--font-size) * 1rem);
line-height: 1;
display: inline-block;
font-family: Times;
margin: 0;
}
.rating-star::before {
content: '★★★★★';
background: linear-gradient(
90deg,
var(--color-rating-star) var(--percent),
rgba(var(--color-foreground), 0.15) var(--percent)
);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.rating-text {
display: none;
}
.rating-count {
display: inline-block;
margin: 0;
}
@media (forced-colors: active) {
.rating {
display: none;
}
.rating-text {
display: block;
}
}