I have problems with inline styles in a SVG file, where Inkscape won't remove the inline styles (fill, stroke and more) via neither "XML Editor (Shift+Control+X)" nor the "Fill and Stroke (Shift+Ctrl+F)" palette.
In the "Fill and Stroke" palette, when I select "No paint" or "Unset paint", I expected it to remove all styles.
Obviously it doesn't happen.
So I tried the XML Editor and found and clicked on the svg:path in question. Clicked on "style" in the attributes-pane and clicked "Delete attribute". Unfortunately, it doesn't do anything.
I can overwrite the styles, but if I try to remove it entirely, It just doesn't want to.
Have anybody else experienced this and/or have any ideas?
I thought of editing the file with a text-editor, but I would rather not go through 200+ paths manually..
I also thought of using RegEx, but unfortunately I'm in a position, where I can't remove all styles for all paths, so I have to be able to select the paths.
Yours sincerely
Steen Nielsen
Can't remove inline styles on object
Re: Can't remove inline styles on object
Hi.
I can't see the problem.
By the fill and stroke panel, you can select the fill and stroke's colour attributes and set them to be "none" or delete them by setting those to be undefined.
Also with the xml editor: you select the style attribute line,
go to the bottom, delete the lines and click on set, and by that, all style attributes will be removed, even those unaffected by the fill and stroke panel.
To fasten the workflow with the 200+ paths, you may combine some of them together before removing the style attributes, then break them apart at the end.
Good luck!
I can't see the problem.
By the fill and stroke panel, you can select the fill and stroke's colour attributes and set them to be "none" or delete them by setting those to be undefined.
Also with the xml editor: you select the style attribute line,
go to the bottom, delete the lines and click on set, and by that, all style attributes will be removed, even those unaffected by the fill and stroke panel.
To fasten the workflow with the 200+ paths, you may combine some of them together before removing the style attributes, then break them apart at the end.
Good luck!
Re: Can't remove inline styles on object
Hi Lazur,
The problem was that even when I set them to undefined, they still had styling.
I later found out, that when I unset all styles from all elements, it didn't remove styles added via class/id CSS in. And AFAIK, you currently can't see CSS for an object in any of the normal panels.
I have made a feature request for making it a bit more transparent for the user, that external styles affects an object.
The problem was that even when I set them to undefined, they still had styling.
I later found out, that when I unset all styles from all elements, it didn't remove styles added via class/id CSS in
Code: Select all
<style type="text/css" />
I have made a feature request for making it a bit more transparent for the user, that external styles affects an object.
Re: Can't remove inline styles on object
Hello:
Here is more information about CSS style in Inkscape:
http://tavmjong.free.fr/INKSCAPE/MANUAL ... Style.html
Here is more information about CSS style in Inkscape:
http://tavmjong.free.fr/INKSCAPE/MANUAL ... Style.html
If you have problems:
1.- Post a sample (or samples) of your file please.
2.- Please check here:
http://tavmjong.free.fr/INKSCAPE/MANUAL/html/index.html
3.- If you manage to solve your problem, please post here your solution.
1.- Post a sample (or samples) of your file please.
2.- Please check here:
http://tavmjong.free.fr/INKSCAPE/MANUAL/html/index.html
3.- If you manage to solve your problem, please post here your solution.
Re: Can't remove inline styles on object
Hi hulf2012,
Okay, so it is still not fully developed
Very sad news, as it really is one of the big forces for SVG files that you can add the same styling to multiple objects via CSS.
I have now found out that if I, via the XML editor, try to remove the styles attribute on the elements, since I have the same styles added via a css-class.
It just recreates them.. Now that's annoying!
As far as I can see, it removes the inline styles, then it fetches the styling from the CSS-class and adds it to the object...
So the flexible css styles defined for the class are overridden with inline styles.
Does anybody have better ways to work with internal stylesheets, which works?
Okay, so it is still not fully developed
Very sad news, as it really is one of the big forces for SVG files that you can add the same styling to multiple objects via CSS.
I have now found out that if I, via the XML editor, try to remove the styles attribute on the elements, since I have the same styles added via a css-class.
It just recreates them.. Now that's annoying!
As far as I can see, it removes the inline styles, then it fetches the styling from the CSS-class and adds it to the object...
So the flexible css styles defined for the class are overridden with inline styles.
Does anybody have better ways to work with internal stylesheets, which works?
Re: Can't remove inline styles on object
Known issue:
In the comments of the report a custom extension is described which can be used to remove the 'style' attributes after content of the SVG file has been edited in Inkscape.
- Bug #167937 (sf1546444) “CSS class references being persisted in style attributes”
In the comments of the report a custom extension is described which can be used to remove the 'style' attributes after content of the SVG file has been edited in Inkscape.
Re: Can't remove inline styles on object
Thanks ~suv,
Wow, this bug have been known for more than 3 years
The mentioned extension looks useful, but it does give a little extra work, that shouldn't be necessary, if Inkscape was fixed
Too bad that I don't know anything about coding c++ or gtk..
Wow, this bug have been known for more than 3 years
The mentioned extension looks useful, but it does give a little extra work, that shouldn't be necessary, if Inkscape was fixed
Too bad that I don't know anything about coding c++ or gtk..