Skip to content

Commit a80c6d4

Browse files
committed
Add range form component
1 parent 95651d5 commit a80c6d4

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

scss/_components.form.scss

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ $form-control-padding-lg: $spacing-squish-md !default;
1414
$form-control-placeholder-color: $grey-mute !default;
1515
$form-control-disabled-color: $grey-mute !default;
1616
$form-control-disabled-bg: $grey-shade !default;
17+
$form-range-color: $color-primary !default;
18+
$form-range-bg: $grey-thin !default;
1719
$form-checkbox-size: 16px !default;
1820
$form-radio-size: 16px !default;
1921
$form-field-margin-bottom: $spacing-stack-md !default;
@@ -312,6 +314,38 @@ $icon-check: "data:image/svg+xml,%3csvg viewBox='0 0
312314
}
313315
}
314316

317+
// Range
318+
.form-range {
319+
display: block;
320+
margin: 0;
321+
min-width: 0;
322+
width: 100%;
323+
height: 4px;
324+
margin-top: 8px;
325+
margin-bottom: 8px;
326+
cursor: pointer;
327+
border-radius: 9999px;
328+
color: $grey-dark;
329+
background-color: $form-range-bg;
330+
-webkit-appearance: none;
331+
appearance: none;
332+
333+
&:focus {
334+
outline: none;
335+
color: $form-range-color;
336+
}
337+
338+
&::-webkit-slider-thumb {
339+
width: 16px;
340+
height: 16px;
341+
border: 0;
342+
border-radius: 9999px;
343+
background-color: currentColor;
344+
-webkit-appearance: none;
345+
appearance: none;
346+
}
347+
}
348+
315349
// Field
316350
.form-field {
317351
text-align: left;

0 commit comments

Comments
 (0)