Convert SCSS (Sass) to CSS-in-JS
Course on egghead by Oleg Isonen
- 24 min
- LengthVideo runtime
- Free
- Price modelListed as free
- 11
- Lessons
- 4.6
- Rating out of 56 ratings on egghead
- Aug 2018
- Published7 Aug 2018
About this course
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.
What it covers
- 1Convert Sass (SCSS) Styled Button to CSS-in-JS with JavaScript Templates and Variables
- 2Import JavaScript Variables for Styling with CSS-in-JS
- 3Import and Render Style Partials from JavaScript Modules with CSS-in-JS
- 4Use JavaScript Functions as Mixin Directives for CSS-in-JS Style Declarations
- 5Destructure Named CSS-in-JS Arguments to use in JavaScript Mixin Functions
- 6Define and Override Default CSS-in-JS Values for Arguments in a JavaScript Function Mixin
- 7Apply Multiple CSS-in-JS Arguments in a JavaScript Mixin Function with the Rest Operator
- 8Express CSS with JavaScript Objects for CSS-in-JS Notation
- 9Use JavaScripts Spread Operator to Apply Style Objects Returned from CSS-in-JS Mixins
- 10Prevent CSS Class Name Collisions with Scoped Class Names in CSS-in-JS
- 11Style HTML with JavaScript Template Strings and Objects in CSS-in-JS
Similar HTML and CSS courses
Same topic, nearest in length, up to three from any one provider.
Data read from the egghead catalogue on 28 Nov 2026. How the data is collected.