-
-
Notifications
You must be signed in to change notification settings - Fork 2
Closed
Labels
good first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed
Milestone
Description
To be consistent with width
, minWidth
and maxWidth
props of styled-system:
<Stack minWidth={5}>
<Box>foo</Box>
<Box>bar</Box>
</Stack>;
Could be something like this:
const px = (value: TLengthStyledSystem): string =>
typeof value === 'number' ? `${value}px` : value;
const getMinMaxValue = (
value: TLengthStyledSystem,
scale: TLengthStyledSystem[] = []
): string => px(scale[value as any] || value);
const Stack = styled(Box)<Props>(
{
display: 'grid',
},
grid,
system({
minColumnWidth: {
property: 'gridTemplateColumns',
scale: 'space',
transform: (value, scale) =>
value
? `repeat(auto-fit, minmax(${getMinMaxValue(
value,
scale as TLengthStyledSystem[]
)}, 1fr))`
: null,
},
})
);
- Change
minWidth
prop implementation - Update docs if necessary to use spacing values instead of hardcoded ones
okonet
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed