@artifak/pxtorem

A utility function to convert PX values to REM.

Usage no npm install needed!

<script type="module">
  import artifakPxtorem from 'https://cdn.skypack.dev/@artifak/pxtorem';
</script>

README

@artifak/pxtorem

A utility function to convert px values to rem.

Installation

Yarn

yarn add @artifak/pxtorem

NPM

npm install @artifak/pxtorem

Usage

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

export const Container = styled.div`
  margin: 0 auto;
  width: 100%;
  background: #000;
  font-size: ${pxToRem('48px')};
`;