corner-shape is a new CSS property. It accepts 「round」、「squircle」、「scoop」、「bevel」、「notch」and「square」 values。Developer could bring border-radius & corner-shape together to create vivid shape for layout.
Check the following sample out. It applied corner-shape for rendering PlayStation controller shapes.
Tutorial
Chekc the following tutorial and see how the sample works.
Instantiation
Developers could copy / paste the following style、HTML and JavaScript into your web page and check the effect.
Developers could use CSS or JavaScript detect current enviroment support corner-shape or not.
CSS
<style>
@supports (corner-shape: bevel) {
/* Yes. current enviroment support corner-shape */
...
}
</style>
JavaScript
<script type="module">
const support = CSS.supports('corner-shape', 'bevel');
if (support) {
/* Yes. current enviroment support corner-shape */
...
}
</script>