Optimize CSS with SAT Solving
github.com
github.com
Just a note on macOS I managed to get this work by:
- Editing the pyproject.toml and changing
- lxml version to 5.1.0
- python to ^3.8
- then running poetry install
- then, also in the repo, running cd satcss && ln -s $(which z3) z3
- then poetry run satcss --help
I may have skipped a step or 2 but that was basically it. I then used satcss' output with this toolhttps://css.github.io/csso/csso.html
to beautify and further organize it
This is pretty much exactly what I was looking for!
Even if you ignore that graph problems typically have more time complexity than LLMs offer during inference, they are circuit like and not turing machine like.
Without getting lucky with pre-training matches, it would be surprising if they were good at it at all.
I don’t know … maybe these pythonistas like the arcane type of secret initiate knowledge required in order to participate?
Or go the full hog and use a container like nix.
.a and .b identify different groups of elements. The fact they’re both coloured red is incidental, circumstantial and likely temporary. Refactoring to save a couple of lines makes the code less deleteable and thus harder to maintain.
I guess what I was looking for was a different type of benefits, more achieved through normalizing the CSS.
My CSS was just like accreted overtime and I just couldn’t be bothered to like get the overall picture myself, and re-organize — so I wanted to reduce some of the entropy and redundancy and increase organization, so it would be clearer.
I think from another point of view having something that’s clearer and tighter is more maintainable.
All depends on what you want I suppose. I was also hoping that I would be able to change a color in one place and it would update across many selectors. And that’s one of the benefits that a more normalized factored structure gives.
Ann interesting dichotomy, your comment raises between fully denormalized and easy to change a single thing, and what I am trying to achieve in this case, and that’s more succinct and structured with related parts proximal. A more ‘normalized’ CSS haha! :)
I think I'd pay for this if it works properly...
<button
type="button"
className={clsx(
checked ? "border-2 border-primary-800" : "",
"flex touch-none flex-col items-center justify-between rounded border border-gray-100 bg-white hover:border-2 hover:border-primary-800",
)}
>.a { color: red }
.b { color: red }
Also it saves on parsing time I suppose. And less to zip and unzip.
The type of thing I'd add to a projects deployment stage and never touch again unless it causes an issue.
CSS is probably a much smaller concern than JS but in the world of 5G networks and fast WiFi I feel like we’re nearing a world where device CPU can be a bigger bottleneck than bandwidth at times.
I've only used it once but it did the job (NOTE: Plain HTML, plain CSS, no build pipeline. So YMMV)
Yeah, in a related anecdote it’s surprising how sparse the landscape of CSS tools seemed at least for command line tools that I was looking for.
I didn’t want an ID plug-in because I didn’t really use anything except for vim and I don’t really use plug-ins for that.
That might be kind of a niche set up but when I went looking for like even just something to sort the properties by some standard order within each rule, I couldn’t find anything current that worked in my searching anyway.