Don't use a CSS pre-processor anymore.

@glrodasz

Guillermo Rodas

Google Developer Expert in Web Technologies

Conference Organizer and Online Teacher

https://guillermorodas.com

@glrodasz

Summary

  • Pre-processor, what!?
  • Comparing features
  • It is worth it?
  • PostApocaliticCSS

Pre-processor, what!?

August 19, 2019

Lastest release

April 24, 2017

Lastest release

January 12, 2016

Lastest release

2010

First release

2009

First release

2006

First release
  • Variables
  • Nesting
  • Mixins
  • Functions
  • Modules

CSS pre-processors

features

August 19, 2019

Lastest release

April 24, 2017

Lastest release

January 12, 2016

Lastest release

Comparing features

Variables

SASS variables are replaced with their values as the preprocessor produces its CSS output.

 

CSS custom properties are evaluated by the browser at runtime.

Change on media queries

 Theming with custom properties 

Nesting

Mixins

A lot of problems that we used to solve with mixins have a better native solution.

functions

url(), attr(), calc(), lang(), :not(), rgb(), rgba(), hsl(), hsla(), :nth-child(), :nth-last-child(), :nth-of-type(), :nth-last-of-type(), cubic-bezier(), path(), steps(), scaleX(), scaleY(), scaleZ(), scale3d(), scale(), translateX(), translateY(), translateZ(), translate3d(), translate(), perspective(), rotateX(), rotateY(), rotateZ(), rotate3d(), rotate(), skewX(), skewY(), skew(), brightness(), blur(), contrast(), grayscale(), invert(), opacity(), saturate(), sepia(), drop-shadow(), hue-rotate(), linear-gradient(), repeating-linear-gradient(), radial-gradient(), repeating-radial-gradient(), conic-gradient(), repeating-conical-gradient, fit-content(), minmax(), repeat(), circle(), ellipse(), polygon(), inset(), element(), image-set(), ::slotted()

annotation(), counter(), counters(), cross-fade(), dir(), env(), has(), image(), clamp(), :host(), :host-context(), :is(), :where(), max(), min(), :nth-col(), :nth-last-col(), symbols()

matrix(), matrix3d(), rect(), target-counter(), target-counters(), target-text(), character-variant(), styleset(), stylistic(), format(), leader(), local(), ornaments(), swash()

93 CSS native functions

18 in process to be release, and 14 are deprecated

Custom Properties Fallback values

Modules

when you use @import to include extra CSS files it creates extra HTTP requests, extra requests for the browser of your visitor to deal with.

But is really this kind of modules that we want?

This is just concatenation of CSS files and for that, we can use other solutions that come with our bundlers.

mini-css-extract-plugin

gulp-concat-css

CSS Modules for scoping, and CSS imports in modern bundlers

It is worth it?

If we don't start to use the new CSS today it will happen like happened with HTML5, ES2015 and Flexbox.

Always bet on standards solutions

PostCSS

package.json

Questions?

Don't use a CSS pre-processor anymore

By Guillermo Rodas

Don't use a CSS pre-processor anymore

In this talk, we are going to evaluate the current native solutions against the pre-processors features in CSS.

  • 393