uswds / uswds-compile

Simple Gulp 4 functions for copying USWDS static assets and transforming USWDS Sass into browser-readable CSS.
Other
21 stars 12 forks source link

USWDS-Compile - Feature: How can I create separate component directories? #82

Open ryandwalker opened 9 months ago

ryandwalker commented 9 months ago

Is your feature request related to a problem? Please describe.

The problem is that all my CSS is loaded for all pages, including pages where the CSS isn't relevant. Currently in my gulpfile.js, I have these paths:

uswds.paths.dist.css = './css'; uswds.paths.dist.theme = './sass';

This works as expected. But now I want to create subdirectories for components, like /sass/component/my-component/my-component.scss.

Describe the solution you'd like

I want to create subdirectories for components, like /sass/component/my-component/my-component.scss

Note: I do not want my-component.scss automatically compiled into my /css/style.scss. Instead, I want it to compile somewhere like /css/my-component/my-component.css. That way my application can load my-component.css only where it is relevant.

Describe alternatives you've considered

No response

Additional context

I'm not sure if I'm looking for a support in the right place. I don't know if my issue is a more general gulp question -- and I should get support somewhere like stackoverflow.com -- or if my issue is specific to uswds-compile.

Code of Conduct

ryandwalker commented 3 weeks ago

Can someone comment on whether USWDS-compile supports the distribution of CSS among different component directories? I suspect it is possible to do this with USWDS-compile, but I'm not sure.

It's also possible that USWDS-compile does not prevent the developer from distributing the compiled CSS among components, but also does not particularly support it. That is, maybe there is some trick to doing what I want, despite the USWDS-compile itself not explicitly supporting single-directory components.

Thanks!