Re: [csswg-drafts] [css-cascade] Additive CSS

Since custom properties cannot be set with references to their own cascaded value, except in quite round about ways...
```html
<style>
  body {
    --mag: 0em; /* initial value */
    --plus: 1em;
    --current: var(--mag);
  }
  span {
    --current: calc(var(--mag) + var(--plus));
  }
  div {
    --mag: var(--current);
    property: var(--current);
  }
</style>
<body>
  <div>
    <span>
      <div>
        <span>
          <div>
            <span>
              <div>
              </div>
            </span>
          </div>
        </span>
      </div>
    </span>
  </div>
</body>
```
I hope whatever solution is found for "additive" does away with this mess, since we are missing things like shorthand assignment operators (`+=`/`-=`/`*=`/etc) offered in javascript.

-- 
GitHub Notification of comment by jonjohnjohnson
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1594#issuecomment-380658795 using your GitHub account

Received on Thursday, 12 April 2018 02:51:48 UTC