Rename all.scss to uswds.scss; add version comment#1530
Conversation
|
@shawnbot a few things:
|
|
|
Okay, so I've got some updates locally that add a version comment (fixing #1529) to the generated CSS, as well as some tests to confirm that the build process is generating the right files and including the version comment in each. I'll update the description accordingly.
|
|
Okay, ready for your review, @juliaelman! I think we can handle the documentation updates separately once this is merged. |
juliasolorzano
left a comment
There was a problem hiding this comment.
Looks fantastic! Just a few typos and we're gtg.
|
|
||
| describe('build output', function () { | ||
|
|
||
| it('generates CSS at dist/css/uwsds.css', function () { |
| ); | ||
| }); | ||
|
|
||
| it('generates minified CSS at dist/css/uwsds.min.css', function () { |
Refactor all variables as defaults
|
Okay, fixed those typos @juliaelman! 😬 |
|
🚀 |
Sass entrypoint:
uswdsThis PR renames
src/stylesheets/all.scsstouswds.scss, which fixes #1417 by making it possible to import in Sass by adding thesrc/stylesheetsdirectory to their include path and importing it with:For users of the existing
all.scss, I've included a fallback_all.scssthat prevents breakage for users of the old Sass entrypoint via@import 'all';.CSS version comment
I've also included a fix for #1529 in the form of a CSS comment at the top of both the un-minified and minified CSS files that looks like this:
/*! uswds v0.13.1 */where
0.13.1will be whatever ourversionfield specifies inpackage.json. I've placed this comment at the top of ouruswds.scssfile, so any users who import this file will get the comment in their CSS, which can help us debug future issues in user-generated CSS.Tests!
There are tests for all of this:
The "sass/build" tests confirm that running
gulp buildgenerates the expecteduswds.cssanduswds.min.cssfiles, and that both of them contain the expected version string.The "sass/include" tests confirm that rendering raw Sass that imports either
uswdsorallfrom our include path doesn't generate an error.