illustration for Convert SCSS (Sass) to CSS-in-JS
free

Convert SCSS (Sass) to CSS-in-JS

Instructor

Oleg Isonen

23m closed-captioning
·
11 lessons
Star icon$$$
Star icon$$$
Star icon$$$
Star icon$$$
Star icon$$$
3.9
591
people completed
Published 7 years ago
|
Updated 4 years ago

CSS uses a global namespace for CSS Selectors that can easily result in style conflicts throughout your application when building an application using modern web components. You can avoid this problem by nesting CSS selectors or use a styling convention like BEM but this becomes complicated quickly and won’t scale.

CSS-in-JS avoids these problems entirely by generating unique class names when styles are converted to CSS. This allows you to think about styles on a component level with out worrying about styles defined elsewhere.

In this course, you will learn how to express popular SCSS (Sass) language features using latest JavaScript features. We will convert simple examples from SCSS to CSS-in-JS. As a designer or (S)CSS developer, you should be able to follow without extensive JavaScript knowledge, understanding SCSS is required though. We will not be using any particular CSSinJS libraries. Instead, we will focus on a base knowledge you need later if you use any CSSinJS library.

Free Community Resource

A Community Resource means that it’s free to access for all. The instructor of this lesson requested it to be open to the public.

Learner Reviews

  • Star icon$$$
    Star icon$$$
    Star icon$$$
    Star icon$$$
    Star icon$$$
    How will you use what you learned from this course?

    the javascript concepts are useful, but not sure about implementing a css framework inside javascript is

    technokon
    6 years ago
  • Star icon$$$
    Star icon$$$
    Star icon$$$
    Star icon$$$
    Star icon$$$
    How will you use what you learned from this course?

    Nice usage JS for CSS but little chaotic for me and would be better great with more examples :)

    Kamil L
    6 years ago
  • Star icon$$$
    Star icon$$$
    Star icon$$$
    Star icon$$$
    Star icon$$$
    What would make this course a 7 for you?

    Maybe the prononciation could be better, and the speed of explanations could be a little bit slower.

    But I liked it very much, thanks !

    Erica
    6 years ago
  • Star icon$$$
    Star icon$$$
    Star icon$$$
    Star icon$$$
    Star icon$$$
    What did you like about this course?

    Very crisp ans straight to the point. I was struggling to understand need for CSS Loaders in any project.This tiny powerful course resolved my queries.

    Varun Goel
    6 years ago
  • Star icon$$$
    Star icon$$$
    Star icon$$$
    Star icon$$$
    Star icon$$$
    How will you use what you learned from this course?

    Thanks for this course, Oleg. The pace of the course was perfect since I already know Javascript. But I feel like it would be good to have a 'where to go next' video at the end. We currently use a SASS/BEM solution to create a monolithic global CSS file for a React/Redux app and would like some guidance on how to go about converting to a CSS-in-JS approach with some hints on the pros and cons of this approach.

    Jamie
    6 years ago
  • Star icon$$$
    Star icon$$$
    Star icon$$$
    Star icon$$$
    Star icon$$$
    What did you like about this course?

    Great stuff. And great form of each course whose each lesson starts with 'We have two buttons'... All in all, very useful stuff. Thank you!

    Artificial Labs
    6 years ago