@artifak/pxtoem
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

@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')};
`;

Readme

Keywords

Package Sidebar

Install

npm i @artifak/pxtoem

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

7.68 kB

Total Files

15

Last publish

Collaborators

  • heyjules