postcss-custom-properties icon indicating copy to clipboard operation
postcss-custom-properties copied to clipboard

Plugin is removing comments after properties.

Open Psoz opened this issue 6 years ago • 1 comments

I'm having an issue related to comments that are deleted when those are typed right after the property.

In my case, I need to use comments in order to use some RTLCSS features.

:root {
    --spaceM: 1.5rem;
}

.title {
      left: calc(var(--gutter-M) * -1) /*rtl:ignore*/;
      font-size:16px/*rtl:14px*/;
}

Expected Output:

.title {
      left: calc(1.5rem * -1) /*rtl:ignore*/;
      font-size:16px/*rtl:14px*/;
}

Actual Output:

.title {
      left: calc(1.5rem * -1);
      font-size:16px/*rtl:14px*/;
}

Related issue: https://github.com/postcss/postcss-custom-properties/issues/86 Related Test: https://github.com/jonathantneal/postcss-tests/tree/master/postcss-custom-properties-test-00

Thanks for your amazing work with this awesome plugin.

Thanks in advance ;)

Psoz avatar Jul 03 '19 16:07 Psoz

Comments are tricky business, as there is no explicit direction within the CSS specifications on how they should be meaningfully tokenized.

However, I am testing a solution that give you what you need. Hopefully, the test will be conservative enough to protect the efficiency of the plugin.

jonathantneal avatar Jul 15 '19 13:07 jonathantneal