-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(b-form-rating): new
b-form-rating
custom component (#5132)
Co-authored-by: Jacob Müller
- Loading branch information
1 parent
a2e465b
commit 30ad7fe
Showing
14 changed files
with
1,680 additions
and
73 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
.b-rating { | ||
text-align: center; | ||
|
||
&.d-inline-flex { | ||
width: auto; | ||
} | ||
|
||
.b-rating-star, | ||
.b-rating-value { | ||
padding: 0 0.25em; | ||
} | ||
|
||
.b-rating-value { | ||
// Keep the stars from moving when value changes (usually) | ||
min-width: 2.5em; | ||
} | ||
|
||
.b-rating-star { | ||
display: inline-flex; | ||
justify-content: center; | ||
|
||
.b-rating-icon { | ||
display: inline-flex; | ||
transition: all 0.15s ease-in-out; | ||
} | ||
} | ||
|
||
&.disabled, | ||
&:disabled { | ||
background-color: $input-disabled-bg; | ||
color: $text-muted; | ||
} | ||
|
||
&:not(.disabled):not(.readonly) { | ||
.b-rating-star { | ||
cursor: pointer; | ||
} | ||
|
||
// Zoom focused or hovered icons | ||
&:focus:not(:hover) .b-rating-star.focused, | ||
.b-rating-star:hover { | ||
.b-rating-icon { | ||
transform: scale(1.5); | ||
} | ||
} | ||
} | ||
|
||
// Flip the half icon if RTL mode | ||
// We transform the outer star wrapper so that we do not | ||
// interfere with the hover/focus transform above | ||
&[dir="rtl"] { | ||
.b-rating-star-half { | ||
transform: scale(-1, 1); | ||
} | ||
} | ||
} |
Oops, something went wrong.