Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement switch%cx #434

Open
davesnx opened this issue Mar 8, 2024 · 0 comments
Open

Implement switch%cx #434

davesnx opened this issue Mar 8, 2024 · 0 comments
Labels
feature New feature good first issue Good for newcomers

Comments

@davesnx
Copy link
Owner

davesnx commented Mar 8, 2024

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)]
  };
@davesnx davesnx added feature New feature good first issue Good for newcomers labels Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant