These are chat archives for chandu0101/scalajs-react-components

10th
Apr 2018
Bijan Chokoufe Nejad
@bijancn
Apr 10 2018 06:21
@rleibman Mui.SvgIcons belongs to Mui so it makes sense that it takes MuiColor for me. Note sure if there are different color types within Mui
Roberto Leibman
@rleibman
Apr 10 2018 14:20

My point was that MuiColor is defined as:

trait MuiColor extends js.Object {
  val action: js.Dynamic                = js.native
  val disabled: js.Dynamic              = js.native
  val error: js.Dynamic                 = js.native
  val inherit: js.Dynamic               = js.native
  val primary: js.Dynamic               = js.native
  val secondary: js.Dynamic             = js.native
}

So, if you use MuiColor for SvgIcon, you'll be limited to these "colors"... I think I'll just make it (if I can) js.UndefOr[MuiColor | String]

Bijan Chokoufe Nejad
@bijancn
Apr 10 2018 14:34
well the proper way is probably to only use these colors. 6 different colors on one page is already plenty from a designer point of view (I was once told to never use more than three :wink: ). But otoh I don't know how to set MuiColor.primary to the color I want and there might be edge cases were it's necessary to overwrite
Roberto Leibman
@rleibman
Apr 10 2018 14:36
Unfortunately with javascript the intent is not always readily apparent, since there's no types, how do I know if the library will take a string like "#FF00FF" as well as "secondary"? And my brain refuses to parse javascript.
Bijan Chokoufe Nejad
@bijancn
Apr 10 2018 14:40
Roberto Leibman
@rleibman
Apr 10 2018 14:46
That would be one of MuiColors... so I should make it MuiColor | MuiColors | String for maximum flexibility
Bijan Chokoufe Nejad
@bijancn
Apr 10 2018 14:47
yeah I guess then