Hello,
I have a drawing that is full of rectangles which share common attributes. Inkscape puts a style="..." attribute into each rectangle's tag, but it's the same thing repeated over and over. Is it possible to replace these style attributes with class attributes that refer to some style defined in an (inline) CSS? Essentially like CSS and HTML.
I don't mind inserting the CSS manually into the SVG file with a text editor; my question is: Will Inkscape support/honor the CSS, and what's the syntax to put a CSS into an SVG file?
Well, I guess I could just go and try it out, but I'd like to know if there is a proper and accepted way to do it.
Thanks,
--D.
On Fri, 20 Jul 2007 10:03:38 +0200 Dan H <dunno@...649...> wrote:
I don't mind inserting the CSS manually into the SVG file with a text editor; my question is: Will Inkscape support/honor the CSS, and what's the syntax to put a CSS into an SVG file?
So I've tried it, and it sort of works: IS honors my manually embedded stylesheet, but on saving the document it again adds its own style=".." attribute to the objects, completely masking the CSS properties.
Is there a way to avoid this, or has it changed in later versions? I'm using v. 0.44.1
--D.
On 7/20/07, Dan H <dunno@...649...> wrote:
Is there a way to avoid this, or has it changed in later versions? I'm using v. 0.44.1
No unfortunately, Inkscape only has read-only support for CSS stylesheets and converts them to style attributes on save. This area definitely needs more work.
On Friday, July 20, 2007, 5:50:19 PM, bulia wrote:
bb> On 7/20/07, Dan H <dunno@...649...> wrote:
Is there a way to avoid this, or has it changed in later versions? I'm using v. 0.44.1
bb> No unfortunately, Inkscape only has read-only support for CSS bb> stylesheets and converts them to style attributes on save. This area bb> definitely needs more work.
A rapid way to avoid the inconvenience experienced by Dan would be to add an option for saving as presentation attributes instead of the style attribute.
In other words, an option to write
fill="red" stroke="none" font-family="vera"
instead of
style="fill:red; stroke:none; font-family:vera"
This would allow any style sheets to have an effect. Its also what is needed for mobile SVG.
participants (3)
-
bulia byak
-
Chris Lilley
-
Dan H