No External CSS File Support

Bug #167936 reported by Phidias
132
This bug affects 16 people
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Medium
Martin Owens
Declined for 0.91.x by Qantas94Heavy

Bug Description

When you make a reference to an external CSS file,
Inkscape ignores it. The only workaround is to embed
the stylesheet into your file -- which defeats the
purpose of having a stylesheet.

Revision history for this message
vonHalenbach (lustik) wrote :

Yes, this is true. CSS stylesheets are a part of the svg-standard. They should be supported by inkscape. Visio makes heavy use of them in its documents.

Changed in inkscape:
importance: Undecided → Medium
status: New → Confirmed
Ryan Lerch (ryanlerch)
Changed in inkscape:
importance: Medium → Wishlist
Revision history for this message
hash (hash-g) wrote : Re: External CSS support
hash (hash-g)
Changed in inkscape:
importance: Wishlist → Medium
Revision history for this message
Zearin (zearin) wrote : Re: CSS support

Support for this would be *all kinds* of cool.

I've made my first use of Launchpad's “bug affects me too” feature for this. :)

Revision history for this message
Bruno Winck (b722168) wrote :

After a couple of hours evaluating Inkscape I think it's a great solution. But this lack of support of xml-stylesheet is a problem for me.

What would it take in term of hours to fix it ?
Is there a way (different from doing it myself) to sponsor this feature ?

Sincerely,
-Bruno

Revision history for this message
Yoshiaki Araki (yoshiaki-araki) wrote :

Supporting external css is not a trivial issue.
Suppose that you change the style defined by the css on inkscape and save the svg.
What is your expected results?
There are two ways to solve this issue.

Let me know your thought.

1) css embedding
After saving, the following changes happen

external css file: keep as is
xml-stylesheet element : remove from the svg file
svg data: add a new "style" element and put the css data in the element

2) local css saving
After saving, the following changes happen

external css file: save with the change css data.
                                       the file path of the css is moved to relative from the svg file
                                       the file name of the css is renamed not to conflict with existing files.

xml-stylesheet element : change href location if needed
svg data: unchanged

if local directory is not writable or the css file is not writable, we need to take (1)css embedding.

Revision history for this message
Zearin (zearin) wrote :

I've always wanted to be able to use Inkscape's GUI to get a graphic or art piece 85% of the way finished, and then dive into the XML and use CSS classes to standardize, optimize, experiment in ways not possible with the UI, and allow myself to use CSS styles to define "base" styles that I can override on individual graphic elements to fine-tune them.

Oh that's a mouthful. But the point is this:

CSS support would unlock a completely different kind of creativity in Inkscape. CSS creativity lives in a totally different mindset and allows for totally different kinds of experimentation. It encourages centralized control, reuse, and (ultimately) simpler SVG code. If Inkscape provided good CSS support, it would also allow a tremendous user-base of web designers and developers to transfer their skillset to Inkscape with an absolute minimum of fuss.

In short, everyone would benefit from this. Everyone.

I'm not saying adding CSS support is a trivial challenge, but it is a worthy goal.

Revision history for this message
Bruno Winck (b722168) wrote :

I wrote this and have it on my disk for a while.
Not the abiity to edit the stylesheet but just have it and use it for display.
It's very convenient to standardize styles across several drawings.
i use it together with the ability to produce png files from command line to produce icons for themes.

I need to understand how to produce a patch. Any step by step help somewhere ?

-Bruno

Revision history for this message
Mark Fortner (phidias51) wrote :

My needs are fairly simple. I'd like to be able to put in a reference to an external CSS file in the SVG document (either through the XML editor, or through a dialog). If I update the CSS file, I would like to click on a Refresh button to update the image. Ultimately, it would be nice if Inkscape monitored all external file references for updates and automatically refreshed the displayed image whenever the styles changed, but this could be saved for later.

It's not necessary for Inkscape to provide a CSS editor, but this might also make a nice enhancement in the future.

Hope this helps,

Mark

Revision history for this message
Zearin (zearin) wrote :

+1 for Mark's comment ( https://bugs.launchpad.net/inkscape/+bug/167936/comments/8 ).

I would be totally happy editing the CSS is my own editor and clicking “Refresh” in Inkscape. Refinements can occur later, but even just this simple addition would feel like “one small step for Inkscape…one giant leap for Inkscape users!”

:D

Revision history for this message
Yoshiaki Araki (yoshiaki-araki) wrote :

Guys!
Why not submit your voice to "This bug affects you" of lauchpad on top of this page!

BTW, I surveyed other opensource project with the same issue.
Kompozer is one of open source HTML editor supporing external CSS file.
http://sourceforge.net/projects/kompozer/

Kompozer supports
- reading external css files.
- editing external css files if the file can be updated

Thus Kompozer partially supports "2) local css saving" of my #5 comment.

CSS editing function is provided as "CasCadeS" extension (built-in),
and its source can be found from here.
http://kompozer.svn.sourceforge.net/viewvc/kompozer/trunk/mozilla/extensions/editor/cascades/resources/content/

Hope this help.

Revision history for this message
Zearin (zearin) wrote :

Hello again in 2011, everyone!

How about a New Year’s Resolution for improving Inkscape’s CSS support? 0;-)

Revision history for this message
Bruno Winck (b722168) wrote :

This I wish also.
Do you want to see how much you can do with this patch.
Fully unprepared, unclean, unverified.
The worst patch of 2011 I am ashamed.
My first one.
But if I postpone for any reason Inkscape will be release 1.0 before I update.

Happy new year !

contact me at bw jhjkhkhkh at jkjhjhj kneaver.com if you need help.

Revision history for this message
su_v (suv-lp) wrote :

@Bruno - thank you for working on this issue and sharing a patch. Unfortunately the patch fails to apply to current trunk (tested against r10009) - you seemed to have worked with a checkout (revision 22800) from the SVN repository which was no longer updated after the release of 0.47: in December 2009 Inkscape moved the source code repository from sf.net to Launchpad, and from SVN to using bazaar [1], [2].

You can find more information about working with bazaar in the developer documentation in the wiki [3].

Some details about what the patch implements (and how it is supposed to work) would help with triage and testing on different platforms, too.

[1] <http://inkscape.org/archive.php?lang=en&year=2009&month=12>
[2] <http://inkscape.org/bzr.php>
[3] <http://wiki.inkscape.org/wiki/index.php/Working_with_Bazaar>

Revision history for this message
Bruno Winck (b722168) wrote :

@~suv
I know but this is what stopped me working on Inkscape.I have an svn checkout with Tortoisesvn and my changes on it. I don't know how to switch to Bazaar and maintain my changes. So for the time being my changes are as supplied until I have time to fix this bazaar issue.
The patch is provided so that someone else more capable than me on bazaar can help.

Revision history for this message
su_v (suv-lp) wrote :

@Bruno - I'd recommend you to subscribe to the mailing list 'inkscape-devel' [1] and ask for support or tips for upgrading your patch to the current trunk version. Providing some information about the platform you are working on, and what tools you are familiar with might be helpful.

[1] <http://inkscape.org/mailing_lists.php>

Revision history for this message
Bruno Winck (b722168) wrote :

@~suv
I make it short: I will not have the time.
This is why i post my work so that may be someone else can reuse what I did.
If and when i have time i will be glad to follow your advice but this could very well be in 2012.
This issue is 4 years old, the patch fixed it in 0.47.

Revision history for this message
Martin Owens (doctormo) wrote :

This attached patch is not complete, it's missing at least document->addStyleFragment and document->checkPIforStyles and probably more that we can't see. There's also a lot of unnecessary build changes which don't relate to css support.

The feature will have to be rebuilt from scratch.

Revision history for this message
Bruno Winck (b722168) wrote :

Hi Martin,

This was quite old. I'm willing to take a look at the issue as part of the collective effort.

Didn't use Inkscape recently so you confirm the bug is still open, this is important.

Point me to any guidelines for developing on inkscape since i'll start from zero again.

Revision history for this message
Martin Owens (doctormo) wrote :

Hey Bruno,

Yes, I'll be looking at this feature too. I'd be interested in taking a look at your developer process to see if we can get your environment clicking in place with mine and the rest of the community. The easiest way for you to post changes is patch files, but you'd have to be working with the latest trunk version. If you need me to put the codebase into a zip file for you, let me know.

Revision history for this message
Bruno Winck (b722168) wrote : RE: [Bug 167936] Re: CSS support {Spam?}

Hi Martin,

I got the codebase 12917 and with my habit of keeping backups of everything I still have a full copy of my changes of 2009.

I'm currently merging my changes while taking into account current code. I mostly encounter objectification of c code.

It's true the patch you found was incorrect, I checked as well. A new file was missing. I will not create this new file this time = KISS.

Yes some guidance on coding style will be welcome. As soon as I have something working I'll submit a patch for your review.

I'm in South India now, GMT+5.30 and limited bandwidth.

-Bruno

Bruno Winck
Email: <email address hidden>
Blog: http://www.kneaver.com/blog

Kneaver Corp http://www.kneaver.com/
Twitter:http://twitter.com/kneaver
PH: +(415) 335-6932

-----Original Message-----
From: <email address hidden> [mailto:<email address hidden>] On Behalf Of Martin Owens
Sent: Monday, January 13, 2014 11:49 AM
To: <email address hidden>
Subject: [Bug 167936] Re: CSS support

Hey Bruno,

Yes, I'll be looking at this feature too. I'd be interested in taking a look at your developer process to see if we can get your environment clicking in place with mine and the rest of the community. The easiest way for you to post changes is patch files, but you'd have to be working with the latest trunk version. If you need me to put the codebase into a zip file for you, let me know.

--
You received this bug notification because you are subscribed to the bug report.
https://bugs.launchpad.net/bugs/167936

Title:
  CSS support

Status in Inkscape: A Vector Drawing Tool:
  Confirmed

Bug description:
  When you make a reference to an external CSS file,
  Inkscape ignores it. The only workaround is to embed
  the stylesheet into your file -- which defeats the
  purpose of having a stylesheet.

To manage notifications about this bug go to:
https://bugs.launchpad.net/inkscape/+bug/167936/+subscriptions

Revision history for this message
Martin Owens (doctormo) wrote : Re: CSS support

Bruno has kindly sent to me via email all reinvent code that he developed. When I get to this bug I will use it as a base to craft the right fix.

Changed in inkscape:
assignee: nobody → Martin Owens (doctormo)
summary: - CSS support
+ No External CSS File Support
Revision history for this message
Martin Owens (doctormo) wrote :
Revision history for this message
Tavmjong Bah (tavmjong-free) wrote :

Support for reading external style sheets via the @import rule added to Inkscape trunk in commit ccfaafdc59f88d185fe5cd5c3a83bf6364c361a5

Revision history for this message
grey tomorrow (gtomorrow) wrote :

Closing because FIX RELEASED.

If you feel this issue has been injustly closed, please feel free to open a new issue at http://inkscape.org/report . Thank you.

Closed by: https://gitlab.com/greytomorrow

tags: added: bug-migration
Changed in inkscape:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.