1.0.1 • Published 3 years ago

@artifak/pxtoem v1.0.1

Weekly downloads
4
License
MIT
Repository
github
Last release
3 years ago

@artifak/pxtoem

A utility function to convert px values to em.

Installation

Yarn

yarn add @artifak/pxtoem

NPM

npm install @artifak/pxtoem

Usage

import { pxToEm } from 'artifak';
import styled from 'styled-components';

export const Container = styled.div`
  margin: 0 auto;
  width: 100%;
  background: #000;
  padding-left: ${pxToEm('16px')};
  padding-right: ${pxToEm('16px')};
`;