-
Notifications
You must be signed in to change notification settings - Fork 355
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new example of rating slider (pull #1867)
Adds rating slider example that: * Uses SVG graphics elements * Has high contrast support * Implements current APG coding practices, including transition to pointer events. Co-authored-by: Matt King <[email protected]>
- Loading branch information
Showing
11 changed files
with
1,171 additions
and
1,621 deletions.
There are no files selected for viewing
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
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,97 @@ | ||
/* CSS Document */ | ||
|
||
.rating-slider label { | ||
display: block; | ||
} | ||
|
||
.rating-slider { | ||
color: #005a9c; | ||
} | ||
|
||
.rating-slider svg { | ||
forced-color-adjust: auto; | ||
touch-action: pan-y; | ||
} | ||
|
||
.rating-slider svg .focus-ring { | ||
fill: #eee; | ||
stroke-width: 0; | ||
fill-opacity: 0; | ||
} | ||
|
||
.rating-slider svg .star { | ||
stroke-width: 2px; | ||
stroke: currentColor; | ||
fill-opacity: 0; | ||
} | ||
|
||
.rating-slider svg .fill-left, | ||
.rating-slider svg .fill-right { | ||
stroke-width: 0; | ||
fill-opacity: 0; | ||
} | ||
|
||
.rating-slider[aria-valuenow="5"] svg .star { | ||
fill: currentColor; | ||
fill-opacity: 1; | ||
} | ||
|
||
.rating-slider[aria-valuenow="0.5"] svg .star-1 .fill-left { | ||
fill: currentColor; | ||
fill-opacity: 1; | ||
} | ||
|
||
.rating-slider[aria-valuenow="1"] svg .star-1 .star { | ||
fill: currentColor; | ||
fill-opacity: 1; | ||
} | ||
|
||
.rating-slider[aria-valuenow="1.5"] svg .star-1 .star, | ||
.rating-slider[aria-valuenow="1.5"] svg .star-2 .fill-left { | ||
fill: currentColor; | ||
fill-opacity: 1; | ||
} | ||
|
||
.rating-slider[aria-valuenow="2"] svg .star-2 .star { | ||
fill: currentColor; | ||
fill-opacity: 1; | ||
} | ||
|
||
.rating-slider[aria-valuenow="2.5"] svg .star-2 .star, | ||
.rating-slider[aria-valuenow="2.5"] svg .star-3 .fill-left { | ||
fill: currentColor; | ||
fill-opacity: 1; | ||
} | ||
|
||
.rating-slider[aria-valuenow="3"] svg .star-3 .star { | ||
fill: currentColor; | ||
fill-opacity: 1; | ||
} | ||
|
||
.rating-slider[aria-valuenow="3.5"] svg .star-3 .star, | ||
.rating-slider[aria-valuenow="3.5"] svg .star-4 .fill-left { | ||
fill: currentColor; | ||
fill-opacity: 1; | ||
} | ||
|
||
.rating-slider[aria-valuenow="4"] svg .star-4 .star { | ||
fill: currentColor; | ||
fill-opacity: 1; | ||
} | ||
|
||
.rating-slider[aria-valuenow="4.5"] svg .star-4 .star, | ||
.rating-slider[aria-valuenow="4.5"] svg .star-5 .fill-left { | ||
fill: currentColor; | ||
fill-opacity: 1; | ||
} | ||
|
||
/* focus styling */ | ||
|
||
.rating-slider:focus { | ||
outline: none; | ||
} | ||
|
||
.rating-slider:focus svg .focus-ring { | ||
stroke-width: 2px; | ||
stroke: currentColor; | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.