0.1.0 • Published 4 years ago

@alexseitsinger/react-text-components v0.1.0

Weekly downloads
-
License
BSD-2-Clause
Repository
github
Last release
4 years ago

Text Components

Components for displaying text. Best used with a global font-size: 10px.

Installation

yarn add @alexseitsinger/react-text-components

Exports

setTheme

Set the configuration settings for the components to use.

import { setTheme } from "@alexseitsinger/react-text-components"

setTheme({
  normalSize: 14,
  dark: "#666",
  darker: "#444",
  darkest: "#222",
  light: "#AAA",
  lighter: "#CCC"
  lightest: "#EEE",
})

Headings

All headings have font: inherit and font-weight: 600

NameDescription
BigHeadingh3 tag with font-size: <NORMAL_SIZE> + 6px
BiggerHeadingh2 tag with font-size: <NORMAL_SIZE> + 12px
BiggestHeadingh1 tag with font-size: <NORMAL_SIZE> + 18px
SmallHeadingh4 tag with font-size: <NORMAL_SIZE> - 1px
SmallerHeadingh5 tag with font-size: <NORMAL_SIZE> - 2px
SmallestHeadingh6 tag with font-size: <NORMAL_SIZE> - 3px

Sizes

All sizes accept the following props:

NameDescriptionDefaultRequired?
isBlockUse display: blockundefinedno
NameDescription
NormalTextspan tag with font-size: <NORMAL_SIZE>
BigTextspan tag with font-size: <NORMAL_SIZE> + 2px
BiggerTextspan tag with font-size: <NORMAL_SIZE> + 4px
BiggestTextspan tag with font-size: <NORMAL_SIZE> + 6px
SmallTextspan tag with font-size: <NORMAL_SIZE> - 1px
SmallerTextspan tag with font-size: <NORMAL_SIZE> - 2px
SmallestTextspan tag with font-size: <NORMAL_SIZE> - 3px

Weights

NameDescription
BoldTextspan tag with font-weight: 500
BoldestTextspan tag with font-weight: 600

Colors

All colors require the theme to be set at runtime via setTheme.

NameDescription
DarkTextspan tag with color: <DARK>
DarkerTextspan tag with color: <DARKER>
DarkestTextspan tag with color: <DARKEST>
LightTextspan tag with color: <LIGHT>
LighterTextspan tag with color: <LIGHTER>
LightestTextspan tag with color: <LIGHTEST>

Special

NameDescription
InsetTextspan tag with color: <DARK> and text-shadow: 0 1px 0 #FFFFFF
SuperTextspan tag using both BoldestText and SmallerText with text-transform: uppercase