W3C home > Mailing lists > Public > www-style@w3.org > January 2012

RE: @import -- allow at any place in stylesheet.

From: Sylvain Galineau <sylvaing@microsoft.com>
Date: Wed, 18 Jan 2012 02:01:16 +0000
To: Ambrose LI <ambrose.li@gmail.com>
CC: Marat Tanalin | tanalin.com <mtanalin@yandex.ru>, Tab Atkins Jr. <jackalmage@gmail.com>, "www-style@w3.org" <www-style@w3.org>
Message-ID: <3C4041FF83E1E04A986B6DC50F01782903401F27@TK5EX14MBXC296.redmond.corp.microsoft.com>

[Ambrose LI:]
> 2012/1/17 Sylvain Galineau <sylvaing@microsoft.com>:
> > In terms of feature design, it is compatible with the import feature
> > of many languages that require imports to be first (Java comes to
> > mind). It thus at least aligns with the mental model and habits of
> > many developers. Honoring the principle of least surprise is often
> > helpful. As such Ambrose's point about this restriction making the
> > language more complicated should maybe be qualified with: for whom?
> > And even if lifting the restriction made the language harder, it's also
> possible it will result in apps that are much harder to understand and
> work with.
> Quick comment:
> Regarding the "for whom" question, that would be for people coming from a
> different background than Java: For myself, that would be Perl, PHP, C,
> and maybe other things (I was never good at Java). The principle of least
> surprise goes both ways: For some people the current behaviour has the
> least surprise; for me (and apparently
> others) this is a Really Big Surprise.

Oh, no doubt it can be.

> But at the core I don't think "at the top" or "anywhere" is the real
> problem here. The problem (for people writing style sheets, not for
> implementors) is that if your @import is not at the top, it is SILENTLY
> ignored, and the important thing is the "silently". I would not have spent
> hours debugging my style sheet if the browser loudly complained that an
> @import has been ignored because it's not at the top.
So what's the fix? How do you make the failure non-silent?
Received on Wednesday, 18 January 2012 02:01:49 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:10 UTC