IN which we investigate using CSS as a query language, or even a general purpose programming language, to do things other than lay out web pages in a browser.
Question: Why in God’s good name would you do that? CSS is infamously confusing. And better query languages exist, right? Such as SQL, which famously doesn’t have problems.
Answer: Because it’s there.
The basic principles of CSS look like this.
1. There are Things
“Things” are “domain entities”, or “atoms”, or “facts”. They exist outside of CSS – from CSS’s perspective, they’re just already and always there.
Such as:
<h1> Hello, World! </h1> <a href= "example.com" > This is a link </a> <div class= "awesome" data-custom-attribute= "foo" > <div id= "child" > This div is inside another one! </div> </div>
Specifically, here, Things are HTML elements.
2. We can Describe Sets of Things
... continue reading