diff --git a/site/src/pages/components/enhanced-range-input.explainer.mdx b/site/src/pages/components/enhanced-range-input.explainer.mdx
index 8405a3a1c..b793455e5 100644
--- a/site/src/pages/components/enhanced-range-input.explainer.mdx
+++ b/site/src/pages/components/enhanced-range-input.explainer.mdx
@@ -114,10 +114,12 @@ This approach offers several advantages:
```html
Temperature Range
- Minimum Temperature
-
- Maximum Temperature
-
+ Minimum Temperature
+
+
+ Maximum Temperature
+
+
```
@@ -136,12 +138,7 @@ A robust labeling strategy is crucial for users of assistive technologies. We pr
**Group Label:** The `` element should be labeled by including a `` element as a direct child. This provides the accessible name for the entire group of sliders.
-**Individual Handle Labels:** Each ` ` within the group should have its own accessible name. This can be provided using standard methods, in the following order of preference:
-
-1. A `` element associated with the input's `id`.
-2. An `aria-label` or `aria-labelledby` attribute on the ` `.
-
-If an explicit name is not provided, browsers could offer a localized default for common two-handle scenarios (e.g., "minimum" and "maximum"). However, authors should always provide explicit, descriptive labels for clarity, especially when more than two handles are present.
+**Individual Handle Labels:** Each ` ` within the group should have its own accessible name. This can be provided by wrapping the ` ` within a `` element (implicit labeling), which is the recommended approach. Alternatively, standard methods like an `aria-label` or `aria-labelledby` attribute on the ` ` can be used.
#### Example Implementation
@@ -149,11 +146,13 @@ If an explicit name is not provided, browsers could offer a localized default fo
Price Range
- Minimum Price
-
+ Minimum Price
+
+
- Maximum Price
-
+ Maximum Price
+
+
```
@@ -172,11 +171,13 @@ For example, consider a price range selector:
Price Range
- Minimum Price
-
+ Minimum Price
+
+
- Maximum Price
-
+ Maximum Price
+
+
```
@@ -196,10 +197,12 @@ For `` elements, the `` can be associated with the group a
```html
Price Range
- Minimum Price
-
- Maximum Price
-
+ Minimum Price
+
+
+ Maximum Price
+
+
$0
@@ -215,20 +218,22 @@ Alternatively, datalist could be provided on each input as well. While these won
## Multi-Color Range Segments
-To support different colors between handles in a ``, we introduce the `::slider-segment` pseudo-element. This allows for granular control over the appearance of each segment in the range, enabling rich user interfaces such as budget allocators where each segment can represent a different category. Example usage:
+To support different colors between handles in a ``, we introduce the `::slider-segment` pseudo-element. This allows for granular control over the appearance of each segment in the range, enabling rich user interfaces such as budget allocators where each segment can represent a different category.
+Segments get numbered based on their start and end positions with 1 being at the start (based on writing mode).
+Example usage:
```css
-rangegroup::slider-segment:nth-child(1) {
+rangegroup::slider-segment(1) {
background-color: #FF5733;
}
/* Style the second segment (between the first and second handles) */
-rangegroup::slider-segment:nth-child(2) {
+rangegroup::slider-segment(2) {
background-color: #33FF57;
}
/* Style the third segment (between the second handle and the end) */
-rangegroup::slider-segment:nth-child(3) {
+rangegroup::slider-segment(3) {
background-color: #3357FF;
}
```
@@ -294,7 +299,7 @@ To address the current fragmentation and provide a unified styling API, we propo
- `::slider-tick`: Represents individual tick marks on the range group with attached datalist.
- `::slider-tick-label`: Represents the label associated with each tick mark of a datalist option.
-These pseudo-elements can be used in combination with other CSS selectors, such as `:nth-child()`, to provide granular control over individual elements.
+
Example usage:
@@ -329,11 +334,11 @@ rangegroup::slider-track {
background-color: #f0f0f0;
}
-rangegroup::slider-segment:nth-child(1) {
+rangegroup::slider-segment(1) {
background-color: #FF5733;
}
-rangegroup::slider-segment:nth-child(2) {
+rangegroup::slider-segment(2) {
background-color: #33FF57;
}
@@ -384,10 +389,12 @@ console.log(rangeGroup.values); // [150, 750]
```html
Price Range
- Minimum Price
-
- Maximum Price
-
+ Minimum Price
+
+
+ Maximum Price
+
+
```
@@ -402,15 +409,15 @@ rangegroup::slider-track {
background-color: #f0f0f0;
}
-rangegroup::slider-segment:nth-child(1) {
+rangegroup::slider-segment(1) {
background-color: #ddd;
}
-rangegroup::slider-segment:nth-child(2) {
+rangegroup::slider-segment(2) {
background-color: #4CAF50;
}
-rangegroup::slider-segment:nth-child(3) {
+rangegroup::slider-segment(3) {
background-color: #ddd;
}
rangegroup input[type="range"]::slider-thumb {
@@ -426,12 +433,15 @@ rangegroup::slider-segment:nth-child(3) {
```html
Temperature Range
- Low
-
- Medium
-
- High
-
+ Low
+
+
+ Medium
+
+
+ High
+
+
```
```css
@@ -453,19 +463,19 @@ rangegroup input[type="range"]::slider-thumb {
border-radius: 50%;
}
-rangegroup::slider-segment:nth-child(1) {
+rangegroup::slider-segment(1) {
background-color: #FF5733;
}
-rangegroup::slider-segment:nth-child(2) {
+rangegroup::slider-segment(2) {
background-color: #33FF57;
}
-rangegroup::slider-segment:nth-child(3) {
+rangegroup::slider-segment(3) {
background-color: #3357FF;
}
-rangegroup::slider-segment:nth-child(4) {
+rangegroup::slider-segment(4) {
background-color: #FF33A8;
}
```
@@ -475,12 +485,10 @@ rangegroup::slider-segment:nth-child(4) {
- Should there be a limit on the number of range inputs that can be included in a ``? Based on discussions, we've decided not to impose a limit, leaving it to authors to determine the appropriate number for their use case. A separate issue will be created to address potential accessibility concerns with a large number of handles.
- How should we handle thumb collision in multi-handle ranges?
- What is the best way to handle keyboard navigation for multi-handle ranges? While tabbing between inputs is natural, should there be additional keyboard shortcuts for more efficient navigation?
-- Should we provide built-in support for non-linear scales (e.g., logarithmic)?
- Should we consider additional pseudo-elements for more granular styling control?
- How should we handle vertical orientation for range inputs? The CSS Forms specification introduces a slider-orientation property that could be adopted for this purpose.
-- How should we handle the positioning and spacing of tick marks when using `` with `` elements?
- Should we provide options for automatic tick mark generation (e.g., evenly spaced) without requiring a ``? These could be auto-generated based on a step attribute of a rangegroup
- How can we ensure that tick marks and labels remain legible and usable on small-screen devices or with a large number of ticks? Is this author responsibility?
- Should we provide a way to programmatically set segment colors with a JavaScript API?
- What should the behavior be when a handle's value is updated programmatically to a value that would violate the constraints imposed by `stepbetween` or other range limits?
-- How should form submission work for `` elements? Should they submit as a single value (comma-separated) or as multiple values with the same name?
+- How should form submission work for `` elements? Should they submit as a single value (comma-separated) or as multiple values with the same name?
\ No newline at end of file