Fix viewBox in icon.js

`<i data-feather="user" width="30" height="30"></i>` replace to `<svg ... width="30" height="30" viewBox="0 0 24 24" ...`, after fix: `<svg ... width="30" height="30" viewBox="0 0 30 30" ...`
This commit is contained in:
Anton 2022-02-20 14:40:02 +03:00 committed by GitHub
parent 734f3f5114
commit 4a0dc06be7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,6 +19,9 @@ class Icon {
* @returns {string}
*/
toSvg(attrs = {}) {
if (attrs.width || attrs.height) {
attrs.viewBox = `0 0 ${attrs.width || this.attrs.width} ${attrs.height || this.attrs.height}`;
}
const combinedAttrs = {
...this.attrs,
...attrs,