Can't remove inline styles on object

Post questions on how to use or achieve an effect in Inkscape.
SwineDK
Posts: 10
Joined: Thu Jan 16, 2014 12:56 am

Can't remove inline styles on object

Postby SwineDK » Thu Jan 16, 2014 11:58 pm

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

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Can't remove inline styles on object

Postby Lazur » Sun Jan 19, 2014 10:09 pm

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!

SwineDK
Posts: 10
Joined: Thu Jan 16, 2014 12:56 am

Re: Can't remove inline styles on object

Postby SwineDK » Mon Jan 20, 2014 9:31 pm

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

Code: Select all

<style type="text/css" />
. 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.

hulf2012
Posts: 716
Joined: Sat Nov 24, 2012 12:37 pm

Re: Can't remove inline styles on object

Postby hulf2012 » Tue Jan 21, 2014 12:06 am

Hello:

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.

SwineDK
Posts: 10
Joined: Thu Jan 16, 2014 12:56 am

Re: Can't remove inline styles on object

Postby SwineDK » Fri Feb 07, 2014 10:07 pm

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?

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: Can't remove inline styles on object

Postby ~suv » Sat Feb 08, 2014 8:16 am

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.

SwineDK
Posts: 10
Joined: Thu Jan 16, 2014 12:56 am

Re: Can't remove inline styles on object

Postby SwineDK » Mon Feb 10, 2014 7:10 pm

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.. :-D


Return to “Help with using Inkscape”