These are chat archives for japgolly/scalacss

Apr 2015
Chandra Sekhar Kode
Apr 17 2015 13:49
whats the best way to define stylesheets for resuable components ?
This message was deleted
object NewStyle extends ReactListView.Style {
override val listGroup  = style(super.listGroup // this is not possible as its val ,
paddingLeft(2 px))

ReactListView(items = List(“scala”,”scalajs”) , style = NewStyle)
how can i acheive something similar to that !
David Barri
Apr 17 2015 22:09
oh jeez, I didn't know Scala doesn't allow super with vals. That's annoying.
I guess you could do
    def listGroupMixin = mixin(marginBottom(20.px),
      &.firstChild.lastChild(borderBottomLeftRadius(4 px),
        borderBottomRightRadius(4 px))
    val listGroup = style(listGroupMixin)
override val listGroup  = style(
   listGroupMixin, paddingLeft(2 px))
Alternatively, you could do this which is a bit of a hack, but less work:
object NewStyle extends ReactListView.Style {
  val original = new ReactListView.Style
  override val listGroup = style(,
    paddingLeft(2 px))
Anton Kulaga
Apr 17 2015 23:40
I prefer to use lazy vals instead of vals where possible as it decreases risks of some errors