Mobile first approach

This commit is contained in:
Chi Vinh Le
2018-07-12 14:23:54 -03:00
parent ff41fabb37
commit 2d69982ebb
7 changed files with 33 additions and 14 deletions
@@ -23,12 +23,12 @@ interface InnerProps {
}
const MatchMedia: StatelessComponent<InnerProps> = props => {
// TODO: Temporarily map newer speech to older aural type until
// react-responsive supports the speech prop.
const { speech, minWidth, maxWidth, ...rest } = props;
const mapped = {
// TODO: Temporarily map newer speech to older aural type until
// react-responsive supports the speech prop.
aural: speech,
minWidth: minWidth ? theme.breakpoints[minWidth] : undefined,
minWidth: minWidth ? theme.breakpoints[minWidth] + 1 : undefined,
maxWidth: maxWidth ? theme.breakpoints[maxWidth] : undefined,
};
return <Responsive {...rest} {...mapped} />;
-5
View File
@@ -1,5 +0,0 @@
@media (max-width: $breakpoints-sm) {
:root {
--spacing-unit: calc(0.5 * var(--spacing-unit));
}
}
+16
View File
@@ -0,0 +1,16 @@
/*
Variables defined in `variables.ts` are already available
flattened and in kebab case.
These are additionally variables we define.
*/
:root {
--spacing-unit: var(--spacing-unit-small);
}
@media (min-width: $breakpoints-xs) {
:root {
--spacing-unit: var(--spacing-unit-large);
}
}
+2 -1
View File
@@ -58,7 +58,8 @@ const variables = {
},
},
/* gitter and spacing */
spacingUnit: 10,
spacingUnitSmall: 5,
spacingUnitLarge: 10,
/* Borders */
roundCorners: "2px",
/* Typography */