【问题标题】:How to create a squircle with a border? [closed]如何创建带边框的松鼠? [关闭]
【发布时间】:2023-01-30 12:13:03
【问题描述】:

有没有什么方法可以制作一个squircle(剪辑路径?,houdini?)但边框、阴影或内部发光也符合形状?

可以通过 CSS paintWorklet 使用 houdini 创建一个鼠形,但这非常 poor support from browsers 使用率仅为 71.35% (2023) 可能是因为 security vulnerabilities 关于绘画工作集。

其他替代方案包括 using an SVG <clipPath> with the squircle shape,但这在缩放形状时失败并且通常不是可缩放的解决方案。

【问题讨论】:

标签: css reactjs react-native


【解决方案1】:

您可以像这样调整 CSS border-radius

.squircle{
  width: 100px;
  height: 100px;
  display: block;
  border-radius: 30px/40px ;
  background: linear-gradient(#f23f71,#d01257)
}
<div class="squircle"></div>

【讨论】:

    猜你喜欢
    • 2019-11-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多