4,176 karma · joined December 22, 2016
The site you posted is mentioned in the article but only as a related project.
>Of the billions in tax incentives granted to US companies every year by cities and states, many agreements require workers to come into the office some of the time, or at least live in the region. For companies receiving these incentives, relaxing in-office attendance could be costly.
>The contracts were crafted in a pre-pandemic era, at a time when commutes to the office were a given. Now governments are deciding whether to crack down or rewrite the rules entirely. In some states and cities, policy changes have already been proposed to account for the new reality of hybrid work.
https://www.bloomberg.com/news/features/2023-02-21/another-t...
This is where most of the 'logic' breaks down for me. The specificity scoring is a system of weights that trips up a lot of new front end developers. It's not straightforward. Different selectors have different weights you need to know about. There are 'hacks' you need to know about when you find yourself needing to override particularly heavy selectors. https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity
And conveniently the author doesn't mention !important.
I think nowadays I find myself using CSS variables and calc() more often to establish some system of logic in my CSS. I can have --spacing: 120% variable at the root of the tree, and all its descendants can consume that and use calc() to multiply that by a unit value to have consistently scaled spacing. The author doesn't mention this, but it's great!
When I visit my bank account online I'm met with full page advertisements for other services from the bank and I have to hunt around to find the tiny gray 'No thanks' text before I can even get to my accounts. And from there, I'm met with constantly changing UI patterns and abstract hieroglyphic icons instead of plain text like it should be.
https://old.reddit.com/r/Ghosts/comments/11jvwy4/after_years...
2. At runtime, I use the material-color-utilities library[1] to generate a whole color theme based on that one root color. The applyTheme method puts the theme into CSS variables on the body like --md-sys-color-primary: #c72320; and so on for each color token.
3. In tailwind.config.js I set the colors to point to those variables, for example "primary": "var(--md-sys-color-primary)", and so on for the rest of the colors.
Using this approach I can remap colors at runtime for whole subtrees by simply overriding the CSS color variables.
[1] https://www.npmjs.com/package/@material/material-color-utili...