Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slider: Rating Slider Example #1867

Merged
merged 26 commits into from
May 18, 2021
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
d6ed9a9
initial slider ranking code
jongund Apr 20, 2021
9912f80
update the rating example
jongund Apr 21, 2021
7e647fa
updated draft of rating slider
jongund Apr 22, 2021
e279db7
updated positioning of stars
jongund Apr 22, 2021
6fed8d1
updated documentation
jongund Apr 22, 2021
ed65732
updated constant
jongund Apr 22, 2021
02c9421
fixed linting error
jongund Apr 22, 2021
1f89779
Update slider-rating.css
jongund Apr 25, 2021
b0fca8f
added onfocus information about 5 stars
jongund Apr 27, 2021
814c74b
updated accessibility documentation to fix spelling bug
jongund Apr 28, 2021
fedb18c
updated the appending of total stars to aria-valuetext on initializat…
jongund May 4, 2021
d140252
Merge branch 'main' into slider-rating
mcking65 May 12, 2021
3be1a21
updated guidance for using fill-opacity
jongund May 12, 2021
6b0abed
Update slider-rating.js
jongund May 12, 2021
82cf03c
Update slider_slider-rating.js
jongund May 12, 2021
961616f
Update slider-rating.html
jongund May 12, 2021
b7f0cd0
In warning, change increment/decrement to increase/decrease
mcking65 May 18, 2021
4129c8f
Add rationale for use of slider pattern to intro
mcking65 May 18, 2021
571faf1
Add link to color viewer; remove link to thermostat slider
mcking65 May 18, 2021
1713308
white space
mcking65 May 18, 2021
a481220
Editorial revision to accessibility features
mcking65 May 18, 2021
0ff8fd1
Minor corrections to kb documentation
mcking65 May 18, 2021
b90331f
Replace q tags inside code tags with quote characters
mcking65 May 18, 2021
7127474
Minor editorial revisions to state and property documentation
mcking65 May 18, 2021
9f9743a
white space
mcking65 May 18, 2021
1266768
white space
mcking65 May 18, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,8 @@ <h2 id="examples_by_role_label">Examples by Role</h2>
<td>
<ul>
<li><a href="slider/multithumb-slider.html">Horizontal Multi-Thumb Slider</a></li>
<li><a href="slider/slider-2.html">Slider with aria-orientation and aria-valuetext</a></li>
<li><a href="slider/slider-color-viewer.html">Color Viewer Slider</a></li>
<li><a href="slider/slider-rating.html">Rating Slider</a></li>
</ul>
</td>
</tr>
Expand Down Expand Up @@ -588,6 +588,7 @@ <h2 id="examples_by_props_label">Examples By Properties and States</h2>
<li><a href="radio/radio-activedescendant.html">Radio Group Using aria-activedescendant</a></li>
<li><a href="radio/radio.html">Radio Group Using Roving tabindex</a></li>
<li><a href="slider/slider-color-viewer.html">Color Viewer Slider</a></li>
<li><a href="slider/slider-rating.html">Rating Slider</a></li>
<li><a href="spinbutton/datepicker-spinbuttons.html">Date Picker Spin Button</a></li>
<li><a href="table/table.html">Table</a></li>
<li><a href="tabs/tabs-1/tabs.html">Tabs with Automatic Activation</a></li>
Expand Down Expand Up @@ -625,6 +626,7 @@ <h2 id="examples_by_props_label">Examples By Properties and States</h2>
<li><a href="radio/radio-activedescendant.html">Radio Group Using aria-activedescendant</a></li>
<li><a href="radio/radio.html">Radio Group Using Roving tabindex</a></li>
<li><a href="slider/slider-color-viewer.html">Color Viewer Slider</a></li>
<li><a href="slider/slider-rating.html">Rating Slider</a></li>
<li><a href="spinbutton/datepicker-spinbuttons.html">Date Picker Spin Button</a></li>
<li><a href="tabs/tabs-1/tabs.html">Tabs with Automatic Activation</a></li>
<li><a href="tabs/tabs-2/tabs.html">Tabs with Manual Activation</a></li>
Expand Down Expand Up @@ -676,10 +678,6 @@ <h2 id="examples_by_props_label">Examples By Properties and States</h2>
<td><code>aria-multiselectable</code></td>
<td><a href="listbox/listbox-rearrangeable.html">Listboxes with Rearrangeable Options</a></td>
</tr>
<tr>
<td><code>aria-orientation</code></td>
<td><a href="slider/slider-2.html">Slider with aria-orientation and aria-valuetext</a></td>
</tr>
<tr>
<td><code>aria-owns</code></td>
<td><a href="treeview/treeview-navigation.html">Navigation Treeview</a></td>
Expand Down Expand Up @@ -767,8 +765,8 @@ <h2 id="examples_by_props_label">Examples By Properties and States</h2>
<ul>
<li><a href="meter/meter.html">Meter</a></li>
<li><a href="slider/multithumb-slider.html">Horizontal Multi-Thumb Slider</a></li>
<li><a href="slider/slider-2.html">Slider with aria-orientation and aria-valuetext</a></li>
<li><a href="slider/slider-color-viewer.html">Color Viewer Slider</a></li>
<li><a href="slider/slider-rating.html">Rating Slider</a></li>
<li><a href="spinbutton/datepicker-spinbuttons.html">Date Picker Spin Button</a></li>
</ul>
</td>
Expand All @@ -779,8 +777,8 @@ <h2 id="examples_by_props_label">Examples By Properties and States</h2>
<ul>
<li><a href="meter/meter.html">Meter</a></li>
<li><a href="slider/multithumb-slider.html">Horizontal Multi-Thumb Slider</a></li>
<li><a href="slider/slider-2.html">Slider with aria-orientation and aria-valuetext</a></li>
<li><a href="slider/slider-color-viewer.html">Color Viewer Slider</a></li>
<li><a href="slider/slider-rating.html">Rating Slider</a></li>
<li><a href="spinbutton/datepicker-spinbuttons.html">Date Picker Spin Button</a></li>
<li><a href="toolbar/toolbar.html">Toolbar</a></li>
</ul>
Expand All @@ -792,8 +790,8 @@ <h2 id="examples_by_props_label">Examples By Properties and States</h2>
<ul>
<li><a href="meter/meter.html">Meter</a></li>
<li><a href="slider/multithumb-slider.html">Horizontal Multi-Thumb Slider</a></li>
<li><a href="slider/slider-2.html">Slider with aria-orientation and aria-valuetext</a></li>
<li><a href="slider/slider-color-viewer.html">Color Viewer Slider</a></li>
<li><a href="slider/slider-rating.html">Rating Slider</a></li>
<li><a href="spinbutton/datepicker-spinbuttons.html">Date Picker Spin Button</a></li>
<li><a href="toolbar/toolbar.html">Toolbar</a></li>
</ul>
Expand All @@ -804,7 +802,7 @@ <h2 id="examples_by_props_label">Examples By Properties and States</h2>
<td>
<ul>
<li><a href="slider/multithumb-slider.html">Horizontal Multi-Thumb Slider</a></li>
<li><a href="slider/slider-2.html">Slider with aria-orientation and aria-valuetext</a></li>
<li><a href="slider/slider-rating.html">Rating Slider</a></li>
<li><a href="spinbutton/datepicker-spinbuttons.html">Date Picker Spin Button</a></li>
<li><a href="toolbar/toolbar.html">Toolbar</a></li>
</ul>
Expand Down
97 changes: 97 additions & 0 deletions examples/slider/css/slider-rating.css
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;
}
48 changes: 0 additions & 48 deletions examples/slider/css/text-slider.css

This file was deleted.

51 changes: 0 additions & 51 deletions examples/slider/css/vertical-slider.css

This file was deleted.

Loading