I am now trying to now use kotlin-react-css instea...
# react
i
I am now trying to now use kotlin-react-css instead of styled components. I am aware of the kotlin-react-table-example But how do I now add global css ? with kotlinx.css I used to do something like
Copy code
package css
// ... imports

val GlobalStyle = CssBuilder().apply {
    // my global css goes here
}
and then did
Copy code
import css.GlobalStyle
in my main components file App.kt
t
Emotion
Global
component can be used for this problem
i
what package does
simpleComponent
come from? autocompletion suggests no import. It appears that
kotlin-emotion
is already being depended on by
kotlin-react-css
. Do I have to add another dependencie aside from
kotlin-react-css
? Do I need it or can I just add it in a custom
FC<Props>
or
FC<GlobalProps>
? Is the project you screenshotted the code from available somewhere on publically?
It's only suggesting legacy stuff for me
t
Copy code
import csstype.BoxSizing.Companion.borderBox
import csstype.px
import emotion.react.Global
import emotion.react.styles
import react.FC
import react.Props
import react.dom.html.ReactHTML.body

val NormalizeCss = FC<Props> {
    Global {
        styles {
            body {
                margin = 0.px
            }

            "*, *:before, *:after" {
                boxSizing = borderBox
            }
        }
    }
}
i
thanks!
112 Views