0.2.1 • Published 5 years ago

@normalize-in-js/styled-components v0.2.1

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

Normalize in JS - Styled Components

Installation

Yarn

yarn add @normalize-in-js/styled-components

NPM

npm install @normalize-in-js/styled-components

Usage

Normalize

import { Normalize } from '@normalize-in-js/styled-components';

function App() {
  return <Normalize />;
}

Reset

import { Reset } from '@normalize-in-js/styled-components';

function App() {
  return <Reset />;
}

Sanitize

import {
  Sanitize,
  SanitizeTypography,
  SanitizeForms,
  SanitizePage,
} from '@normalize-in-js/styled-components';

function App() {
  return (
    <>
      <Sanitize />
      <SanitizeTypography />
      <SanitizeForms />
      <SanitizePage />
    </>
  );
}

Preflight

import { Preflight } from '@normalize-in-js/styled-components';

function App() {
  return <Preflight />;
}

With Config

import { createPreflightStyle } from '@normalize-in-js/styled-components';

const CustomPreflight = createPreflightStyle({
  fontFamilySans: `"Comic Sans MS", cursive, sans-serif`,
  fontFamilyMono: `"Lucida Console", Monaco, monospace`,
  borderColor: 'rebeccapurple',
});

function App() {
  return <CustomPreflight />;
}

With Theme

import { Preflight, normalizeTheme } from '@normalize-in-js/styled-components';
import { ThemeProvider } from 'styled-components';

function App() {
  return (
    <ThemeProvider
      theme={{
        [normalizeTheme]: {
          fontFamilySans: `"Comic Sans MS", cursive, sans-serif`,
          fontFamilyMono: `"Lucida Console", Monaco, monospace`,
          borderColor: 'rebeccapurple',
        },
      }}
    >
      <Preflight />
    </ThemeProvider>
  );
}

Theme Config

PropertyDefault
fontFamilySanssystem-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"
fontFamilyMonoSFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace
borderColorcurrentColor
0.2.1

5 years ago

0.2.0

5 years ago

0.1.0

5 years ago