boxShadow
fun StyleScope.boxShadow(offsetX: CSSLengthNumericValue = 0.px, offsetY: CSSLengthNumericValue = 0.px, blurRadius: CSSLengthNumericValue? = null, spreadRadius: CSSLengthNumericValue? = null, color: CSSColorValue? = null, inset: Boolean = false)(source)
Creates a box-shadow property with a single shadow. The property accepts either the BoxShadow.None value, the default global keywords, which indicates no shadows, or a list of shadows, created by using BoxShadow.of, ordered front to back.
Usages:
style {
boxShadow(BoxShadow.None)
}
Content copied to clipboard
Will generate:
box-shadow: none
Content copied to clipboard
style {
boxShadow(BoxShadow.Unset)
}
Content copied to clipboard
Will generate:
box-shadow: unset
Content copied to clipboard
style {
boxShadow(
BoxShadow.of(
offsetX = 0.px,
offsetY = 1.px,
blurRadius = 3.px,
spreadRadius = 1.px,
color = Colors.Black.copyf(alpha = 0.15f),
),
)
}
Content copied to clipboard
Will generate:
box-shadow: rgba(0, 0, 0, 0.15) 0px 1px 3px 1px;
Content copied to clipboard
See also
Deprecated
Use `boxShadow(BoxShadow.list(*boxShadows))` instead
Replace with
boxShadow(BoxShadow.list(*boxShadows))
Content copied to clipboard