Git Product home page Git Product logo

style-react's Introduction

How to Style in React and Not Lose Friends

Aside from our most recent presidential election, I don't know another topic that is sure to cause more heated debate than how you should style React components. This workshop sets out to cover the main methods for styling in React (and beyond).

Through live code exercises, we will explore the pros and cons of just some of the methods out there. You will learn to make styling decisions based on the scale of a project. By the end you should feel confident that there is hope! You can style React components without losing friends.

Link to slide Deck


Part One - BEM

This link will take you to a starter React SPA in Codepen.

Fork this repo and refactor the CSS to use the BEM naming convention.


Part Two - Sass

This link will take you to a starter React SPA in Codepen.

This repo has Sass installed for you.

Fork this repo and refactor the CSS to use Variables, nesting, and any other Sass conventions you want.

This is the completed Sass example, don't cheat!


Part Three - Inline Styles

This link will take you to a starter React SPA in Codepen. This is the same pen we used in

Part One. We will slowly start replacing the CSS with inline style objects.

Fork this repo and fill out the rest of the styles using inline javascript.

This is the completed Inline example, don't cheat!


Part Four - CSS Modules

This repo contains the code needed to complete the CSS Modules part of this workshop. I have gotten things started for you by completing the header and footer components.

To Get started

Open up your terminal:

  1. npm install
  2. npm start

BrowserSync will open up a new tab automatically!

style-react's People

Contributors

sarrahv avatar

Stargazers

 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.