Skip to content
This repository was archived by the owner on Jan 26, 2019. It is now read-only.

CSS modules with Typings #197

Closed
wants to merge 4 commits into from
Closed

CSS modules with Typings #197

wants to merge 4 commits into from

Conversation

tomaash
Copy link

@tomaash tomaash commented Nov 24, 2017

No description provided.

@tomaash tomaash changed the title include typings-for-css-modules-loader CSS modules with Typings Nov 27, 2017
@DorianGrey
Copy link
Collaborator

@tomaash , don't get me wrong - I appreciate the effort you've put into this.
But I think this is a bit too specialized to include it by default, especially since users that don't want to use it still have to live with the overhead it creates, at least without ejecting their project.
Furthermore, weakening the type checking strictness is something I'd not recommend or like, at least if it can be avoided.

However, I would be really useful to have this setup available in some kind of documentation for those interested in it.

@tomaash
Copy link
Author

tomaash commented Nov 28, 2017

I agree, this cannot really be just merged. After some experimenting, I reverted my approach to not use typings-for-css-modules-loader as well. The overhead is just too much. I'll create another PR with less intrusive approach when I get it more polished.

@tomaash
Copy link
Author

tomaash commented Dec 6, 2017

OK, so I just figured out that the best way to get CSS modules to any create-react-app setup is to use react-app-rewired Now my addons to react-scripts webpack are in a plugin. Closing this PR.

@tomaash tomaash closed this Dec 6, 2017
@FDiskas
Copy link

FDiskas commented Mar 30, 2018

@tomaash
create-react-app css modules enabled by default.
Try creating css file

:local {
  .demo: { color: red; }
}

then just import it like

import style from './my.css'
//...
<MyApp classname={style.demo} />

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants