Last active
October 10, 2017 23:04
-
-
Save casesandberg/a9460cbcfbd71aa9fb7cefc9f5b40133 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Uses Context and transforms string values ('tiny' => 4px) | |
connectToStyles(({ padding }) => { | |
table: { | |
...padding({ left: ‘tiny’ }) | |
} | |
)) | |
// Uses Context and passes values for use explicitly | |
connectToStyles(({ padding, sizes }) => { | |
table: { | |
...padding({ left: sizes.tiny }) | |
} | |
)) | |
// No Context | |
Import { sizes } from './const' | |
Import { padding } from '@styles/helpers' | |
connectToStyles({ | |
tabel: { | |
...padding({ left: sizes.tiny }) | |
} | |
}) | |
// Combine Vars, External Helpers | |
import { padding } from '@styles/helpers' | |
connectToStyles(({ sizes }) => { | |
tabel: { | |
...padding({ left: sizes.tiny }) | |
} | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { StyleProvider, combineConfigs } from '@styles/react' | |
import { styles as companyConfig } from '@company/configs' | |
import { projectConfig } from './styleConfig' | |
ReactDOM.render( | |
<Provider> | |
<StyleProvider config={ combineConfigs(companyConfig, projectConfig) }> | |
<App /> | |
</StyleProvider> | |
</Provider> | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment