Hacker News new | ask | show | jobs
by rwesty 2241 days ago
Neat, it would be an interesting linting tool to help minify CSS. I was wondering why the pruning tool took so long but I can see they are using visuals to determine if a a style is needed or not. That's a really smart way to do it, I wonder what other use cases there are for mapping visual images to code. This is almost like a selenium test for CSS.
1 comments

I wonder how broad the definition of effectiveness is in their implementation. The visual method might have limitations, considering that many CSS properties are only "effective" when you start moving/interacting with elements, e.g. resizing the window/elements, or hovering over elements or using other cursor actions.
Looks like good ol’ screen diffing. It may be possible to use heuristics to detect when a rule might be important for layout in other configurations but this is probably good enough for the stated purpose of highlighting what CSS is important for learning.