-
Notifications
You must be signed in to change notification settings - Fork 231
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
Group examples and their assets in directories #274
Conversation
You can preview this change here: Built with commit f3d1674 https://deploy-preview-274--govuk-design-system-preview.netlify.com |
Great change @alex-ju, this really helps with the repetitive code a across the codebase. I investigated and solved it in a slightly different way. I changed the .use(sass({
includePaths: ['node_modules'], // an array of paths that sass can look in when attempt to resolve @import declarations
outputDir: 'stylesheets/'
})) and <link href="/stylesheets/{{ stylesheet }}" rel="stylesheet" media="all" /> Essentially all the CSS is being generated into the root |
@Nooshu that's a slick approach; the only downside is that it's only dealing with the CSS. We may be able to replicate the behaviour (grabbing files from different sources and place it into one folder when published) for JavaScript, but unfortunately it won't solve the generic assets problem (i.e. images, archives, etc). Based on your solution (and an alternative for grouping the assets in its own directory for each example) we can group all the assets across components/patterns/styles in a single I'm waiting for others opinion on this one and if the one above seems like a better approach I'll raise a separate PR with it. |
c8c5e6f
to
126da9b
Compare
Would be good to have some feedback on this, otherwise I'll have to keep rebasing it for each example that gets merged. |
I like this approach and hopefully update imports in these scss files won't bloat the filesize |
126da9b
to
f3d1674
Compare
This PR restructures
src
so that:Below is an example of the output for the Addresses pattern
Output
Before
After