Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions packages/design-system/src/components/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,19 +115,20 @@ const ButtonWrapper = styled<FlexComponent<'button'>>(Flex)<ButtonWrapperProps>`
${({ theme, $size }) => {
const sizeValue = theme.sizes.button[$size];

if (!sizeValue) return '';

if (typeof sizeValue === 'string') {
return `height: ${sizeValue};`;
}

const styles: string[] = [];
Object.entries(sizeValue).forEach(([breakpoint, breakpointValue]) => {
if (breakpointValue) {
if (breakpoint === 'initial') {
styles.push(`height: ${breakpointValue};`);
} else if (breakpoint in theme.breakpoints) {
const breakpointQuery = theme.breakpoints[breakpoint as keyof typeof theme.breakpoints];
styles.push(`${breakpointQuery} { height: ${breakpointValue}; }`);
}
if (!breakpointValue) return;
if (breakpoint === 'initial') {
styles.push(`height: ${breakpointValue};`);
} else if (breakpoint in theme.breakpoints) {
const breakpointQuery = theme.breakpoints[breakpoint as keyof typeof theme.breakpoints];
styles.push(`${breakpointQuery} { height: ${breakpointValue}; }`);
}
});

Expand Down