WordPress阻止插件图标

时间:2019-06-12 19:18:59

标签: javascript wordpress

我使用一个简单的Wordpress插件脚本,但是在Wordpress中无法很好地显示我的图标时遇到了问题。我使用Linkscape在SVG中创建了我的ICON。

文件看起来不错。我导出到sag,然后复制出SVG的数据。 常见的SVG为:

<svg width="20" height="20.857" version="1.1" viewBox="0 0 19.999998 20.857389" xmlns="http://www.w3.org/2000/svg"><g transform="translate(-14.111 -8.7536)"><path d="m20.362 27.624c-3.4079-1.0918-6.2093-1.9801-6.2255-1.9739-0.02543 0.01-0.02866-0.8575-0.02419-6.5016 0.0051-6.4962 0.0053-6.5129 0.04615-6.5163 0.02254-2e-3 2.2038-0.87345 4.8471-1.9368 2.6434-1.0633 4.8254-1.9372 4.8489-1.9419 0.03692-7e-3 10.199 2.3397 10.241 2.3653 0.0085 5e-3 0.01538 2.5895 0.01538 5.743 0 4.5556-0.0053 5.7403-0.02562 5.7665-0.05778 0.0743-7.4845 6.9842-7.5048 6.9826-0.01213-9.94e-4 -2.8103-0.89502-6.2182-1.9868zm8.4295-3.5212 2.7983-2.6097v-4.1666c0-3.4683-0.0046-4.1704-0.02761-4.1895-0.02842-0.0236-7.4031-1.7447-7.4758-1.7447-0.06471 0-7.3837 2.9492-7.4121 2.9867-0.03831 0.0507-0.03754 9.3068 7.85e-4 9.3592 0.01777 0.0243 1.3195 0.45021 3.9812 1.3026 2.1751 0.6966 4.2407 1.3592 4.5902 1.4726 0.34945 0.11331 0.66042 0.20446 0.69106 0.20256 0.04361-3e-3 0.66347-0.57028 2.854-2.6132zm-1.9771-4.4082c0-1.6918 0.0062-3.076 0.01368-3.076 0.03094 0 3.9633 2.0158 3.958 2.0289-0.0097 0.0238-3.9326 4.1089-3.9528 4.1163-0.01139 4e-3 -0.01883-1.2087-0.01883-3.0692z" stroke-width=".020495"/></g></svg>

在我的代码中,我使用

    const logo = wp.element.createElement('svg',
        {
            width: 20,
            height: 20
        },
        wp.element.createElement( 'path',
            {
                d: "m 20.362098,27.624121 c -3.407872,-1.09182 -6.209334,-1.980069 -6.225472,-1.97388 -0.02543,0.01 -0.02866,-0.857499 -0.02419,-6.501618 0.0051,-6.496198 0.0053,-6.512888 0.04615,-6.516337 0.02254,-0.002 2.203755,-0.87345 4.847134,-1.93677 2.643378,-1.0633098 4.825404,-1.9371791 4.848947,-1.9419189 0.03692,-0.007 10.199077,2.3397489 10.2407,2.3653189 0.0085,0.005 0.01538,2.589549 0.01538,5.742998 0,4.555619 -0.0053,5.740318 -0.02562,5.766468 -0.05778,0.0743 -7.484511,6.984168 -7.50483,6.982588 -0.01213,-9.94e-4 -2.81032,-0.895019 -6.218191,-1.986849 z m 8.429463,-3.521229 2.798257,-2.609709 v -4.166589 c 0,-3.468259 -0.0046,-4.170439 -0.02761,-4.189509 -0.02842,-0.0236 -7.403117,-1.744699 -7.475752,-1.744699 -0.06471,0 -7.383721,2.949249 -7.412079,2.986749 -0.03831,0.0507 -0.03754,9.306767 7.85e-4,9.359177 0.01777,0.0243 1.319479,0.45021 3.981208,1.30264 2.175145,0.696599 4.240719,1.359249 4.590163,1.472559 0.349446,0.11331 0.660424,0.20446 0.691064,0.20256 0.04361,-0.003 0.66347,-0.57028 2.853969,-2.613179 z m -1.977143,-4.408219 c 0,-1.691799 0.0062,-3.075999 0.01368,-3.075999 0.03094,0 3.963315,2.015799 3.957967,2.028909 -0.0097,0.0238 -3.932605,4.108929 -3.952821,4.116259 -0.01139,0.004 -0.01883,-1.208699 -0.01883,-3.069169 z"
            }
        )
    );

在所有的图标中,Wordpress列表中的图标显示不佳。它总是在左上角切割。

Currently

必须是:

Have to be

有人建议我做错了吗?

0 个答案:

没有答案