Re: [svgwg] SVG2 spec means elements within a <use> tag can not be targeted for styling (#367)

@dirkschulze I've now mostly digested this doc: https://www.w3.org/TR/css-scoping-1/#selectors4 and my concerns regarding the ability to cross the boundary of the shadow DOM with CSS in both directions is well addressed through the additional selectors.  If I'm understanding the IRC log, <use> will continue to be an exception to this approach.  Is there some documentation/discussion available that I can read that would help me get up to speed on why that was chosen as the preferred approach?

I believe we're back to this issue above...

"The workaround is a painful way to work. Now, for every attribute you might want to style (= number of SVG sub-elements S x number of styled properties P), you need to create a variable in your template. For all but the most trivial examples, S and P grow very large very quickly."

Essentially, under the SVG 2 approach, <use> becomes prohibitively difficult to use unless a) you are replicating an SVG element with no intention of independently styling the clones or b) you are replicating an SVG object with a trival amount of pre-designed styling built into the structure of the cloned object using the above work-around.

For complex SVG where an illustrator is exporting from Illustrator and where a game or graphic designer is styling this and customizing many aspects of the clones individually, I think the process would become prohibitively complex for all but the most trivial cases.

As a developer I would end up torn between wanting to use the new selectors for styling anything across the shadow DOM boundary and wanting to take advantage of <use> to avoid repeating large amounts of SVG.  The case where you really need <use> is when the cloned object is complex (that is, has many subelements that might need to be styled), and that's precisely where the work-around is prohibitively onerous.

-- 
GitHub Notification of comment by markofca
Please view or discuss this issue at https://github.com/w3c/svgwg/issues/367#issuecomment-533488276 using your GitHub account

Received on Friday, 20 September 2019 09:50:28 UTC