W3C home > Mailing lists > Public > www-style@w3.org > October 2010

Re: practicality of user styleshseets

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Thu, 14 Oct 2010 10:51:42 -0700
Message-ID: <AANLkTimgrmn3i1-O-xOtn1XQ8HUEtrrvwzB04oz341fH@mail.gmail.com>
To: Felix Miata <mrmazda@earthlink.net>
Cc: www-style@w3.org
On Wed, Oct 13, 2010 at 7:34 PM, Felix Miata <mrmazda@earthlink.net> wrote:
> Problem 1-CSS file compaction:
> This is the stripping of all forms of unnecessary whitespace, including
> newlines, from CSS files in order to minimize server load and maximize
> download speed. The use of this technique seems to be rapidly spreading.

As others have said, this is perfectly valid.  There's no real reason
to disallow it; cutting out roughly three characters per line (given
my standard style, it would remove the tab before each property, the
space between the colon and the first value, and the newline) gives a
relatively impressive size reduction.

The proportional size reduction should be roughly the same whether
you're properly using inheritance or just targetting everything by
#id.

> It causes tools like Mozilla's Dom Inspector to show every rule on one line,
> a major impediment for any user attempting to isolate an offending rule that
> needs a compensating !important override. Even when viewed in an editor or
> viewer that wraps the long line, the lack of whitespace makes navigating and
> understanding the rulesets difficult.

A tool with this behavior is broken.  File a bug against Mozilla to
fix it.  We don't add features (or conformance rules) to get around
bugs unless the web depends on that bug (thus turning it into a
"feature").

> Problem 2-ID and class proliferation:
> This should be self-explanatory. Authors don't seem to understand how to let
> inheritance do its job, preferring to apply at least one class and/or ID for
> virtually every element type and/or context.
>
> The more classes and IDs authors use, the greater the difficulty isolating
> those that actually cause offense to the user, and the greater the time
> required to build compensating overrides. At the same time, generic user
> styles are all but useless.
>
> One solution might be to increase priority of instances of !important among
> user styles so that each and every use of it takes precedence if in any way
> applicable no matter how high the specificity is in author styles. I can't
> think of any other way to deal with this other than user agents providing
> options to completely disregard classes without disregarding CSS entirely.

The spec mandates that an !important user style should be honored no
matter what the specificity of the author style is.  The source of the
rule (browser, author, user, @style, !important or not) is considered
before specificity comes into play.

~TJ
Received on Thursday, 14 October 2010 17:52:29 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:32 GMT