我正在玩VMware Clarity Design System UI(https://vmware.github.io/clarity/)并正在运行他们的种子应用程序 . 我'm trying to replace their brand icon with my own, but it'是一个不同的大小 . 我注意到该图标似乎是硬编码为36px x 36px . 如果我尝试在CSS中设置一个新的大小,它仍然呈现为36px x 36px . 这是硬编码的吗?
我正在玩VMware Clarity Design System UI(https://vmware.github.io/clarity/)并正在运行他们的种子应用程序 . 我'm trying to replace their brand icon with my own, but it'是一个不同的大小 . 我注意到该图标似乎是硬编码为36px x 36px . 如果我尝试在CSS中设置一个新的大小,它仍然呈现为36px x 36px . 这是硬编码的吗?
2 回答
当你想用css设置大小时,你的答案是正确的(我向你投票反映了这一点) . 您还可以使用 clr-icon 元素上的 size 属性设置图标大小:
<clr-icon shape="info" size="48"></clr-icon>
我们这里有一个使用size属性的例子,Clarity Icons Documentation
它大约是页面的1/2,或者搜索 Setting the icon size . 仅供参考 - 我们正在更新Clarity Icons的文档 .
就是这样 . 我以为我需要为图像添加大小,而不是.clr-icon类 . 这有效: