stylish-elephants icon indicating copy to clipboard operation
stylish-elephants copied to clipboard

Introduce namespacing to avoid collisions with other CSS on the page?

Open mfeineis opened this issue 6 years ago • 1 comments

I've just been fiddling around with stylish-elephants and one thing I noticed is that the created styles would easily collide with foreign CSS on the page. It'd get even worse if you'd have two separate Elm apps on the same page using different versions of stylish-elephants. Maybe it'd be a good idea to namespace the CSS classes to prevent collisions. First thought that comes to mind would be using the hash of the library version - maybe using some magic salt value to denote the library that created them - as a prefix/postfix. That way using two apps with the same library version would just work and the hashes would make reasonably sure that hand-written CSS wouldn't get in the way.

mfeineis avatar Mar 04 '18 14:03 mfeineis

It could be an option to layoutWith.

kuon avatar Mar 08 '18 14:03 kuon