postcss-modules icon indicating copy to clipboard operation
postcss-modules copied to clipboard

Multiline comment in :global Sass declaration compiles incorrectly

Open reintroducing opened this issue 3 years ago • 5 comments

Given the following code:

:global {
  /*
   * Add the correct display in all browsers.
   */
  summary {
    display: list-item;
  }
}

Sass compiles this into:

:global {
  /*
    * Add the correct display in all browsers.
    */
}
:global summary {
  display: list-item;
}

postcss + postcss-modules compiles it to:

{
  /*
    * Add the correct display in all browsers.
    */
}
summary {
  display: list-item;
}

Reproduction here: https://stackblitz.com/edit/node-2pmbyx?file=sass.js,postcss.js

Original Vite bug where this was found: https://github.com/vitejs/vite/issues/8480

reintroducing avatar Jun 07 '22 15:06 reintroducing

any news?

ccqgithub avatar Jul 28 '22 12:07 ccqgithub

same issue + 1

lake2 avatar Aug 07 '22 02:08 lake2

same + 1

donghoon-song avatar Jan 25 '23 06:01 donghoon-song

same + 1

gaeundev avatar Aug 10 '23 06:08 gaeundev

Had the same warning and didn't like having it. Workaround to keep comments and not get a warning, found this to be working for me:

html :global {
   /*...*/
}

MatissAndersons avatar Feb 11 '24 11:02 MatissAndersons