CSS selectors all exist within the same global scope. Anyone who has worked with CSS long enough has had to come to terms with its aggressively global nature — a model clearly designed in the age of documents, now struggling to offer a sane working environment for today’s modern web applications. Every selector has the potential to have unintended side effects by targeting unwanted elements or clashing with other selectors. More surprisingly, our selectors may even lose out in the global specificity war, ultimately having little or no effect on the page at all.

Any time we make a change to a CSS file, we need to carefully consider the global environment in which our styles will sit. No other front end technology requires so much discipline just to keep the code at a minimum level of maintainability. But it doesn’t have to be this way. It’s time to leave the era of global style sheets behind.

It’s time for local CSS.

In other languages, it’s accepted that modifying the global environment is something to be done rarely, if ever.

In the JavaScript community, thanks to tools like Browserify, Webpack and JSPM, it’s now expected that our code will consist of small modules, each encapsulating their explicit dependencies, exporting a minimal API.

Yet, somehow, CSS still seems to be getting a free pass.

Many of us — myself included, until recently — have been working with CSS so long that we don’t see the lack of local scope as a problem that we can solve without significant help from browser vendors. Even then, we’d still need to wait for the majority of our users to be using a browser with proper Shadow DOM support.

We’ve worked around the issues of global scope with a series of naming conventions like OOCSS, SMACSS, BEM and SUIT, each providing a way for us to avoid naming collisions and emulate sane scoping rules.

We no longer need to add lengthy prefixes to all of our selectors to simulate scoping. More components could define their own foo and bar identifiers which — unlike the traditional global selector model—wouldn’t produce any naming collisions.

import styles from './MyComponent.css';
import React, { Component } from 'react';
export default class MyComponent extends Component {
 render() {
    return (
      <div>
        <div className={styles.foo}>Foo</div>
        <div className={styles.bar}>Bar</div>
      </div>
    );
  }

The benefits of global CSS — style re-use between components via utility classes, etc. — are still achievable with this model. The key difference is that, just like when we work in other technologies, we need to explicitly import the classes that we depend on. Our code can’t make many, if any, assumptions about the global environment.

Writing maintainable CSS is now encouraged, not by careful adherence to a naming convention, but by style encapsulation during development.

Once you’ve tried working with local CSS, there’s really no going back. Experiencing true local scope in our style sheets — in a way that works across all browsers— is not something to be easily ignored.

Introducing local scope has had a significant ripple effect on how we approach our CSS. Naming conventions, patterns of re-use, and the potential extraction of styles into separate packages are all directly affected by this shift, and we’re only at the beginning of this new era of local CSS.

process.env.NODE_ENV === 'development' ?
    '[name]__[local]___[hash:base64:5]' :
    '[hash:base64:5]'
)

Understanding the ramifications of this shift is something that we’re still working through. With your valuable input and experimentation, I’m hoping that this is a conversation we can have together as a larger community.

Note: Automatically optimising style re-use between components would be an amazing step forward, but it definitely requires help from people a lot smarter than me.


The perfect course for beginners, or those wishing to start a new business as an exceptional Classic Eyelash Extension Artist. A fully comprehensive course curriculum & valuable extra bonuses included! Bonuses include:VIP Facebook Group Access, lifetime support.

  • CLASSIC LASHES
  • Includes learning material, PDFs, printouts.
  • E-Book/Video Bundle including several training videos.
  • Money Mastery E-course with Guest Mentor Jessica Giles.
  • 15% Lifetime Discount on lash kits and products.
  • Training sheets, wholesalers list & discount code for online lash stores worldwide.See our product page for full course details!

Designed for lash artists with a minimum of 3 months experience in Classic Lashes. A comprehensive course, covering all aspects of how to create beautiful Volume Lashes.

Get a DISCOUNT when you Register for A Bundle

 

Are You A Small Business Owner Ready for a New Opportunity?

Get on the waiting list for the 6 Weeks BIZ Transformation now. You'll learn how to make a bigger impact online, how to attract more customers via social media, and gain an understanding of the technicalities that go into writing an ad that will actually convert customers!

 

EYE & LASH HEALTH COURSE BY LASH TRIBE

This comprehensive course teaches how to recognize eye conditions, how to consult
with your clients and how to give them lashes for life.
 
  • 20 modules, 2 certificates from the Eye and Lash Health Institute, USA
  • Discover the Art of recognizing eye conditions and diseases
  • Know when to refer a client to a doctor
  • Discover the importance of eye and lash health
  • Educate your clients on lash health and gain trust
  • Recognize when an eye or skin reaction may occur
  • You will learn how to prevent allergies by using one unique, award winning
  • product.
Get a DISCOUNT when you Register for A Bundle

 

ADVANCED EYE STYLING COURSE BY LASH TRIBE

A course for Classic & Volume Lash Artists, who want to expand their skill base with
more in-depth styling. This covers a variety of eye shapes and custom based
designs, to provide the perfect set of lashes for their clients. The 16 Video Modules
provide a comprehensive curriculum, including Advanced Eye Shapes and Styling
Case Studies.
These advanced lashing methods will give you the confidence in everyday lashing,
but will also make your business and skills stand out from masses of lash artists that
have not trained in advanced lash techniques.

Add this product to start building your bundle.

Get a DISCOUNT when you Register for A Bundle

 

An advanced technique, to create the darkest and fullest lashes possible.

Are you a Russian Volume Tech and want to take it up a notch? To make more
money and wow your customers? Then the MEGA Volume Course is what you need.
The course is packed with information to wow your clients and obtain a great return
for you!

Add this product to start building your bundle.

Get a DISCOUNT when you Register for A Bundle

 

An advanced technique, to create the darkest and fullest lashes possible.

If you are an existing Volume Lash artist looking to enhance your skills with
in-depth training, this course is for you! This course is packed with over 25
Lessons, new techniques & multiple bonuses!
  • Learn more than 1 pick-up technique
  • Struggling with current Volume fanning techniques?
  • Experience inconsistency, and only occasionally achieve a straight T-bar &
  • crossed bases?
  • Feeling stuck in your ways?
  • Issues with the Tweezers and Products you are using?
  • Get the correct “wrapping technique on a more consistent basis”
  • You would like your sets to last longer?

Add this product to start building your bundle.

Get a DISCOUNT when you Register for A Bundle

LASH LIFT
Lash lift is a simple, high performance & high-quality treatment for your lashes. It’s taking the beauty industry by storm and is an inexpensive way to diversify your lashservices, and retain clients who can’t tolerate lash extensions. Taking only about 20 minutes, the lift is performed in 2 easy steps!The Lash lift conditions and keeps the lashes beautifully curled, for 9-12 weeks.We also recommend finishing the procedure with Belmacil lash tint + an Ellevate mascaraThe results are Lovlicious lashes; longer appearance and thicker due to the curve that fills the entire length of the eye.

Get a DISCOUNT when you Register for A Bundle

Developing writers can often benefit from examining an essay, a paragraph, or even a sentence

Are you ready to grow, get rid of stress, and start making more money? Learn how
to actually spend less time on your business. This course offers a wealth of
information to;
 
Get a DISCOUNT when you Register for A Bundle

Privacy Preference Center

X
X