Skip to content

Conversation

@souhe
Copy link
Contributor

@souhe souhe commented Nov 8, 2020

This PR adds a possibility to pass the default theme in PaperProvider. See the original Paper docs.

In addition to that I added missing animation theme property.

After those changes it is for example possible to create a theme based on a default one. Just like this:

// Theming.re
let theme =
  ThemeProvider.(
    Theme.make(
      ~colors=
        Theme.Colors.make(
          ~primary="red",
          ~accent="blue",
          ~background=defaultTheme->Theme.colors->Theme.Colors.background,
          ~surface=defaultTheme->Theme.colors->Theme.Colors.surface,
          ~error=defaultTheme->Theme.colors->Theme.Colors.error,
          ~text="black",
          ~disabled=defaultTheme->Theme.colors->Theme.Colors.disabled,
          ~placeholder=defaultTheme->Theme.colors->Theme.Colors.placeholder,
          ~backdrop=defaultTheme->Theme.colors->Theme.Colors.backdrop,
        ),
      ~fonts=defaultTheme->Theme.fonts,
      ~roundness=4,
      ~dark=false,
      ~animation=defaultTheme->Theme.animation,
      (),
    )
  );

and use it like this:

// App.re
<Paper.PaperProvider theme=Theming.theme>
   <YourApp />
</Paper.PaperProvider>

@MoOx MoOx requested a review from DCKT November 9, 2020 07:12
@DCKT DCKT merged commit 2f1e136 into rescript-react-native:master Nov 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants