These are chat archives for japgolly/scalacss

22nd
Aug 2015
Anton Kulaga
@antonkulaga
Aug 22 2015 11:52

In LESS I can nest styles one into another, like:

#header {
  color: black;
  .navigation {
    font-size: 12px;
  }
  .logo {
    width: 300px;
  }
}

that is very convenient.
How can I do the same with scalacss Standalone?

@japgolly
I use scalacss in my project and in my templates I'm always writing something like this to use style:

someStyleClass.someStyle.htmlClass

If i want to use more than one style I'm writing this:

s"${someStyleClass.someStyle1.htmlClass} ${someStyleClass.someStyle2.htmlClass}

It would be cool if StyleA will have toString method like this:

override def toString = this.htmlClass
Yuriy Badalyantc
@LMnet
Aug 22 2015 12:12
With this I will be able to not write .htmlClass in all my style usages.
Anton Kulaga
@antonkulaga
Aug 22 2015 12:25
@LMnet it is about InlineStyles but it is not clear for me how to do the same for standalone ones
Yuriy Badalyantc
@LMnet
Aug 22 2015 13:24
I created pull request with toString.
bjenkinsgit
@bjenkinsgit
Aug 22 2015 14:32
@japgolly BTW, doc updated needed. The ScalaCSS docs say you can get a printout of ones styles by merely doing a println(MyStyle) (where MyStyle extends StyleSheet.Inline), but that does not work. It merely prints out the object reference. To get it to work, I had to import org.scalajs.dom.raw.HTMLStyleElement and then use the typed renderer MyStyle.render[HTMLStyleElement].outerHTML