W3C home > Mailing lists > Public > www-style@w3.org > April 2014

Re: CSS variable syntax

From: Matthew Robb <matthewwrobb@gmail.com>
Date: Thu, 3 Apr 2014 13:42:48 -0700
Message-ID: <CAAngBgj7ee6HOu0frr+gXrUJy_wi=C18wETDCS=oqXwdj1r3yA@mail.gmail.com>
To: Ron van den Boogaard <ron@ronvdb.com>
Cc: Chris Eppstein <chris@eppsteins.net>, www-style list <www-style@w3.org>, "Jens O. Meiert" <jens@meiert.com>, Simon Sapin <simon.sapin@exyr.org>, Marat Tanalin <mtanalin@yandex.ru>, "Tab Atkins Jr." <jackalmage@gmail.com>, Mark Volkmann <r.mark.volkmann@gmail.com>
Will I be able to reference non custom properties with var()?

var(background-color)

Cause this would be amazing and more consistent.
On Apr 3, 2014 12:55 PM, "Ron van den Boogaard" <ron@ronvdb.com> wrote:

> As an author I'd rather have the prefix than the nesting.
> One missed curly bracket might break part of the css.
> Whereas a prefix keeps it much more recognizable and maintainable.
> Ron van den Boogaard
>
> Ronald
>
> P Before printing, think about the environment
>
> On 3 apr. 2014, at 21:23, Marat Tanalin <mtanalin@yandex.ru> wrote:
>
> > 03.04.2014, 20:33, "Tab Atkins Jr." <jackalmage@gmail.com>:
> >> On Thu, Apr 3, 2014 at 9:11 AM, Mark Volkmann <
> r.mark.volkmann@gmail.com> wrote:
> >>
> >>>  I'm not familiar with what @ is being used for. Why couldn't
> variables start
> >>>  with @?
> >>
> >> @ is for at-rules.  CSS Syntax already allows at-rules inside of style
> >> rules (none are defined yet, but it's available when we extend into
> >> that realm, which we will definitely do)
> >
> > If at-rules are allowed inside of style rules, then it's maybe time to
> reconsider defining variables (custom props now) via a nested at-rule:
> >
> >    .example {
> >        @var {
> >            foo: #fff;
> >            bar: #000;
> >        }
> >
> >        background: var(foo);
> >        color: var(bar);
> >    }
> >
> > So any prefix like `--` is unneeded at all while variables are clearly
> separated from regular properties.
> >
> > As a nice side effect, global (root-level) variables could be defined
> without need to nest them in redundant style rule with `:root` selector.
> >
> >
>
>
>
Received on Thursday, 3 April 2014 20:43:16 UTC

This archive was generated by hypermail 2.4.0 : Monday, 23 January 2023 02:14:39 UTC