|
|
|
|
|
by nottorp
1037 days ago
|
|
No of course I don't. And due to javascript's reputation, I assumed. Because what I said IS generally true for the js bubble. The sad part is i don't even feel guilty for assuming, because this area of programming has a well deserved reputation. Even if this thing doesn't use javascript, can you guarantee the generated CSS doesn't put the browser's layout engine in an infinite loop or something? Especially without knowing CSS, like the OP suggested it's normal? |
|
the way TW aproximatively works is to collect a set of used class names from your code (e.g. flex, min-h-screen, bg-[url(/img/grid.svg)], absolute, etc.) and produce the CSS for those classes.
For the random 5 classes above it would produce:
By default TW also includes a CSS reset preamble and defines internal variables.Sometimes the generated css contains complex selectors but as far as I know it is not a common occurrence
In other cases more css variables (custom properties defined in the preamble) are used I believe that CSS performance is mostly dominated by size in bytes of the stylesheet, number of properties, complexity of selectors, and frequency of updates. I suspect that TW improves most of these metrics in exchange of bigger html class attributes.https://play.tailwindcss.com/