Skip to content

Adds basic support to css modules #2

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Adds basic support to css modules #2

wants to merge 1 commit into from

Conversation

claudioc
Copy link
Owner

@claudioc claudioc commented Jun 25, 2017

This PR (not to be merged, at the moment) adds basic support for CSS modules to the project. It does it by:

  • enabling the native "modules" option in webpack css loader
  • changing the JSX templates to use the style.dynamicallyGeneratedClassName style for className property in React
  • adds a catch-all global.d.ts for TypeScript to be able to "see" the styles.css module files (only for TS 2.0+) (thanks to @mohsen1 for the idea)

What is missing is a proper loader which would create the d.ts file for each css module on the fly, so to be able for the editor to provide autocomplete feature and avoid using a global.d.ts.

There are two or three options to do that (plus the changes in the WebPack configuration to deal with the dynamic generation of new files in the src directory), see this issue for a deeper discussion on the topic. As for the project goal, I try to avoid taking decisions on behalf of who is going to use starter kit for a serious project when they can have an impact on the final result.

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.

1 participant