astroturf icon indicating copy to clipboard operation
astroturf copied to clipboard

Global import

Open GTDev87 opened this issue 4 years ago • 1 comments

Hey, so I've integrated astroturf into my project and I'm curious if there is a way to use global imports.

I have added postcss and have tried using https://github.com/scherebedov/postcss-global-import#readme but it doesn't seem to handle when imports have imports.

Looks like the following:

css`
  @global-import "./css/global.css";
  @global-import "react-table/react-table.css";
  @global-import "bootstrap/dist/css/bootstrap.css";
`;

I don't think it is possible to wrap :global around an entire import.

Thanks

GTDev87 avatar May 26 '20 02:05 GTDev87

What are you trying to accomplish? :global is a css-modules construct it wouldn't affect imports. and if the issue is that imported styles are being "modularized" that not because an astroturf file is importing it it'd be because your build setup is matching all css files as css modules. The common convention is to only test files with .module.css extension for modules

jquense avatar May 26 '20 12:05 jquense