1.3.0 • Published 6 years ago

mapped-classes v1.3.0

Weekly downloads
22
License
-
Repository
github
Last release
6 years ago

Installation

npm i mapped-classes --save

Usage

import createMapper from 'mapped-classes';

const useMapper = createMapper({
  breakpoints: [null, 'md', 'lg'],
  mappings: {fontSize: 'font-size', padding: 'p'},
  getter: ({breakpoint, root, value}) =>
    [breakpoint, root, value]
      .filter(x => x || x === 0)
      .join('-')
});
 
const classNames = useMapper({ 
  fontSize: 1,
  padding: [1, 2, 3]
}); 

// 'font-size-1 p-1 md-p-2 lg-p-3'

License

MIT © Sam Tietjen

1.3.0

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.0

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago