Skip to content

Instantly share code, notes, and snippets.

@kettanaito
Last active December 2, 2018 20:17
Show Gist options
  • Save kettanaito/096574b6355e2788abd315847a25e28e to your computer and use it in GitHub Desktop.
Save kettanaito/096574b6355e2788abd315847a25e28e to your computer and use it in GitHub Desktop.
Medium - Atomic layout - Numeric - Custom
import Layout from 'atomic-layout'
Layout.configure({
defaultUnit: 'rem' // append "rem" instead of "px" to all numeric values by default
})
// rest of the App code here, such as ReactDOM.render()
import React from 'react'
import { Composition } from 'atomic-layout'
const Header = () => (
<Composition
gutter={2} // compiles to "2rem" of "grid-gap"
paddingVertical="14px" // compiles to "14px" explicitly
>
{/* children */}
</Composition>
)
export default Header
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment