Skip to content

feat(cssModule): add support for css module#206

Merged
eddywashere merged 1 commit intoreactstrap:masterfrom
TheSharpieOne:feature/css-modules
Oct 27, 2016
Merged

feat(cssModule): add support for css module#206
eddywashere merged 1 commit intoreactstrap:masterfrom
TheSharpieOne:feature/css-modules

Conversation

@TheSharpieOne
Copy link
Copy Markdown
Member

Add cssModule prop to every component which produces a css classname
Add mapToCssModule util will can turn a normal css className string
into module className if the module object/mapping is provided.
Closes #205

Add cssModule prop to every component which produces a css classname
Add mapToCssModule util will can turn a normal css className string
into module className if the module object/mapping is provided.
Closes reactstrap#205
@TheSharpieOne
Copy link
Copy Markdown
Member Author

.....This feature should probably be documented somewhere. It's more of a global feature, similar to the tag prop. I'm thinking there might need to be a new page in the docs which explains these things rather than mentioning it on every component.

@eddywashere
Copy link
Copy Markdown
Member

nice! I haven't used css-modules before. I thought something like this would be more involved. +1 to docs, maybe a core concepts page or advanced usage.

:shipit:

@eddywashere eddywashere merged commit 3a69f14 into reactstrap:master Oct 27, 2016
@TheSharpieOne TheSharpieOne deleted the feature/css-modules branch October 27, 2016 14:07
@kuzvac
Copy link
Copy Markdown

kuzvac commented Jun 1, 2017

Hi @TheSharpieOne! Can you, please suggest how use this Css module feature? I can't find any documentation about this awesome feature :(

@TheSharpieOne
Copy link
Copy Markdown
Member Author

When you import a css/sass/less etc file it will result in a mapping object, simply pass that object to the cssModule prop.

import styles from './styles.scss';
//... 
<Card color="primary" outline cssModule={styles}>
  Stuff
</Card>
//... 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants