Re: [Imports]: Styleshet cascading order clarification
- Original Message - From: Tab Atkins Jr. jackalm...@gmail.com To: Gabor Krizsanits gkrizsan...@mozilla.com Cc: Hajime Morrita morr...@google.com, public-webapps public-webapps@w3.org Sent: Monday, November 3, 2014 7:12:27 PM Subject: Re: [Imports]: Styleshet cascading order clarification On Mon, Nov 3, 2014 at 7:28 AM, Gabor Krizsanits gkrizsan...@mozilla.com wrote: During our last meeting we all seemed to agree on that defining/implementing order for style-sheets is imports is super hard (if possible) and will bring more pain than it's worth for the web (aka. let's not make an already over-complicated system twice as complicated for very little benefits). And the consensus was that we should just not allow global styles in imports. Some months has passed but I still don't see any update on the spec. in this regard, so I'm just double checking that we still planning to do this or if anything changed since then. Out of curiosity, why is it hard? Without much background in the implementation matters, it doesn't seem that a link rel=import that contains a link rel=stylesheet should be any different than a link rel=stylesheet that contains an @import rule. ~TJ See my comments here: https://www.w3.org/Bugs/Public/show_bug.cgi?id=24756 I think the difference is the de-duping mechanism in HTML imports. Importing the same import from multiple places in the import graph can change the import order hence the underlying style-sheet order too. So just because link import A is before link import B in the document does not necessary say anything about the order of their stylesheet... My concern is that in complex projects it will be even harder to track down css related issues, given that adding an extra link to the import tree can significantly change the order of the imports. The other concern is performance related. We will have to rearrange the rules all the time the import graph changes during the import parsing. But one could argue that it's just an implementation detail... Then again, maybe all these issues can be outweighed by some important use cases... - Gabor
[Imports]: Styleshet cascading order clarification
During our last meeting we all seemed to agree on that defining/implementing order for style-sheets is imports is super hard (if possible) and will bring more pain than it's worth for the web (aka. let's not make an already over-complicated system twice as complicated for very little benefits). And the consensus was that we should just not allow global styles in imports. Some months has passed but I still don't see any update on the spec. in this regard, so I'm just double checking that we still planning to do this or if anything changed since then. - Gabor
Re: [Imports]: Styleshet cascading order clarification
On Mon, Nov 3, 2014 at 7:28 AM, Gabor Krizsanits gkrizsan...@mozilla.com wrote: During our last meeting we all seemed to agree on that defining/implementing order for style-sheets is imports is super hard (if possible) and will bring more pain than it's worth for the web (aka. let's not make an already over-complicated system twice as complicated for very little benefits). And the consensus was that we should just not allow global styles in imports. Some months has passed but I still don't see any update on the spec. in this regard, so I'm just double checking that we still planning to do this or if anything changed since then. Out of curiosity, why is it hard? Without much background in the implementation matters, it doesn't seem that a link rel=import that contains a link rel=stylesheet should be any different than a link rel=stylesheet that contains an @import rule. ~TJ
Re: [Imports]: Styleshet cascading order clarification
I know this is probably the wrong place/time to say this, but fwiw, a primary use case for imports is replacing: script src=my-lib/my-lib.js/script !-- the script above might have some HTML in it, encoded as a string, comment, or other hack -- !-- the script above may load additional dependencies via some elaborate loader -- link rel=stylesheet href=my-lib/my-lib.css with link rel=import href=my-lib/my-lib.html !-- html and transitive loading all taken care of by imports -- Having the imported stylesheets apply to the main document is a big part of the value here. If the stylesheets are for some other purpose, it's easy to put them in a template, but the reverse is not true. I realize implementation difficulty may trump ergonomics, but I wanted to make sure this part was heard. Scott On Mon, Nov 3, 2014 at 10:12 AM, Tab Atkins Jr. jackalm...@gmail.com wrote: On Mon, Nov 3, 2014 at 7:28 AM, Gabor Krizsanits gkrizsan...@mozilla.com wrote: During our last meeting we all seemed to agree on that defining/implementing order for style-sheets is imports is super hard (if possible) and will bring more pain than it's worth for the web (aka. let's not make an already over-complicated system twice as complicated for very little benefits). And the consensus was that we should just not allow global styles in imports. Some months has passed but I still don't see any update on the spec. in this regard, so I'm just double checking that we still planning to do this or if anything changed since then. Out of curiosity, why is it hard? Without much background in the implementation matters, it doesn't seem that a link rel=import that contains a link rel=stylesheet should be any different than a link rel=stylesheet that contains an @import rule. ~TJ