Skip to content

Commit

Permalink
refactor: don't modify fn args in Array.reduce callback (styles.js)
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgeorpinel committed Jan 7, 2020
1 parent a09dcc1 commit 8f6b217
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions src/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,25 @@ export const global = `
font-weight: 400;
text-rendering: optimizeLegibility !important;
}
@-moz-document url-prefix() {
body {
font-weight: lighter !important;
}
}
body {
padding: 0px;
font-family: BrandonGrotesque, Tahoma, Arial;
font-weight: normal;
-webkit-font-smoothing: antialiased;
line-height: 1.5;
// IE flex min-height fix https://stackoverflow.com/a/40491316
display: flex;
flex-direction: column;
}
*:focus {
outline: 0;
}
Expand All @@ -51,13 +51,14 @@ export const sizes = {

sizes.phablet = Math.floor((sizes.tablet + sizes.phone) / 2)

export const media = Object.keys(sizes).reduce((accumulator, label) => {
accumulator[label] = (...args) => css`
@media (max-width: ${sizes[label]}px) {
${css(...args)};
}
`
return accumulator
export const media = Object.keys(sizes).reduce((acc, cur) => {
return Object.assign(acc, {
[cur]: (...args) => css`
@media (max-width: ${sizes[cur]}px) {
${css(...args)};
}
`
})
}, {})

export const container = css`
Expand Down

0 comments on commit 8f6b217

Please sign in to comment.