mirror of
https://github.com/GenderDysphoria/GenderDysphoria.fyi.git
synced 2025-02-07 10:16:16 +00:00
Fixing icons not obeying the size attribute
This commit is contained in:
parent
7eb3bfe69a
commit
b919a7cf11
@ -251,11 +251,13 @@ class Injectables {
|
|||||||
const { hash, env, resolve: rval } = args.pop();
|
const { hash, env, resolve: rval } = args.pop();
|
||||||
const local = rval('@root.this.local');
|
const local = rval('@root.this.local');
|
||||||
const tpath = path.join(local.root, 'svg', name + '.svg');
|
const tpath = path.join(local.root, 'svg', name + '.svg');
|
||||||
|
if (hash.size && String(hash.size).match(/^\d+$/)) {
|
||||||
|
hash.size = hash.size + 'px';
|
||||||
|
}
|
||||||
const frame = handybars.makeContext(hash, env);
|
const frame = handybars.makeContext(hash, env);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const contents = self._template(tpath, (s) =>
|
const contents = self._template(tpath, (s) =>
|
||||||
handybars(`<span class="svg-icon" {{#if size}}style="width:{{size}}px;height:{{size}}px"{{/if}}>${s}</span>`),
|
handybars(`<span class="svg-icon" style="{{#if this.size}}width:{{this.size}};height:{{this.size}};{{/if}}{{this.style}}">${s}</span>`),
|
||||||
)(frame);
|
)(frame);
|
||||||
|
|
||||||
return handybars.safe(contents);
|
return handybars.safe(contents);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user