Skip to content

Implement switch%cx #434

Open
Open
@davesnx

Description

@davesnx

Similar on how switch%style_label works, but with cx

let boxBackground = bg =>
  switch%style_label (bg) {
  | Transparent => []
  | Sheet => [backgroundColor(Color.Background.box), boxShadows(BoxShadow.elevation1)]
  | SheetWithShadowElevation3 => [backgroundColor(Color.Background.box), boxShadows(BoxShadow.elevation3)]
  | SidebarItemSelected => [backgroundColor(Color.Background.sidebarItemSelected)]
  | AccentMuted => [backgroundColor(Color.Background.accentMuted)]
  | NavBarWithShadow => [
      backgroundColor(ColorAlt.Background.box),
      boxShadow(Shadow.box(~inset=true, ~y=`px(-1), Color.Border.lineAlpha)),
    ]
  | NavBar => [backgroundColor(ColorAlt.Background.box)]
  | Code => [backgroundColor(Color.Background.codeAlpha)]
  | Dark => [backgroundColor(Color.Background.boxDark)]
  };

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions