Hello there. :wave: I started a new multiplatform...
# compose-web
g
Hello there. 👋 I started a new multiplatform project a few days ago to work with compose web. Now I have two questions regarding CSS. First question: How would I transfer some CCS like this for my StyleSheet?
Copy code
.container.button-pressed .show-overlay {
    transform: translateX(0);
}
At the moment my Stylesheets look similar to this:
Copy code
object SpanStyleSheet : StyleSheet() {
    val span by style {
        fontSize(12.px)
        maxWidth(20.vw)
    }
}
Second question: How can I combine multiple StyleSheets together?
m
How to combine multiple stylesheets together: https://kotlinlang.slack.com/archives/C01F2HV7868/p1637161274150800
d
You should be able to just declare styles via strings
Copy code
object MyStyleSheet : StyleSheet() {
  ".container.button-pressed.show-overlay" {
     ...
  } 
}
As an aside, I'm working on a project that lets you declare styles local to your .kt file which is then processed by a Gradle plugin to create one final global stylesheet for you, but otherwise, declaring multiple style objects (as @MrPowerGamerBR suggests) and then referencing them via multiple calls to
Style
would work without the need for any special pre-processing.
g
Took some time figuring out, but now it all works like a charm. Thanks a lot. 🙏😃
👍 1