Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breaks @applyable Custom Properties #752

Closed
HughxDev opened this issue Jul 29, 2018 · 2 comments
Closed

Breaks @applyable Custom Properties #752

HughxDev opened this issue Jul 29, 2018 · 2 comments

Comments

@HughxDev
Copy link

Do you want to request a feature or report a bug?
Report a bug

What is the current behavior?
CSS Custom Properties (i.e. variables) which specify nested properties (i.e. mixins) for use with @apply, get escaped on output, which prevents use.

If the current behavior is a bug, please provide the steps to reproduce.
Given this input:

:root {
  --title-align: center;
  --sr-only: {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    clip-path: inset(50%);
    border: 0;
  };
}

…CSS Loader produces this output:

:root {
  --title-align: center;
\--sr-only: {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    clip-path: inset(50%);
    border: 0;
};
}

What is the expected behavior?
--sr-only should not be prefaced with a backslash on output.

Please mention other relevant information such as your webpack version, Node.js version and Operating System.

  • CSS Loader 1.0.0
  • Webpack v4.16.2
  • Node v10.7.0
  • macOS Sierra 10.12.6

Note that the @apply spec has been abandoned and will likely be replaced with the ::part()/::theme() specs. However the latter are still in-development and aren’t ready to be used. In the meantime, there’s a polyfill for @apply from the Polymer team, so I’m using that instead, but it can’t pick up on the mixin definition with a backslash in front of it.

@alexander-akait
Copy link
Member

Should be fixed in #748

@alexander-akait
Copy link
Member

Close in favor #578

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants