Skip to content

Instantly share code, notes, and snippets.

@Scrini
Last active July 4, 2019 12:24
Show Gist options
  • Save Scrini/ad126a9bd885f4107c67344453fd4407 to your computer and use it in GitHub Desktop.
Save Scrini/ad126a9bd885f4107c67344453fd4407 to your computer and use it in GitHub Desktop.
How organize your files of style
// styles/colors.js
const colors = {
primary: '#333333'
};
export default colors;
// styles/fonts.js
const fonts = {
title: 32
};
export default fonts;
// styles/metrics.js
const getTextMedia = (maxWidth) => {
return `screen and (max-width: ${maxWidth}px)`;
};
const metrics = {
phone: getTextMedia(360),
phone: getTextMedia(360),
phone: getTextMedia(360),
phone: getTextMedia(360),
};
export default metrics;
// styles/index.js
import colors from './colors';
import fonts from './fonts';
import metrics from './metrics';
export { colors, fonts, metrics };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment