Skip to content
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

deps: update to svgo v3.0.5 and update docs #1533

Merged
merged 5 commits into from Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Expand Up @@ -70,3 +70,4 @@ Thanks goes to these wonderful people:
- James George
- Jordy D'Hoker
- Xiaojun Zhou
- Seth Falco

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

31 changes: 15 additions & 16 deletions packages/postcss-svgo/README.md
Expand Up @@ -63,27 +63,26 @@ below. Note that you can either disable the plugin by setting it to `false`,
or pass different options to change the default behaviour.

```js
var postcss = require('postcss');
var svgo = require('postcss-svgo');
const postcss = require('postcss');
const svgo = require('postcss-svgo');

var opts = {
const opts = {
plugins: [{
removeDoctype: false
}, {
removeComments: false
}, {
cleanupNumericValues: {
floatPrecision: 2
}
}, {
convertColors: {
names2hex: false,
rgb2hex: false
name: 'preset-default',
params: {
overrides: {
removeViewBox: false,
removeComments: false,
cleanupNumericValues: {
floatPrecision: 2
}
}
}
}]
};

postcss([ svgo(opts) ]).process(css).then(function (result) {

postcss([ svgo(opts) ]).process(css).then((result) => {
console.log(result.css)
});
```
Expand All @@ -107,4 +106,4 @@ See [CONTRIBUTORS.md](https://github.com/cssnano/cssnano/blob/master/CONTRIBUTOR
MIT © [Ben Briggs](http://beneb.info)

[postcss]: https://github.com/postcss/postcss
[plugins]: https://github.com/svg/svgo/tree/master/plugins
[plugins]: https://svgo.dev/docs/plugins/
2 changes: 1 addition & 1 deletion packages/postcss-svgo/package.json
Expand Up @@ -28,7 +28,7 @@
"repository": "cssnano/cssnano",
"dependencies": {
"postcss-value-parser": "^4.2.0",
"svgo": "^3.0.2"
"svgo": "^3.0.5"
},
"bugs": {
"url": "https://github.com/cssnano/cssnano/issues"
Expand Down
2 changes: 1 addition & 1 deletion packages/postcss-svgo/src/index.js
Expand Up @@ -114,7 +114,7 @@ function minify(decl, opts, postcssResult) {

decl.value = minified.toString();
}
/** @typedef {{encode?: boolean, plugins?: object[]} & import('svgo').Config} Options */
/** @typedef {{encode?: boolean} & import('svgo').Config} Options */
/**
* @type {import('postcss').PluginCreator<Options>}
* @param {Options} opts
Expand Down
2 changes: 1 addition & 1 deletion packages/postcss-svgo/test/index.js
Expand Up @@ -128,7 +128,7 @@ test(
'should not throw when decoding a svg',
processCSS(
"h1{-webkit-mask-box-image: url(\"data:image/svg+xml;charset=utf-8,<svg height='35' viewBox='0 0 96 70' width='48' xmlns='http://www.w3.org/2000/svg'><path d='m84 35c1 7-5 37-42 35-37 2-43-28-42-35-1-7 5-37 42-35 37-2 43 28 42 35z'/></svg>\") 50% 56% 46% 42%;}",
'h1{-webkit-mask-box-image: url(\'data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="35" viewBox="0 0 96 70"><path d="M84 35c1 7-5 37-42 35C5 72-1 42 0 35-1 28 5-2 42 0c37-2 43 28 42 35z"/></svg>\') 50% 56% 46% 42%;}'
'h1{-webkit-mask-box-image: url(\'data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="35" viewBox="0 0 96 70"><path d="M84 35c1 7-5 37-42 35C5 72-1 42 0 35-1 28 5-2 42 0c37-2 43 28 42 35"/></svg>\') 50% 56% 46% 42%;}'
)
);

Expand Down
3 changes: 1 addition & 2 deletions packages/postcss-svgo/types/index.d.ts
@@ -1,5 +1,5 @@
export = pluginCreator;
/** @typedef {{encode?: boolean, plugins?: object[]} & import('svgo').Config} Options */
/** @typedef {{encode?: boolean} & import('svgo').Config} Options */
/**
* @type {import('postcss').PluginCreator<Options>}
* @param {Options} opts
Expand All @@ -11,7 +11,6 @@ declare namespace pluginCreator {
}
type Options = {
encode?: boolean;
plugins?: object[];
} & import('svgo').Config;
declare var postcss: true;
import { encode } from "./lib/url";
9 changes: 5 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion site/src/docs/presets.md
Expand Up @@ -117,7 +117,12 @@ module.exports = {
preset: ['default', {
svgo: {
plugins: [{
removeDoctype: false,
name: 'preset-default',
params: {
overrides: {
removeDoctype: false,
},
},
}],
},
}],
Expand Down
4 changes: 0 additions & 4 deletions site/src/docs/support-us.md
Expand Up @@ -32,7 +32,3 @@ A huge THANK YOU to our recurring backers!
A huge THANK YOU to our backers!

<object type="image/svg+xml" data="https://opencollective.com/cssnano/backers.svg?avatarHeight=36&width=600"></object>

## Stickers

We sell logo stickers through [StickerMule](https://www.stickermule.com/uk/marketplace/11086-cssnano).