Skip to content
GitLab
    • Explore Projects Groups Snippets
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
  • !735

Include some advice on using styles

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge style-suggestions into master 8 years ago
  • Overview 1
  • Commits 1
  • Pipelines 0
  • Changes 2

Created by: gaearon

@vjeux @lacker

Plz review. Related to https://github.com/facebookincubator/create-react-app/issues/642#issuecomment-246848318.

I think it’s not super obvious why those files are split and we have a chance to gently nudge people towards writing more component-oriented CSS if we explain what we mean.

Compare
  • master (base)

and
  • latest version
    0a1df193
    1 commit, 2 years ago

2 files
+ 15
- 0

    Preferences

    File browser
    Compare changes
packages/react-sc‎ripts/template/src‎
App‎.css‎ +10 -0
inde‎x.css‎ +5 -0
packages/react-scripts/template/src/App.css
+ 10
- 0
  • View file @ 0a1df193


/**
* This is a good place to put styles related to the <App /> component.
* We recommend that, when possible, a component CSS file only includes styles
* that are used by that specific component. This is why all class names start
* with "App" in this example. Instead of defining nested selectors for child
* components, we recommend passing all relevant information as props (such as
* <Button color="red" size="large" />) in React. Then you can have <Button />
* use its own Button.css file without coupling their styles together.
*/
.App {
text-align: center;
}
packages/react-scripts/template/src/index.css
+ 5
- 0
  • View file @ 0a1df193


/**
* This is a good place to put styles that apply to the whole page.
* We recommend to put component-specific styles into separate files.
*/
body {
margin: 0;
padding: 0;
0 Assignees
None
Assign to
0 Reviewers
Request review from
Labels
0
None
0
None
    Assign labels
  • Manage project labels

Milestone
No milestone
None
None
Time tracking
Lock merge request
Unlocked
participants
Reference:
Source branch: style-suggestions

Menu

Explore Projects Groups Snippets