These are chat archives for japgolly/scalacss

25th
May 2016
Olivier Blanvillain
@OlivierBlanvillain
May 25 2016 05:47

@Bhagyashree-B I think you can get this error by having the following two imports in scope:

import scalacss.Defaults._
import scalacss.ScalaCssReact._

You could try removing either one from top level and import them just where needed:

{
  import scalacss.ScalaCssReact._
  Style.addToDocument()
}
Can wait for scala 2.12 to bring the new @implicitAmbiguous annotation :D
Phuoc Nguyen
@nghuuphuoc
May 25 2016 06:09
How I can create something like mixin in LESS. For example
a mixin position(absolute, 0 0 null null)could produce
style(
  position.absolute,
  top.`0`,
  right.`0`
)
Olivier Blanvillain
@OlivierBlanvillain
May 25 2016 06:21

@nghuuphuoc

import dsl._

val common = mixin(
  backgroundColor.green
)

val outer = style(
  common, // Applying our mixin
  ...
)

?
(source)

Phuoc Nguyen
@nghuuphuoc
May 25 2016 06:28
@OlivierBlanvillain Thanks for the suggestion. Can we put the params to the mixin since I need dynamic styles
Olivier Blanvillain
@OlivierBlanvillain
May 25 2016 06:32
What do you mean by dynamic style?
I never used styleF, but I think something like this could work:
def common(m: Int) = mixin(
  marginRight(m.px),
  backgroundColor.green
)
Phuoc Nguyen
@nghuuphuoc
May 25 2016 06:34
Yes, it's what I want exactly
Let's me give it a try now