shadycss icon indicating copy to clipboard operation
shadycss copied to clipboard

Issues with mixins having `!important` properties when using native custom properties.

Open TimvdLippe opened this issue 8 years ago • 2 comments

From @blasten on June 9, 2016 0:1

Say I have:

:host {
  --a: 10px;
  --b: {
    width: var(--a) !important;
  };
}
div {
  @apply(--b);
}

Expected Results

The mixin transformer to native custom properties should preserve the !important property

div {
  width: var(--b_-_width) !important;
}

Actual Results

The mixin transformer to native custom properties generates the following rule (moreless):

div {
  width: var(--b_-_width); /* No !important */
}

Browsers Affected

All browsers that support this setup.

Versions

  • Polymer: master branch and useNativeCSSProperties: true

Copied from original issue: Polymer/polymer#3700

TimvdLippe avatar Feb 11 '18 15:02 TimvdLippe

Wow, this turned out to be a critical issue for me in current project, will try to fix it

nazar-pc avatar Mar 20 '18 05:03 nazar-pc

I've fixed this in #171, hope for quick review and merge into next patch version

nazar-pc avatar Mar 20 '18 06:03 nazar-pc