CSS Tip! 🤙
Use custom properties to work out the nested radius of elements for you 😎
.parent {
--nested-radius: calc(var(--radius) - var(--padding));
}
.nested {
border-radius: var(--nested-radius);
}
Couldn't resist making an interactive visual!
@CodePen link below 👇