These are chat archives for japgolly/scalacss

17th
Aug 2015
bjenkinsgit
@bjenkinsgit
Aug 17 2015 00:01

I'm trying to debug my ScalaCSS code and attempting to use a println as mentioned in the docs, but when I do that, I get the following:

[error] /Users/bwj/Documents/workspace_EE/Attendant_SP/js/src/main/scala/template/pages/DashboardPage.scala:55: ambiguous implicit values:
[error]  both method cssReactElementRenderer in trait ScalaCssReactImplicits of type (implicit s: scalacss.Renderer[String])scalacss.Renderer[japgolly.scalajs.react.ReactElement]
[error]  and method cssStyleElementRenderer in trait ScalaCssReactImplicits of type (implicit s: scalacss.Renderer[String])scalacss.Renderer[org.scalajs.dom.raw.HTMLStyleElement]
[error]  match expected type scalacss.Renderer[Out]
[error]     println(Style.render)
[error]                   ^
[error] one error found

How can I choose the correct renderer?

Yuriy Badalyantc
@LMnet
Aug 17 2015 05:42
Is reset.css integrated in scala.css?
Roberto Leibman
@rleibman
Aug 17 2015 17:23
chandu0101... thank you so much, your tip of using the CssJs branch worked perfectly. For those interested... I first declare my style:
object Style extends StyleSheet.Inline {
    import dsl._
    val buttons = style("mybuttons")(padding(2.px, 4.px, 2.px, 4.px),
      margin(2.px, 2.px, 2.px, 2.px),
      border(1.px, solid, c"#333333"))
  }
Then I use this
    val style = CssJs.cssToJsObject(Style.css)("mybuttons")
Now I can use this style in my button as so:
MuiRaisedButton(style = style)("Freeze")