@chayns-components/core
Version:
A set of beautiful React components for developing your own applications with chayns.
90 lines (85 loc) • 2.22 kB
JavaScript
import styled, { css } from 'styled-components';
export const StyledScrollView = styled.div`
${_ref => {
let {
$maxHeight
} = _ref;
return $maxHeight && css`
max-height: ${typeof $maxHeight === 'number' ? `${$maxHeight}px` : $maxHeight};
`;
}}
${_ref2 => {
let {
$height
} = _ref2;
return $height && css`
height: ${typeof $height === 'number' ? `${$height}px` : $height};
`;
}}
${_ref3 => {
let {
$maxWidth
} = _ref3;
return $maxWidth && css`
max-width: ${typeof $maxWidth === 'number' ? `${$maxWidth}px` : $maxWidth};
`;
}}
${_ref4 => {
let {
$width
} = _ref4;
return $width && css`
width: ${typeof $width === 'number' ? `${$width}px` : $width};
`;
}}
${_ref5 => {
let {
$overflowX
} = _ref5;
return css`
overflow-x: ${$overflowX};
`;
}}
${_ref6 => {
let {
$overflowY
} = _ref6;
return css`
overflow-y: ${$overflowY};
`;
}}
// Styles for custom scrollbar
${_ref7 => {
let {
$browser,
theme
} = _ref7;
return $browser === 'firefox' ? css`
scrollbar-color: rgba(${theme['text-rgb']}, 0.15) transparent;
scrollbar-width: thin;
` : css`
&::-webkit-scrollbar {
width: 10px;
height: 10px;
}
&::-webkit-scrollbar-track {
background-color: transparent;
}
&::-webkit-scrollbar-button {
background-color: transparent;
height: 5px;
width: 5px;
}
&::-webkit-scrollbar-thumb {
background-color: rgba(${theme['text-rgb']}, 0.15);
border-radius: 20px;
background-clip: padding-box;
border: solid 3px transparent;
}
&::-webkit-scrollbar-corner {
background-color: transparent;
}
`;
}}
`;
//# sourceMappingURL=ScrollView.styles.js.map