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

Is there any documentation on styling components? #59

Open
willredington opened this issue May 11, 2023 · 1 comment
Open

Is there any documentation on styling components? #59

willredington opened this issue May 11, 2023 · 1 comment

Comments

@willredington
Copy link

Pretty self-explanatory, but haven't found anything on the documentation online for how to style components.

@kmefeu
Copy link

kmefeu commented Jun 15, 2023

@willredington I found this comment that helped me #33 (comment)

import { Provider, defaultTheme } from '@react-native-material/core'
import React, { ReactNode } from 'react'

interface iThemeProvider {
  children: ReactNode
}

const ThemeProvider: React.FC<iThemeProvider> = ({
  children,
}: iThemeProvider) => {
  return (
    <Provider
      theme={{
        // extend the default theme
        ...defaultTheme,
        palette: {
          primary: { main: '#6750A4', on: '#fff' },
          background: { main: '#001aff', on: '#49454F' },
          secondary: { main: '#fff', on: '#ff0ad6' },
          surface: { main: '#fff', on: '#6750A4' },
          error: { main: '#ff0000', on: '#fff' },
        },
        typography: {
          ...defaultTheme.typography,
          h1: {
            color: '#6750A4',
            fontFamily: 'Roboto_700Bold',
            fontSize: 56,
          },
        },
      }}>
      {children}
    </Provider>
  )
}

export default ThemeProvider

But you will receive this warning anyways

Type '{ children: ReactNode; theme: { palette: { primary: { main: string; on: string; }; background: { main: string; on: string; }; secondary: { main: string; on: string; }; surface: { main: string; on: string; }; error: { ...; }; }; typography: { ...; }; colorScheme: ColorScheme; elevations: Elevations; shapes: Shapes; }...' is not assignable to type 'IntrinsicAttributes & ThemeProviderProps & WindowSizeClassProviderProps & SpacingFuncProviderProps & IconComponentProviderProps'.
  Property 'children' does not exist on type 'IntrinsicAttributes & ThemeProviderProps & WindowSizeClassProviderProps & SpacingFuncProviderProps & IconComponentProviderProps'

I'm just adding some random colors and figuring out how to style it properly

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

No branches or pull requests

2 participants