Skip to content

Commit

Permalink
fix: slider color
Browse files Browse the repository at this point in the history
  • Loading branch information
mayank-96 committed Apr 12, 2022
1 parent 18a994d commit e9ae1f9
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions src/theme/components/slider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,36 @@ export const SliderTrack = {
};

export const SliderThumb = {
baseStyle: () => {
baseStyle: (props: any) => {
let { colorScheme } = props;
return {
borderRadius: 'full',
zIndex: 999,
alignItems: 'center',
justifyContent: 'center',
scaleOnPressed: 1.2,
_light: {
bg: 'primary.600',
bg: `${colorScheme}.600`,
},
_dark: {
bg: 'primary.500',
bg: `${colorScheme}.500`,
},
shadow: 6,
};
},
defaultProps: {
colorScheme: 'primary',
},
};

export const SliderFilledTrack = {
baseStyle: ({ orientation, isReversed, sliderTrackPosition, size }: any) => {
baseStyle: ({
orientation,
isReversed,
sliderTrackPosition,
size,
colorScheme,
}: any) => {
return {
left: orientation !== 'vertical' && !isReversed ? 0 : undefined,
bottom: orientation === 'vertical' && !isReversed ? 0 : undefined,
Expand All @@ -56,13 +66,16 @@ export const SliderFilledTrack = {
? { height: sliderTrackPosition, width: size }
: { width: sliderTrackPosition, height: size },
_light: {
bg: 'primary.600',
bg: `${colorScheme}.600`,
},
_dark: {
bg: 'primary.500',
bg: `${colorScheme}.500`,
},
};
},
defaultProps: {
colorScheme: 'primary',
},
};

const sizes = {
Expand Down

0 comments on commit e9ae1f9

Please sign in to comment.