Skip to content

Commit

Permalink
fix: responsive css grid
Browse files Browse the repository at this point in the history
  • Loading branch information
atanasster committed Sep 20, 2020
1 parent b1e2e84 commit c973790
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 5 deletions.
9 changes: 8 additions & 1 deletion ui/design-tokens/src/Colors/ColorBlock1/ColorBlock1.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@ export const ColorBlock1: FC<ColoBlock1Props> = ({ name, color, sx }) => {
const colorValue = typeof color === 'string' ? color : color.value;
const { hex, rgba } = colorToStr(colorValue);
return (
<Box sx={{ display: 'flex', flexDirection: 'row', width: '220px' }}>
<Box
sx={{
display: 'flex',
flexDirection: 'row',
minWidth: 180,
maxWidth: 450,
}}
>
<CopyContainer value={hex} name={name}>
<Box
sx={{
Expand Down
9 changes: 8 additions & 1 deletion ui/design-tokens/src/Colors/ColorBlock4/ColorBlock4.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,14 @@ export const ColorBlock4: FC<ColorBlock4Props> = ({ name, color, sx }) => {
const { hex } = colorToStr(colorValue);
const textColor = mostReadable(hex);
return (
<Box sx={{ display: 'flex', flexDirection: 'column', width: 180 }}>
<Box
sx={{
display: 'flex',
flexDirection: 'column',
minWidth: 180,
maxWidth: 450,
}}
>
<CopyContainer value={hex} name={name}>
<Box
sx={{
Expand Down
9 changes: 8 additions & 1 deletion ui/design-tokens/src/Colors/ColorBlock5/ColorBlock5.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,14 @@ export const ColorBlock5: FC<ColorBlock5Props> = ({ name, color, sx }) => {
const colorValue = typeof color === 'string' ? color : color.value;
const { hex, rgba } = colorToStr(colorValue);
return (
<Box sx={{ display: 'flex', flexDirection: 'column', minWidth: 180 }}>
<Box
sx={{
display: 'flex',
flexDirection: 'column',
minWidth: 180,
maxWidth: 450,
}}
>
<CopyContainer value={hex} name={name}>
<Box
sx={{
Expand Down
4 changes: 2 additions & 2 deletions ui/design-tokens/src/Colors/GridContainer/GridContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const GridContainer: FC<GridContainerProps> = ({
children,
palette,
gap = 2,
columns = [3],
width = 220,
ref,
...rest
}) => {
Expand All @@ -19,7 +19,7 @@ export const GridContainer: FC<GridContainerProps> = ({
onMouseOver={() => setHover(true)}
onMouseOut={() => setHover(false)}
gap={gap}
columns={columns}
width={width}
{...rest}
>
{Object.keys(palette).map(color =>
Expand Down

0 comments on commit c973790

Please sign in to comment.