Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSS modules? #176

Closed
hipertracker opened this issue Sep 15, 2017 · 10 comments
Closed

CSS modules? #176

hipertracker opened this issue Sep 15, 2017 · 10 comments
Labels
discussion An issue that requires a discussion question

Comments

@hipertracker
Copy link

How to use CSS modules in create-elm-app? E.g. I'd like to import in JS not css but css module.

@halfzebra
Copy link
Owner

Hello @hipertracker! Thanks for the question.

At the moment ejecting is your only option.

CSS modules are most likely will be in Create React App create-react-app/issues/2278 and we will consider adding this feature if there's enough interest.

@fobos @gyzerok @jackfranklin thoughts?

@gyzerok
Copy link
Contributor

gyzerok commented Sep 17, 2017

@hipertracker how much JavaScript/Elm code do you have in your app? How is it structured? What is your JavaScript code doing?

@halfzebra personally I don't see much use of CSS Modules in Elm application. You probably won't have too much JS code and even if you will it shouldn't be about view. So I'd consider amount of potential users of this feature pretty low. At the same time it will increase maintenance cost.

@halfzebra
Copy link
Owner

halfzebra commented Sep 17, 2017

@gyzerok thanks for the reply! 👍

This feature is fairly simple to implement, but it surely complicates the post-eject life.

We had a similar conversation about elm-css, I suppose there are not enough use-cases for including CSS Modules into the default config so far.

I'll keep this issue open to track the interest towards CSS Modules.

@halfzebra halfzebra added discussion An issue that requires a discussion question labels Sep 17, 2017
@hipertracker
Copy link
Author

hipertracker commented Sep 17, 2017

@halfzebra my project uses React and Cerebral with few embed Elm components. For the moment I use https://github.com/kitze/custom-react-scripts instead of original create-react-app. I'd like to use create-elm-app instead, but I need CSS modules.

@hipertracker
Copy link
Author

hipertracker commented Sep 18, 2017

I guess, there is no need to eject or adding CSS modules. It can be all customized through the fork of react-scripts. At least this works for FB create-react-app

@jackfranklin
Copy link
Contributor

I think CSS modules in Elm is definitely something that is a good option for ejecting - especially as there isn't as much use of it (as I'm aware) in the Elm community as there is in the JS one. I'd say leave this issue as one where others can voice if this would be useful or not.

@hipertracker
Copy link
Author

I don't like eject because this is a one way ticket. Once you do it you are on your own. You can't get benefits from the later create-elm-app upgrades.

@gyzerok
Copy link
Contributor

gyzerok commented Sep 18, 2017

@hipertracker you can create a fork and add specific things you need. Then you can merge upstream once it have some changes.

@hipertracker
Copy link
Author

OK, if nobody is interested in the hybrid approach here.... I have just created the fork and added CSS modules and React support. I described how to use it at the end of README file. https://github.com/hipertracker/create-elm-app. Currently I have React and CSS modules. (Later I plan to add SASS, LESS, Stylus modules as well, like in kitze/custom-react-scripts)

@halfzebra
Copy link
Owner

I'm closing this, #311 allows having the configuration for modules if necessary.

Please feel free to reopen if anyone is interested in discussing the option of having the support for CSS Modules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion An issue that requires a discussion question
Projects
None yet
Development

No branches or pull requests

4 participants