Skip to content

How to style button with Styled Components #1

@BrianRuizy

Description

@BrianRuizy

How to style button if using styled components as such

  <LyketContainer>
    <Provider 
      apiKey="key_here1231242795"
      theme={{
        colors: {
          primary: "red",
        }
      }}
    >
      <ClapButton
        namespace="posts"
        id={article.slug.replace(/\//g, '')}
      />
    </Provider>
  </LyketContainer>
const LyketContainer = styled.div`
  background: ${p => p.theme.colors.secondary};
  ...
`;

Can't use ${p => p.theme.colors.secondary} inline:

...
theme={{
    colors: {
      primary: "${p => p.theme.colors.secondary},
    }
  }}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions