Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | 29x 1x 29x 29x 23x 6x 17x | import { css, cssClass } from '../styled';
import { theme } from '../utils';
export const Container = styleProps => cssClass`
width: 100%;
${!styleProps.isFluid &&
css`
max-width: ${theme('breakpoints', 'fullHD')(styleProps)}px;
`};
${styleProps.isFluid &&
css`
padding-left: ${theme(styleProps.themeKey, 'fluidMargin')(styleProps)}rem;
padding-right: ${theme(styleProps.themeKey, 'fluidMargin')(styleProps)}rem;
& {
${theme(styleProps.themeKey, 'css.fluid')(styleProps)};
}
`};
${(styleProps.isLayout || styleProps.isFluid) &&
css`
@media (max-width: ${theme('breakpoints.tablet')(styleProps)}px) {
padding-left: ${theme(styleProps.themeKey, 'tabletMargin')(styleProps)}rem;
padding-right: ${theme(styleProps.themeKey, 'tabletMargin')(styleProps)}rem;
}
`};
${styleProps.isLayout &&
css`
& {
${theme(styleProps.themeKey, 'css.layout')(styleProps)};
}
`};
${getResponsiveProperties(styleProps)};
${styleProps.align && !styleProps.isFluid ? alignProperties[styleProps.align] : null};
& {
${theme(styleProps.themeKey, 'css.root')(styleProps)};
}
`;
export const alignProperties = {
left: css`
margin-right: auto;
`,
center: css`
margin-left: auto;
margin-right: auto;
`,
right: css`
margin-left: auto;
`
};
export function getResponsiveProperties(styleProps) {
const { breakpoint, isFluid } = styleProps;
if (isFluid) return;
if (breakpoint) {
return css`
& {
max-width: ${theme('breakpoints', breakpoint)(styleProps)}px;
}
`;
}
return css`
@media (max-width: ${theme('breakpoints', 'fullHD')(styleProps) + 128}px) {
max-width: ${theme('breakpoints', 'widescreen')(styleProps)}px;
}
@media (max-width: ${theme('breakpoints', 'widescreen')(styleProps) + 128}px) {
max-width: ${theme('breakpoints', 'desktop')(styleProps)}px;
}
@media (max-width: ${theme('breakpoints', 'desktop')(styleProps) + 128}px) {
max-width: ${theme('breakpoints', 'tablet')(styleProps)}px;
}
`;
}
|