Skip to content

Conversation

thisisdano
Copy link
Contributor

@thisisdano thisisdano commented May 4, 2022

Updating to gulp-svgstore. Notes in the comments

@mgwalker
Copy link

mgwalker commented May 6, 2022

Tested on an ARM64 arch node:16 docker container and the install worked, which addresses the primary concern in #25. I don't have a test project handy to try executing it, but I'll see if I can put something together.

@thisisdano thisisdano linked an issue May 8, 2022 that may be closed by this pull request
Comment on lines +7 to +8
assets/
sass/
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are generated when testing, but should be ignored

@@ -6,7 +6,7 @@ const replace = require("gulp-replace");
const sass = require("gulp-sass")(require("sass-embedded"));
const sourcemaps = require("gulp-sourcemaps");
const del = require("del");
const svgSprite = require("gulp-svg-sprite");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the new sprite builder

Comment on lines -185 to -204
const config = {
shape: {
dimension: {
// Set maximum dimensions
maxWidth: settings.sprite.width,
maxHeight: settings.sprite.width,
},
id: {
separator: settings.sprite.separator,
},
spacing: {
// Add padding
padding: 0,
},
},
mode: {
symbol: true, // Activate the «symbol» mode
},
};

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This config does not apply to the new package. As far as I can tell, this is not necessary as long as we continue to use 24x24 SVGs with height, width, and viewBox set properly.

.on("error", handleError)
.pipe(dest(`${paths.dist.img}`));
}

function renameSprite() {
return src(`${paths.dist.img}/symbol/svg/sprite.symbol.svg`.replaceAll("//", "/"), {
return src(`${paths.dist.img}/usa-icons.svg`.replaceAll("//", "/"), {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Point to the new outputted file

"postcss": "^8.4.8",
"postcss-csso": "^5.0.1",
"sass-embedded": "^1.49.9"
"autoprefixer": "10.4.7",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update autoprefixer

"gulp-postcss": "9.0.1",
"gulp-rename": "2.0.0",
"gulp-replace": "1.1.3",
"gulp-sass": "5.1.0",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update gulp-sass

"gulp-svgstore": "9.0.0",
"postcss": "8.4.8",
"postcss-csso": "5.0.1",
"sass-embedded": "1.50.1"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update sass-embedded

Comment on lines +40 to +42
"devDependencies": {
"@uswds/uswds": "^3.0.0",
"uswds": "^2.13.3"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using USWDS 2.x and 3.x here are testing dependencies

@thisisdano thisisdano marked this pull request as ready for review May 10, 2022 03:53
@thisisdano thisisdano merged commit a8407c8 into develop May 10, 2022
@thisisdano thisisdano deleted the dw-svg-sprite-update branch May 10, 2022 03:54
@bkline
Copy link

bkline commented May 10, 2022

Well done. Thank you! 👏 🙌

@thisisdano thisisdano added this to the compile 1.0.0-beta.3 milestone Jun 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Installation fails on linux/arm64
4 participants