These are chat archives for japgolly/scalacss

Jun 2015
Yuriy Badalyantc
Jun 22 2015 12:52

I need some help with styleC. I tried to create minimal example with styleC. I used example from the docs. Here is my code:

package main

import scalacss.Defaults._

object MyStyles extends StyleSheet.Inline {
  import dsl._

  val example = styleC {
    val top = styleS(display.block)
    val lbl = styleS(fontWeight.bold)
    val chk = styleS(, marginLeft(1 ex))
    top.named('outer) :*: lbl.named('label) :*: chk.named('checkbox)

object Main extends App {
  val st = MyStyles.example('outer   )(outerStyle =>
                          _('label   )(labelStyle =>
                          _('checkbox)(inputStyle =>


The first thing - it doesn't compile. The second - I don't fully understand how should I use styleC styles. I just tried to return true for now. And the third - is this syntax is the only syntax that can solve this issue (on the lib level)? It looks really awkward and unreadable.

Compile error:
[info] Compiling 2 Scala sources to /data/IT/Projects/tmp/scalacss-test/target/scala-2.11/classes...
[error] /data/IT/Projects/tmp/scalacss-test/src/main/scala/main/Main.scala:17: type mismatch;
[error]  found   : Symbol
[error]  required: Symbol with shapeless.tag.Tagged[String("outer")]
[error]   val st = MyStyles.example('outer   )(outerStyle =>
[error]                             ^
[error] /data/IT/Projects/tmp/scalacss-test/src/main/scala/main/Main.scala:18: missing parameter type for expanded function ((x$3) => x$3(scala.Symbol("label"))(((labelStyle) => ((x$4) => x$4(scala.Symbol("checkbox"))(((inputStyle) => true))))))
[error]     _('label   )(labelStyle =>
[error]     ^
[error] two errors found
[error] (compile:compileIncremental) Compilation failed
[error] Total time: 1 s, completed Jun 22, 2015 6:48:22 PM
Chandra Sekhar Kode
Jun 22 2015 14:18
Yuriy Badalyantc
Jun 22 2015 16:23