-
Notifications
You must be signed in to change notification settings - Fork 154
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
Update Sass to modern syntax #3042
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added code comments
// TODO: move to uswds once finished | ||
$theme-site-cols-split: "tablet"; | ||
$theme-site-cols-show: "desktop"; | ||
$theme-grid-gap-default: "md"; | ||
|
||
$site-measure: 5; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are all now in variables so they can be use
d properly
@@ -112,10 +101,10 @@ abbr[title="required"] { | |||
$site-banner-icon-color: "blue-40v"; | |||
$site-banner-action-color: "gray-20"; | |||
@include typeset($site-banner-font-family); | |||
background-color: color("ink"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They'll be a number of this type of change throughout, changing the order of rules to avoid splitting across nested rules...
@@ -453,7 +442,6 @@ abbr[title="required"] { | |||
} | |||
|
|||
.site-subheading { | |||
@include typeset-h6; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed entirely, since moving to bottom caused some font issues. All it gets us is uppercasing, which I addressed in the previous PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, to be fair, it DOES change the spacing a little between the eyebrow and the h1
, but not enough to be an issue
@@ -1,3 +1,5 @@ | |||
@use "uswds-core" as *; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll see this in all the files now...
css/custom-styles/_index.scss
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added an index for easier forward
ing
css/settings/_uswds-site-theme.scss
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And lo! Only the settings we use! This took a bunch of diff'ing, but now we only have one small(ish) settings group instead of a bunch of redundant settings over 6 separate files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can now reference this single file from all our entry points
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved all the old settings to a directory for reference. We can possibly just delete them now.
@forward "settings/uswds-site-theme"; | ||
@forward "uswds/packages/uswds"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Way simpler!
@@ -43,10 +43,10 @@ | |||
"prestart": "npx gulp build", | |||
"proof": "bundle exec htmlproofer --enforce-https=false --allow-missing-href=true --only_4xx --ignore-status-codes 403,429 --swap-urls 'https\\://designsystem.digital.gov/:/' --ignore-files '/whats-new/updates/(2017|2018|2019|2020|2021)/,/documentation/code-guidelines/' ./_site", | |||
"proof:all": "bundle exec htmlproofer --enforce-https=false --allow-missing-href=true --ignore-status-codes 0 --swap-urls 'https\\://designsystem.digital.gov/:/' --ignore-files '/whats-new/updates/(2017|2018|2019|2020|2021)/,/documentation/code-guidelines/' ./_site", | |||
"serve": "npm run build:all-assets && bundle exec jekyll serve --drafts --future --incremental --livereload --host=localhost", | |||
"serve": "npm run build:all-assets && bundle exec jekyll serve --drafts --future --incremental --host=localhost", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ymmv, but for me livereload just isn't worth it. I get pages and pages of webrick
errors in the console, which is way too noisy to notice anything of value. The time saved not just hitting command-R
is negligable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For what it's worth, I've pretty much exclusively used the local host link and not the live reload link in my time here ¯_(ツ)_/¯
@@ -97,7 +97,7 @@ | |||
}, | |||
"snyk": true, | |||
"dependencies": { | |||
"@uswds/compile": "1.2.1", | |||
"@uswds/compile": "github:uswds/uswds-compile#dw-gulp-sass-update", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm using a feature branch here where I fixed the Sass JS API deprecation issues. We can link it to a formal compile release when that exists
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! No perceived regressions and no build errors.
Really happy to have this update 👏
@@ -43,10 +43,10 @@ | |||
"prestart": "npx gulp build", | |||
"proof": "bundle exec htmlproofer --enforce-https=false --allow-missing-href=true --only_4xx --ignore-status-codes 403,429 --swap-urls 'https\\://designsystem.digital.gov/:/' --ignore-files '/whats-new/updates/(2017|2018|2019|2020|2021)/,/documentation/code-guidelines/' ./_site", | |||
"proof:all": "bundle exec htmlproofer --enforce-https=false --allow-missing-href=true --ignore-status-codes 0 --swap-urls 'https\\://designsystem.digital.gov/:/' --ignore-files '/whats-new/updates/(2017|2018|2019|2020|2021)/,/documentation/code-guidelines/' ./_site", | |||
"serve": "npm run build:all-assets && bundle exec jekyll serve --drafts --future --incremental --livereload --host=localhost", | |||
"serve": "npm run build:all-assets && bundle exec jekyll serve --drafts --future --incremental --host=localhost", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For what it's worth, I've pretty much exclusively used the local host link and not the live reload link in my time here ¯_(ツ)_/¯
The base branch was changed.
Updates all project Sass to modern Sass syntax. A number of nice quality-of-life issues for devs. Speeds up compile time by about 2-3 seconds. (EDIT: Maybe not that much. Maybe I just got lucky. But it FEELS faster because you don't see all those errors scroll past.) Removes all kinds of noise from the terminal.
use
andforward
syntaxuswds-compile
to use modern Sass JS APIwebrick
failure noise in the terminalImportant
Based on work from #3041. We'll want to merge after that work, and change the base of this PR to
main
. It targets #3041 now to show only the relevant changes.