scalacss icon indicating copy to clipboard operation
scalacss copied to clipboard

unsafeRoot missing from documentation

Open tyrcho opened this issue 7 years ago • 4 comments

I'm trying to generate inline stylesheet (to use with scalaJS) to replace my current css file with this content, is this possible with scalaCSS ? I spent some time to search for such examples but could not find any ...

@media all and (min-width: 800px) {
    * {
        font-size: 4vmin;
    }
}

* {
    box-sizing: border-box;
}

body {
    margin: 1vmin;
}

tyrcho avatar Jan 13 '18 21:01 tyrcho

What you need is unsafeRoot but it seems it's missing from the documentation. Here's an example from the tests: in, out.

As for the media queries see: http://japgolly.github.io/scalacss/book/features/cond.html

japgolly avatar Jan 13 '18 23:01 japgolly

Thanks for the answer ! It would be helpfull to see it in the documentation :)

Here is what I used following the links :

style(
  unsafeRoot("*")(
    boxSizing.borderBox,
    media.all.minWidth(800.px)(fontSize(4.vmin))),
  unsafeRoot("body")(margin(1.vmin))
)

tyrcho avatar Jan 14 '18 11:01 tyrcho

I let you choose if you close the issue or keep it open to update the doc :)

tyrcho avatar Jan 14 '18 11:01 tyrcho

Good to hear. Let's keep this open

japgolly avatar Jan 15 '18 08:01 japgolly