C
C
copal2016-06-14 16:05:12
JavaScript
copal, 2016-06-14 16:05:12

How to translate inline styles into a file?

I divide one large scene into small ones and save it in .svg , I
get files with svg tags in which tags are embedded in which css is written.
I need to put this css in a separate file. It takes five minutes to write a plug-in for gulp that will do this, but the difficulty is that I will rename these classes, and for this I need to complicate the parser several times. And another difficulty is that .clss_0 in one file is not the same .clss_0 in another. and this also inclines into the analysis of the css itself, which is not at all simple.
And after thinking, the idea came to mind that it is possible to do styles in svg inline and it would be great if there was a plugin that could collect styles from attributes. Has anyone heard of this? Or perhaps there are other solutions?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Ukolov, 2016-06-14
@copal

posthtml-collect-inline-styles

M
mgreen, 2016-06-14
@mgreen

or you can put svg in shadow dom, then style conflicts are not terrible

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question