A partial archive of discourse.wicg.io as of Saturday February 24, 2024.

Style sheet subclasses with different properties, for different types of elements


The web is growing, and so are the number of properties and property values found in a style sheet.

  • Style sheets have 3D transforms, which don’t apply to SVGElements.
  • Style sheets have stroke, which don’t apply to HTMLElements.
  • Etc.

Instead of adding new functionality into a single class of stylesheet for all Elements, maybe it would be better to have subclasses of stylesheets for use by different types of elements including custom elements.

This way, when we look at computed styles for an SVGElement we won’t see unrelated stuff for HTMLElements, etc.

Suppose later the web gains Elements for defining 3D GL scenes, HTML3DElements or something. It will get messy to just add more CSS properties into a single class of sheet.


I find CSS * SVG to be really frustrating, and agree there’s a better way.

Personally, I think the web needs a standardized content editor that handles all types of content. Essentially a WYSIWYG, that’s actually “WYSIWYG”, and handles layouts, CSS, SVG, etc.

It needs to have version control built in. It needs to be customizable (like in Photoshop, you can adjust your toolbars). It needs to be extendable (so I could write my own “pen tool”).

That’s a big challenge, no doubt. But how much time would be saved (collectively) if we could just design in-browser, and not have to worry about vendor prefixes, or CSS preprocessors, or SVG vs HTML properties…

Shouldn’t content creation be fast, easy, fun?

Not only would this be the greatest thing the internet has ever seen, but the quality of content (from email, to wikipedia, to every website) would skyrocket. And, if someone figured out how to do it, they might be able to make a lot of money. How much could you make if you had the best content platform in the world?


Well, to put it in perspective, Canva is valued at $1 billion, and let’s put it this way: Canva is probably nowhere near the most-awesome type of creation studio that you’d imagine…

But anyway, that wasn’t the topic of this thread, although I can’t help but like to discuss anything that can make the web better! :slight_smile: