Remove max-widths, use theme breakpoints module for consistency

This commit is contained in:
Aarni Halinen
2020-12-28 20:23:51 +02:00
parent f286f6dfba
commit 32bff36611
22 changed files with 71 additions and 59 deletions
+11 -8
View File
@@ -1,11 +1,14 @@
const breakpointsNumber = {
mobile: 800
type Keys = "mobile" | "medium" | "large" | "xlarge";
const breakpointsNumber: Record<Keys, number> = {
mobile: 800,
medium: 1200,
large: 1920,
xlarge: 2560
}
const breakpoints = {};
const breakpoints = Object.fromEntries(
Object.entries(breakpointsNumber).map(([k, v]) => [k, `${v}px`])
);
Object.keys(breakpointsNumber).forEach((key) => {
breakpoints[key] = `${breakpointsNumber[key] }px`
});
export default breakpoints;
export default breakpoints as Record<Keys, string>;
+2
View File
@@ -54,3 +54,5 @@ export const colorToClass = (color: Colors): string => color ? `color-div__${col
export const bgColorToClass = (color: Colors): string => color ? `color-div__background_${color}` : undefined;
export const hoverColorToClass = (color: Colors): string => color ? `color-div__${color}Hoverable` : undefined;
export const bgHoverColorToClass = (color: Colors): string => color ? `color-div__background_${color}Hoverable` : undefined;
export default colors;