I'm Tab Atkins

and I work at Google.

@tabatkins

xanthir.com/+

xanthir.com

xanthir.com/talks/2014-04-04

Extending CSS

CSS has traditionally been one of the most tightly sealed black boxes on the web.

No customization, no introspection, terrible tooling.

Preprocessors help somewhat, but there's many things they can't do.

Starting To Open Up

CSS Variables were the first crack in the wall.

Through currently primitive, they expose custom properties, which finally allow for inline property polyfills without reparsing or other hacks.

CSS Aliases

CSS Aliases

Proposed a common _ prefix for all custom CSS things, similar to the requirement to have a dash in custom element names.

At last minute, tried to apply this to custom properties, too.

Resulted in the WG agreeing on a -- prefix instead.

Custom properties are now written --foo: blue; color: var(--foo); (Update your tutorials!)

Future is Bright

Today we have custom properties, supported in nightly Firefox.

The WG approved custom media queries and pseudo-classes, though no support yet.

At this point the floodgates are open. I have many ideas for opening up the rest of CSS to customization and JS interaction. JS-driven pseudo-classes, custom functions, custom at-rules, etc.

The End

@tabatkins

xanthir.com/+

xanthir.com