Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Merge requests
  • !3549

CSS Modules local class names for Create React App

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/haraldrudell/css-modules into master Dec 05, 2017
  • Overview 4
  • Commits 2
  • Pipelines 0
  • Changes 2

Created by: haraldrudell

I though it would be pedagogical to use CSS Modules (locally scoped selectors), in a light version where the non-standard local: directive from the webpack plugin css-loader is being used. If people start making components from Create React App, with this they can’t miss how to do locally scoped css.

The point is that one way or another, we will need this and it is not going to be standard

  • Even if we do have .module.css files in 2.0, we will need a non-standard directive similar to :local and :global
  • We will need some non-standard directives should we use webpack or not
  • Otherwise local and global styles have to be in separate files
  • It does not seem w3c is going to help with standardization at the moment. The path there seems to be :scope which requires style elements in the middle of markup, eg. at the top of a component, regions or :host. You would hope they took a look at ECMAScript Symbols and found a simpler approach
  • besides the :scope aspect, it can also be foreseen that css is going to look even more like css in the future (ie. no scss cssinjs fancy-framework-dying-off-like-flies…)
  • Styling React components is not going to be standard. Either some clever mapping of possibly standards-compliant css values over to ECMAScript like css-loader, or a custom react-css-loader.

This was obviously made to work from the extensive work from the last 7 months in #2278 (closed) #2285 by @ro-savage slated for version 2.0 at some undetermined future time

harsh words on this topic are in #90 (closed)

This here is best evidence at the moment

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/haraldrudell/css-modules