https://kotlinlang.org logo
#javascript
Title
# javascript
d

Don Kittle

11/15/2023, 9:52 PM
Hey there, I'm working on a Kotlin/JS React app. I'm playing around with switching from stylesheets and `ClassName`s to using emotion-react and
css
on my components. I'm wondering if there is a way to use a
var
in the
css
as I use vars for colors in my stylesheets (ie
background: var(--bg);
) in my stylesheet
t

turansky

11/16/2023, 1:36 PM
Sure
Copy code
val MY_BG = CustomPropertyName("--bg")

// usage
css {
    background = `var`(MY_BG)
}
👍 1
d

Don Kittle

11/16/2023, 7:18 PM
Thanks @turansky!