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

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

From: Ambrose LI <ambrose.li@gmail.com>
Date: Tue, 17 Jan 2012 20:56:53 -0500
Message-ID: <CADJvFOXunGLWK4=AR2hh6GmRnwauei-VBtJhPGz7iCsMfw9oow@mail.gmail.com>
To: Sylvain Galineau <sylvaing@microsoft.com>
Cc: "Marat Tanalin | tanalin.com" <mtanalin@yandex.ru>, "Tab Atkins Jr." <jackalmage@gmail.com>, "www-style@w3.org" <www-style@w3.org>
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.

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

Received on Wednesday, 18 January 2012 01:57:28 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:38:54 UTC