Skip to content

Commit

Permalink
add fallback and override
Browse files Browse the repository at this point in the history
  • Loading branch information
jamieomaguire committed Mar 28, 2024
1 parent 9e53cab commit 135a90d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 19 deletions.
8 changes: 4 additions & 4 deletions packages/tools/pie-icons-webc/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ export class ${name} extends LitElement implements IconProps {
super.connectedCallback();
if (this._svg?.getAttribute('width') === null) {
const svgSize = getSvgProps('${svgClasses}', '', null, '${name}');
this.style.width = svgSize.width + 'px';
this.style.height = svgSize.height + 'px';
this.style.width = \`\${\`var(--icon-size-override,\${svgSize.width}\`}px)\`;
this.style.height = \`\${\`var(--icon-size-override,\${svgSize.height}\`}px)\`;
this._svg?.setAttribute('width', svgSize.width);
this._svg?.setAttribute('height', svgSize.height);
}
Expand All @@ -74,8 +74,8 @@ export class ${name} extends LitElement implements IconProps {
if (changedProperties.has('size')) {
svgSize = getSvgProps('${svgClasses}', '', this.size, '${name}');
this.style.width = svgSize.width + 'px';
this.style.height = svgSize.height + 'px';
this.style.width = \`\${\`var(--icon-size-override,\${svgSize.width}\`}px)\`;
this.style.height = \`\${\`var(--icon-size-override,\${svgSize.height}\`}px)\`;
this._svg?.setAttribute('width', svgSize.width);
this._svg?.setAttribute('height', svgSize.height);
}
Expand Down
29 changes: 14 additions & 15 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -27383,20 +27383,6 @@ __metadata:
languageName: node
linkType: hard

"node-fetch@npm:2, node-fetch@npm:^2.0.0, node-fetch@npm:^2.5.0, node-fetch@npm:^2.6.1, node-fetch@npm:^2.6.7":
version: 2.7.0
resolution: "node-fetch@npm:2.7.0"
dependencies:
whatwg-url: ^5.0.0
peerDependencies:
encoding: ^0.1.0
peerDependenciesMeta:
encoding:
optional: true
checksum: d76d2f5edb451a3f05b15115ec89fc6be39de37c6089f1b6368df03b91e1633fd379a7e01b7ab05089a25034b2023d959b47e59759cb38d88341b2459e89d6e5
languageName: node
linkType: hard

"node-fetch@npm:2.6.1":
version: 2.6.1
resolution: "node-fetch@npm:2.6.1"
Expand All @@ -27418,6 +27404,20 @@ __metadata:
languageName: node
linkType: hard

"node-fetch@npm:^2.0.0, node-fetch@npm:^2.5.0, node-fetch@npm:^2.6.1, node-fetch@npm:^2.6.7":
version: 2.7.0
resolution: "node-fetch@npm:2.7.0"
dependencies:
whatwg-url: ^5.0.0
peerDependencies:
encoding: ^0.1.0
peerDependenciesMeta:
encoding:
optional: true
checksum: d76d2f5edb451a3f05b15115ec89fc6be39de37c6089f1b6368df03b91e1633fd379a7e01b7ab05089a25034b2023d959b47e59759cb38d88341b2459e89d6e5
languageName: node
linkType: hard

"node-fetch@npm:^3.2.8":
version: 3.3.2
resolution: "node-fetch@npm:3.3.2"
Expand Down Expand Up @@ -29152,7 +29152,6 @@ __metadata:
glob: 10.3.3
husky: 8.0.3
jsdom: 24.0.0
node-fetch: 2
npm-run-all: 4.1.5
pinst: 3.0.0
postcss: 8.4.32
Expand Down

0 comments on commit 135a90d

Please sign in to comment.