timelessco / chakra-components

Components built on top of Chakra UI
MIT License
1 stars 0 forks source link

[RFC] Heading and Paragraph Components #30

Closed navin-moorthy closed 4 years ago

navin-moorthy commented 4 years ago

Intro

image We will be creating the Text component for body1, body2 & body3 as p tag and Heading component for Headings as h1, h2.

The Goal:

Create <Text />,<Text.Body1 />, <Text.Body2 />, <Text.Body3 /> for Paragraphs. Create <Heading>, <Heading.H1 />, <Heading.H2 /> for Headings.

Key Features:

Export:

Component Parts

Usage

Heading

<Heading>No Styling</Heading>
<Heading.H1>Heading 1</Heading.H1>
<Heading.H2>Heading 2</Heading.H2>

Paragraph

<Text>No Styling</Text>
<Text.Body1>Body 1</Text.Body1>
<Text.Body2>Body 2</Text.Body2>
<Text.Body3>Body 3</Text.Body3>

Props

theme.js:

import React from 'react';
import { theme } from '@chakra-ui/core';

export default {
  ...theme,
  lineHeights: {
    ...theme.lineHeights,
    h1: '24px',
    h2: '20px',
    body1: '19px',
    body2: '17px',
    body3: '16px',
  },
  colors: {
    ...theme.colors,
    font: {
      heading: '#282929',
      body1: '#8C8D8E',
      body2: '#5D5E5E',
      body3: '#282929',
    },
  },
  fontSizes: {
    ...theme.fontSizes,
    h1: '20px',
    h2: '16px',
    body1: '15px',
    body2: '14px',
    body3: '13px',
  },
  letterSpacings: {
    h1: '0.2px',
    h2: '0.18px',
    body1: '-0.15px',
    body2: '-0.14px',
  },
  fonts: {
    ...theme.fonts,
    heading: `Inter,${theme.fonts.heading}`,
    body: `Inter,${theme.fonts.body}`,
  },
};
prasanna1211 commented 4 years ago

Closing this. Merged already.

navin-moorthy commented 4 years ago

If anyone interested, use this RFC template for the new RFC.