euphoria-spacing
Euphoria!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!! MOVED TOA Euphoria.css utility library to create margin and padding classes in your CSS-to-JS projects.
This module returns a string of class names you can then inject into a page, using something like glamor.
We automatically inject none
classes for padding and spacing (eg .p-none { padding: 0; }
) and auto
classes for margins (eg .m-auto { margin: auto; }
).
NOTE: Currently this only works with ES6 support using Babel or Node 7.x+.
Installation
# with yarn: yarn add euphoria-spacing # with npm npm i -S euphoria-spacing
Usage
This module can be used in many ways. For example, using glamor, you would do the following:
css
Now you will have the following classes available to you:
// //
Calling spacing
without arguments will get you the default spacing mapping, which is:
xxs: '0.25rem' xs: '0.5rem' sm: '0.75rem' md: '1rem' lg: '1.75rem' xl: '3.25rem' xxl: '5rem'
Changelog
v0.4.0
- Make all styles add
!important
suffix.
v0.3.0
- Automatically insert
none
classes since they're expected as defaults.
v0.2.0
- Add margin auto helpers:
.m-auto
,.ml-auto
,.mr-auto
,.mb-auto
,.mt-auto
,.mx-auto
,.my-auto
v0.1.1
- Remove flow cruft
v0.1.0
- Initial release!
License
MIT
Credits
Dana Woodman