-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
371 additions
and
407 deletions.
There are no files selected for viewing
108 changes: 66 additions & 42 deletions
108
frontend/libs/studio-components/src/components/StudioSlider/StudioSlider.module.css
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 |
---|---|---|
@@ -1,66 +1,90 @@ | ||
.sliderContainer { | ||
width: 100%; | ||
display: flex; | ||
gap: 1rem; | ||
position: relative; | ||
--height: 3rem; | ||
--outline: 0.1rem solid var(--primary-color-700); | ||
--outline-offset: 0.2rem; | ||
--background: lightgrey; | ||
--border-radius: 0.2rem; | ||
--thumb-width: calc(100% / 12); | ||
--thumb-background-colour: var(--primary-color-700); | ||
--thumb-box-shadow: -100vw 0 0 100vw var(--thumb-background-colour); | ||
} | ||
|
||
.range { | ||
display: flex; | ||
.disabled { | ||
--thumb-background-colour: var(--fds-semantic-border-neutral-default); | ||
} | ||
|
||
input[type='range'] { | ||
-webkit-appearance: none; | ||
appearance: none; | ||
width: 100%; | ||
flex-direction: column; | ||
align-items: center; | ||
cursor: pointer; | ||
} | ||
|
||
.disabledSliderValue, | ||
.currentSliderValue { | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: flex-end; | ||
font-size: 2rem; | ||
min-width: 3rem; | ||
input[type='range'].disabled { | ||
cursor: not-allowed; | ||
} | ||
|
||
.disabledSliderValue { | ||
color: var(--fds-semantic-text-neutral-subtle); | ||
input[type='range']::-webkit-slider-runnable-track { | ||
height: var(--height); | ||
background: var(--background); | ||
border-radius: var(--border-radius); | ||
overflow: hidden; | ||
outline: var(--outline); | ||
outline-offset: var(--outline-offset); | ||
} | ||
|
||
.currentSliderValue { | ||
color: var(--fds-semantic-text-action-default); | ||
input[type='range']::-moz-range-track { | ||
height: var(--height); | ||
background: var(--background); | ||
border-radius: var(--border-radius); | ||
} | ||
|
||
datalist { | ||
display: flex; | ||
justify-content: space-between; | ||
width: 100%; | ||
margin-top: 0.5rem; | ||
input[type='range']::-webkit-slider-thumb { | ||
-webkit-appearance: none; | ||
appearance: none; | ||
height: var(--height); | ||
width: var(--thumb-width); | ||
box-shadow: var(--thumb-box-shadow); | ||
background-color: var(--thumb-background-colour); | ||
border-radius: var(--border-radius); | ||
} | ||
|
||
datalist option { | ||
min-width: 1rem; | ||
input[type='range']::-moz-range-thumb { | ||
height: var(--height); | ||
width: var(--thumb-width); | ||
box-shadow: var(--thumb-box-shadow); | ||
background-color: var(--thumb-background-colour); | ||
border-radius: var(--border-radius); | ||
} | ||
|
||
datalist { | ||
position: absolute; | ||
top: 0; | ||
display: flex; | ||
justify-content: center; | ||
width: calc(100% + var(--outline-offset)); | ||
justify-content: space-around; | ||
--datalist-height: calc(var(--height) + var(--outline-offset)); | ||
height: var(--datalist-height); | ||
align-items: center; | ||
text-align: center; | ||
color: white; | ||
pointer-events: none; | ||
} | ||
|
||
input[type='range'] { | ||
/* ... */ | ||
/* slider progress trick */ | ||
overflow: hidden; | ||
border-radius: 3rem; | ||
option { | ||
display: flex; | ||
width: 100%; | ||
text-align: center; | ||
justify-content: center; | ||
height: var(--datalist-height); | ||
align-items: center; | ||
border-left: 1px solid white; | ||
} | ||
|
||
input[type='range']::-webkit-slider-runnable-track { | ||
cursor: pointer; | ||
border-radius: 1rem; | ||
border: 0.1rem solid var(--primary-color-700); | ||
background-color: white; | ||
option:first-child { | ||
border-left: 1px solid transparent; | ||
} | ||
|
||
/* Thumb: webkit */ | ||
input[type='range']::-webkit-slider-thumb { | ||
border-radius: 50%; | ||
border: 0.8rem solid; | ||
box-shadow: -25.6rem 0 0 25rem var(--primary-color-700); | ||
.outsideGrid { | ||
color: var(--primary-color-700); | ||
} |
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
Oops, something went wrong.