These are chat archives for japgolly/scalacss

14th
May 2015
Matt Hughes
@matthughes
May 14 2015 12:54
@chandu0101 Hmm, mixin works on a regular style declaration, but doesn’t seem to work inside a media query:
  val headerSmall = mixin(
    padding(0 px)
  )
  val header = style(
    headerSmall,
    media.maxWidth(medium px)(
      headerSmall
    )
  )
  /** 
[error]   (h: scalacss.AV,t: scalacss.AV*)scalacss.DslBase.ToStyle <and>
[error]   (avs: scalacss.AVs)scalacss.DslBase.ToStyle
[error]  cannot be applied to (scalacss.StyleS)
[error]     media.maxWidth(medium px)(
[error]                   ^
[error] one error found
*/
Chandra Sekhar Kode
@chandu0101
May 14 2015 15:00
huh no idea then , only @japgolly can answer :)
Matt Hughes
@matthughes
May 14 2015 16:03
anyone successfully use ‘content’ attribute?
style(
    &.before {
      content("foo")
    }
  )
does not compile
bah.
    &.before {
      content := "foo"
      media.maxWidth(medium px)(
        content := "bar"
      )
    }
this works. sorry for the noise..or perhaps this will help someone else along the way.
Matt Hughes
@matthughes
May 14 2015 16:08
actually need to escape the quotes when passing in a literal string
    &.before {
      content := "\"foo\""
    }
Matt Hughes
@matthughes
May 14 2015 19:38
In this example (from StandaloneTests.scala):
  "div.std" - (
    margin(12 px, auto),
    textAlign.left,
    cursor.pointer,

    &.hover -
      cursor.zoomIn,

    &("span") -
      color.red,

    &(media.tv.minDeviceAspectRatio(4 :/: 3) & media.all.resolution(300 dpi)) -
      width(600 px),

    &(media.not.handheld.landscape.color) -
      width(500 px)
   )
is &(“span”) any different than unsafeChild(“span”) ?
and what is the point of the & aroind the last two media declarations?