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

Re: CSS Hierarchies + @media queries

From: L. David Baron <dbaron@dbaron.org>
Date: Wed, 29 Feb 2012 16:35:36 -0800
To: www-style@w3.org
Message-ID: <20120301003536.GA7987@pickering.dbaron.org>
On Wednesday 2012-02-29 15:42 -0800, Chris Eppstein wrote:
> I was reading through http://dev.w3.org/csswg/css3-hierarchies/ and noticed
> that there was no provision for nesting an @media directive inside a
> hierarchical selector context.
> 
> In Sass we let @media be nested in any selector and then "bubble" that
> @media query to the top level.
> 
> For example:
> 
> .context {
>   & .module {
>     float: left;
>     width: 50%;
>     @media all and (max-device-width: 500px) {
>       float: none;
>       width: auto;
>     }
>   }
>   & p {
>     color: #333;
>   }
> }

Just because we could have another way to write something doesn't
mean we should.  We risk turning the language into perl, i.e., into
a language where there are ten ways to express the same thing and
thus nobody can read what anybody else writes.

I think it's a lot of extra work to implement and it doesn't look
like it adds much value.

-David

-- 
𝄞   L. David Baron                         http://dbaron.org/   𝄂
𝄢   Mozilla                           http://www.mozilla.org/   𝄂
Received on Thursday, 1 March 2012 00:36:00 GMT

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