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

@import-glob "components/*.css" layer(components); isn't transformed correctly #3

Closed
argyleink opened this issue Nov 29, 2022 · 0 comments

Comments

@argyleink
Copy link
Contributor

Per postcss/postcss-import#496 from postcss-import, specifying a layer works. But when using this glob plugin to grab a bunch of files for import, the layer definition is lost.

Given

@import-glob "components/*.css" layer(components);

The output currently:

@import "components/a.css";
@import "components/b.css";

The expected output is

@import "components/a.css" layer(components);
@import "components/b.css" layer(components);

a test might look like

test('layer test', async (t) => {
  const input = `
    @import-glob "fixtures/css/foo/**/*.css" layer(test);
  `;

  const output = `
    @import "${__dirname}/fixtures/css/foo/bar.css" layer(test);
    @import "${__dirname}/fixtures/css/foo/foo.css" layer(test);
  `;

  await tester.test(input, output, t);
});
dimitrinicolas added a commit that referenced this issue Nov 30, 2022
dimitrinicolas added a commit that referenced this issue Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant