-
Notifications
You must be signed in to change notification settings - Fork 344
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a vertical temperature slider example (pull #1864)
Replacement for temperature slider that was part of previous thermostat example. * Simplifies the example by including only one slider on the page * Uses aria-valuetext for unit of measure * Uses SVG graphics elements * Increased size of clickable area on rail to change value with pointing device * Improves high contrast support * Implements latest APG coding practices, including conversion to event.key and pointer events Co-authored-by: Matt King <a11yThinker@gmail.com>
- Loading branch information
Showing
9 changed files
with
1,171 additions
and
7 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
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,107 @@ | ||
/* CSS Document */ | ||
|
||
.slider-valuetext h3 { | ||
color: black; | ||
font-weight: bold; | ||
font-size: 150%; | ||
} | ||
|
||
.slider-temperature .label, | ||
.slider-seek .label { | ||
font-weight: bold; | ||
font-size: 125%; | ||
} | ||
|
||
.slider-temperature svg, | ||
.slider-seek svg { | ||
forced-color-adjust: auto; | ||
} | ||
|
||
.slider-temperature text, | ||
.slider-seek text { | ||
font-weight: bold; | ||
fill: currentColor; | ||
font-family: sans-serif; | ||
} | ||
|
||
.slider-temperature { | ||
width: 12em; | ||
} | ||
|
||
.slider-temperature, | ||
.slider-seek { | ||
margin-top: 1em; | ||
padding: 6px; | ||
color: black; | ||
} | ||
|
||
.slider-temperature .value, | ||
.slider-slider .value { | ||
position: relative; | ||
top: 20px; | ||
height: 1.5em; | ||
font-size: 80%; | ||
} | ||
|
||
.slider-temperature .temp-value, | ||
.slider-seek .temp-value { | ||
padding-left: 24px; | ||
font-size: 200%; | ||
} | ||
|
||
.slider-temperature .rail, | ||
.slider-seek .rail { | ||
stroke: currentColor; | ||
stroke-width: 2px; | ||
fill: currentColor; | ||
fill-opacity: 25%; | ||
} | ||
|
||
.slider-temperature .thumb, | ||
.slider-seek .thumb { | ||
stroke-width: 0; | ||
fill: currentColor; | ||
} | ||
|
||
.slider-temperature .focus-ring, | ||
.slider-seek .focus-ring { | ||
stroke: currentColor; | ||
stroke-opacity: 0; | ||
fill-opacity: 0; | ||
stroke-width: 3px; | ||
display: none; | ||
} | ||
|
||
.slider-temperature .slider-group { | ||
touch-action: pan-x; | ||
} | ||
|
||
.slider-seek .slider-group { | ||
touch-action: pan-y; | ||
} | ||
|
||
.slider-seek .slider-group .value { | ||
display: none; | ||
} | ||
|
||
/* Focus and hover styling */ | ||
|
||
.slider-seek.focus [role="slider"], | ||
.slider-temperature.focus [role="slider"] { | ||
color: #005a9c; | ||
} | ||
|
||
.slider-temperature [role="slider"]:focus, | ||
.slider-seek [role="slider"]:focus { | ||
outline: none; | ||
} | ||
|
||
.slider-temperature [role="slider"]:focus .focus-ring, | ||
.slider-seek [role="slider"]:focus .focus-ring { | ||
display: block; | ||
stroke-opacity: 1; | ||
} | ||
|
||
.slider-seek [role="slider"]:focus .value { | ||
display: block; | ||
} |
Oops, something went wrong.