-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(react-slider): Export internal CSS vars (#33682)
- Loading branch information
1 parent
1dfc830
commit ace3f40
Showing
5 changed files
with
110 additions
and
51 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
33 changes: 33 additions & 0 deletions
33
apps/vr-tests-react-components/src/stories/Slider/utils.tsx
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,33 @@ | ||
import * as React from 'react'; | ||
import { Slider, sliderCSSVars } from '@fluentui/react-slider'; | ||
import { makeStyles } from '@griffel/react'; | ||
const { sliderProgressColorVar, sliderRailColorVar, sliderThumbColorVar, sliderThumbSizeVar } = sliderCSSVars; | ||
|
||
const useStyles = makeStyles({ | ||
enabled: { | ||
[sliderProgressColorVar]: '#ff0764', | ||
[sliderRailColorVar]: '##242424', | ||
[sliderThumbColorVar]: '#ff0764', | ||
':hover': { | ||
[sliderThumbColorVar]: '#d60d58', | ||
[sliderProgressColorVar]: '#d60d58', | ||
':active': { | ||
[sliderThumbColorVar]: '#b91150', | ||
[sliderProgressColorVar]: '#b91150', | ||
}, | ||
}, | ||
}, | ||
thumb: { | ||
[sliderThumbSizeVar]: '16px', | ||
boxShadow: `0 0 0 calc(var(${sliderThumbSizeVar}) * .2) transparent inset`, | ||
'::before': { | ||
content: 'unset', | ||
}, | ||
}, | ||
}); | ||
|
||
export const SampleCustomizedSlider = () => { | ||
const styles = useStyles(); | ||
|
||
return <Slider className={styles.enabled} thumb={{ className: styles.thumb }} defaultValue={20} size="small" />; | ||
}; |
7 changes: 7 additions & 0 deletions
7
change/@fluentui-react-slider-fd76d130-d916-4372-8ebb-4570aa203878.json
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,7 @@ | ||
{ | ||
"type": "patch", | ||
"comment": "fix: exported internal CSS variables", | ||
"packageName": "@fluentui/react-slider", | ||
"email": "[email protected]", | ||
"dependentChangeType": "patch" | ||
} |
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