Skip to content

Instantly share code, notes, and snippets.

@PushoDev
Created February 22, 2025 20:47
Show Gist options
  • Save PushoDev/fc4e9b6db3e302e51ff92b24aa1ef630 to your computer and use it in GitHub Desktop.
Save PushoDev/fc4e9b6db3e302e51ff92b24aa1ef630 to your computer and use it in GitHub Desktop.
inverted border-radius with box-shadow
<div class="inverted-border-radius"></div>
body
display: flex
align-items: center
justify-content: center
height: 100vh
width: 100vw
$width-border: 200px
$half-border: $width-border/2
$quad-border: $half-border/2
$half-border-inverted: $half-border * -1
$color: #f00
.inverted-border-radius
position: relative
height: $half-border
width: $half-border
background-color: $color
border-radius: 0 50% 50% 0
&::before
content: ""
position: absolute
background-color: transparent
top: -$width-border
height: $width-border
width: $quad-border
border-bottom-left-radius: $half-border
box-shadow: 0 $half-border 0 0 $color
&::after
content: ""
position: absolute
background-color: transparent
bottom: -$width-border
height: $width-border
width: $quad-border
border-top-left-radius: $half-border
box-shadow: 0 $half-border-inverted 0 0 $color
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment