Is your feature request related to a problem? Please describe.
I have built the beginnings of a USWDS 3 custom design system package. Instead of using USWDS on a single project, and customizing it each time we use it in a new project, this will lay the foundation for us to have consistency across organization projects.
Describe the solution you'd like
To accomplish this, it was necessary to override the buildSass function.
- return src([`${paths.dist.theme}/*.scss`.replaceAll("//", "/")])
+ return src("src/stylesheets/mywds.scss")
...
- sass({ includePaths: buildSettings.includes }).on("error", handleError)
+ sass({
+ includePaths: [
+ "./packages",
+ "./node_modules/@uswds/uswds/packages"
+ ],
+ outputStyle: "expanded",
+ }).on("error", handleError)
...
- .pipe(sourcemaps.write("."))
- .pipe(dest(paths.dist.css));
+ .pipe(dest("dist/css"))
+ .pipe(postcss(pluginsMinify))
+ .pipe(rename({
+ suffix: ".min",
+ })
+ )
+ .pipe(sourcemaps.write("."))
+ .pipe(dest("dist/css"));
Note:
For my design system package to be able to supply its own theme/ starter files to projects that require it, I had to specify a different source than what is copied from uswds.paths.dist.theme:
So, it seems then that we need:
- The ability to optionally specify a compile source that is different from the theme source.
- The ability to override the
includePaths key of the buildSettings object, and set outputStyle: "expanded".
- The ability to optionally specify a different destination than
uswds.paths.dist.css.
- The un-minified and minified output.
Describe alternatives you've considered
No response
Additional context
With this change, we could document how an organization can build their own USWDS packages to support their entire organization. This also opens up the possibility for community driven packages.
Code of Conduct
Is your feature request related to a problem? Please describe.
I have built the beginnings of a USWDS 3 custom design system package. Instead of using USWDS on a single project, and customizing it each time we use it in a new project, this will lay the foundation for us to have consistency across organization projects.
Describe the solution you'd like
To accomplish this, it was necessary to override the
buildSassfunction.So, it seems then that we need:
includePathskey of thebuildSettingsobject, and setoutputStyle: "expanded".uswds.paths.dist.css.Describe alternatives you've considered
No response
Additional context
With this change, we could document how an organization can build their own USWDS packages to support their entire organization. This also opens up the possibility for community driven packages.
Code of Conduct