Re: [css-variables] Empty variable values?

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.

http://terrainformatica.com

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