nDmitry / grunt-autoprefixer

Parse CSS and add vendor-prefixed CSS properties using the Can I Use database. Based on Autoprefixer.
MIT License
795 stars 60 forks source link

Comments get filtered out #38

Closed fragje closed 10 years ago

fragje commented 10 years ago

I'm using grunt-autoprefixer with kss-node, and are using some specific comment syntax to make it work. When I use kss-node class {$modifiers} grunt-autoprefixer filters this out. Tested autoprefixer sublime plugin, but did not have any problem then.

Css before autoprefixer:

/*
Buttons

Markup:
<a href="#0" class="{$modifiers}">Link Button</a>
<button class="{$modifiers}">Button Element</button>
<input type="button" class="btn {$modifiers}" value="Input Element"/>

.btn               - Default button style
.btn-cta           - Call to action buttons
.btn-neutral       - Neutral button
.btn-text          - Link button

Styleguide 1.6.1
*/
/* line 17, ../../../_sass/partials/atoms/_buttons.scss */
.btn, .btn-cta, .btn-neutral, .btn-text {
  color: white;
  background-color: dodgerblue;
  display: inline-block;

Css after grunt-autoprefixer:

/* line 17, ../../../_sass/partials/atoms/_buttons.scss */

.btn,
.btn-cta,
.btn-neutral,
.btn-text {
  color: white;
  background-color: dodgerblue;
  display: inline-block;
nDmitry commented 10 years ago

Sorry for the delay.

I can't reproduce the issue. Are you sure you're using the last version of autoprefixer and nothing else process this code? Because selectors should retain their formatting. Here is my output:

/*
Buttons

Markup:
<a href="#0" class="{$modifiers}">Link Button</a>
<button class="{$modifiers}">Button Element</button>
<input type="button" class="btn {$modifiers}" value="Input Element"/>

.btn               - Default button style
.btn-cta           - Call to action buttons
.btn-neutral       - Neutral button
.btn-text          - Link button

Styleguide 1.6.1
*/
/* line 17, ../../../_sass/partials/atoms/_buttons.scss */
.btn, .btn-cta, .btn-neutral, .btn-text {
  color: white;
  background-color: dodgerblue;
  display: inline-block;
}

Exactly what it was.

fragje commented 10 years ago

Oh, how could I overlook the version number. It worked perfectly after upgrading to latest version (0.7.2). Thanks for a great project!