Menu

📰
0

CSS As A Query Language · evdc.me

evdc.me·@HashtagPLUS·about 1 month ago
#nxoo1al8
#fn#fnref#child#parent#ancestor#things
Reading 0:00
15s threshold

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 . 1 2. We can Describe Sets of Things We can write down selectors which refer to sets of Things that all have something in common .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More