Skip to content

Color it up! #52

@JiashuHarryHuang

Description

@JiashuHarryHuang

Tasks

  • Turn color code into constants.
  • Add a ThemeProvider that wraps the Layout. Refer to _app.tsx in bookem-user. Documentation is here
  • Add color to main page.
  • Add color to volunteer table.

Book'em User Examples

  • To pass color name as props:
    const IconText = styled.span<{ color: string }>`
      color: ${props => props.color};
      font-family: ${props => props.theme.fonts.PRIMARY};
      font-style: normal;
      font-weight: 400;
      @media (max-width: 767px) {
        font-size: 20px;
      }
      @media (min-width: 768px) {
        font-size: 15px;
      }
      line-height: 24px;
    `;
      <IconText
      color={
        activeRoute === iconParam.linkTo
          ? BOOKEM_THEME.colors.WHITE
          : BOOKEM_THEME.colors.BOOKEM_BLACK
      }>
      {iconParam.text}
    </IconText>
    
  • To pass color directly into styled components
      export const SignupButton = styled.button`
      color: ${props => props.theme.colors.WHITE};
      border: none;
      padding: 12px;
      border-radius: 10px;
    
      &:hover {
        cursor: pointer;
      }
    
      // Desktop
      @media (min-width: 768px) {
        width: 150px;
        margin-top: 30px;
        background: ${props => props.theme.colors.BOOKEM_RED};
        font-size: 25px;
      }
    
      // Mobile
      @media (max-width: 767px) {
        width: 120px;
        height: 40px;
        background: ${props => props.theme.colors.BOOKEM_BLACK};
    
        font-family: ${props => props.theme.fonts.PRIMARY};
        font-style: normal;
        font-weight: 400;
        font-size: 16px;
        line-height: 19px;
      }
    `;
    

Metadata

Metadata

Assignees

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