W3C home > Mailing lists > Public > www-style@w3.org > February 2013

Re: [css-variables] Empty variable values?

From: Andrew Fedoniouk <news@terrainformatica.com>
Date: Sat, 9 Feb 2013 10:02:25 -0800
Message-ID: <CALRQH78rVmRkXgweb8EX+9xVkQ9Rg6ce1foyLRbMc0HO_1pk8w@mail.gmail.com>
To: Garrett Smith <dhtmlkitchen@gmail.com>
Cc: "Tab Atkins Jr." <jackalmage@gmail.com>, François REMY <francois.remy.dev@outlook.com>, www-style list <www-style@w3.org>
On Sat, Feb 9, 2013 at 9:52 AM, Garrett Smith <dhtmlkitchen@gmail.com>wrote:

> The most common way to unset existing property values on a CSSRule, in
> JS is to set them to have the empty string. What kind of situation do
> you want to unset a variable in CSS? And in that situation, why can't
> you set it to the empty string?

In fact JavaScript way of doing this is very bad.

Consider this:
  div::before { content: ""; }

Empty string is valid value of the content so you cannot assign empty
string to nullify/undefine that property

JavaScript shall use on of these constructs:
  el.style.prop = null;
  el.style.prop = undefined;

Andrew Fedoniouk.

Received on Saturday, 9 February 2013 18:02:52 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:08 UTC