promptu
v6.1.0
Published
Micro CSS-in-JS library
Downloads
26
Readme
Promptu
A micro CSS-in-JS library that provides shorthands for commonly-used CSS rules as well as utility functions for transforming and parsing between CSS-compatible data types. For documentation please visit here.
Setup
$ npm install
# Run tests (against TypeScript source files)
$ npm test
# Build the library
$ npm run build
Usage
Promptu pairs well with Styled Components (or any other CSS-in-JS library). Example use:
import { align, container } from 'promptu'
const StyledRoot = styled.div`
${align.ftl} // Aligns to top left in fixed position
${container.fvtl} // Transforms this div into a flex box where children are vertically top left aligned
`
Normalizing Styles
A raw CSS file for just normalizing rules is generated and packaged into the released module at lib/normalize.css
, which you can access directly via unpkg
.
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://unpkg.com/promptu/lib/normalize.css">
</head>
<body>
</body>
</html>