MrVauxs / pf2e-graphics

@vauxs
https://mrvauxs.net
GNU General Public License v3.0
16 stars 14 forks source link

Put style variables into `:root` #322

Open farling42 opened 3 days ago

farling42 commented 3 days ago

When looking at the styles in a journal entry I noticed that you have some CSS variables set with a selector of "*, :before, :after"

This means that they are appearing for every single element as well as every single parent element, repeatedly.

It would be much tidier (and possibly involve less CSS processing by the browser) to simply place them in ":root" like is done for the core Foundry and PF2e CSS variables.

Alternatively, apply some additional scope so that they aren't referenced by most of the UI elements at all.

MrVauxs commented 3 days ago

It's done by Tailwind, and I believe it has negligible if any performance impact. But I'll see about limiting it in scope. It cannot be put in root though. That's just not how it works.

MrVauxs commented 3 days ago

todo: add https://www.npmjs.com/package/tailwindcss-scoped-preflight?activeTab=readme