BETA

Background

Paint a squircle background on an element.

Variables

VariableType
--squircle-mode
mask-image | background

The background mode is the default mode, so you don't need to set it explicitly here.

Usage

.squircle {
  background: paint(squircle);
}

We advise you to use a no-repeat background to avoid certain mini visual bugs that might occur on slow devices when resizing a squircle (only on browsers not compatible with CSS.paintWorklet).

.squircle {
  background: paint(squircle);
 
  @supports not (background: paint(squircle)) {
    background-repeat: no-repeat;
  }
}

By Skyleen. The source code is available on GitHub.

On this page