Finally, CSS In JavaScript! Meet CSSX – Smashing Magazine

By | 18/04/2016

Warning: Undefined variable $button in H:\root\home\stelco-001\www\collinscreative\wordpress\wp-content\plugins\facebook-share-new\facebookshare.php on line 631

Warning: Undefined variable $content in H:\root\home\stelco-001\www\collinscreative\wordpress\wp-content\plugins\facebook-share-new\facebookshare.php on line 636

JavaScript is a wonderful language. It’s rich, it’s dynamic, and it’s so tightly coupled to the web nowadays. The concept of writing everything in JavaScript doesn’t sound so crazy anymore. First, we started writing our back end in JavaScript, and then Facebook introduced JSX, in which we mix HTML markup with JavaScript. Why not do the same for CSS? Imagine a web componentdistributed as a single .js file and containing everything — markup, logic and styles. We would still have our basic style sheets, but the dynamic CSS would be a part of JavaScript. Now this is possible, and one way to achieve it is with CSSX. CSSX is a project that swallowed my spare time for a month. It was challenging and interesting, and it definitely pushed me to learn a lot of new stuff. The result is a set of tools that allows you to write vanilla CSS in JavaScript.

Source: Finally, CSS In JavaScript! Meet CSSX – Smashing Magazine