Modern CSS Formatter for the component age
Installation
with yarn:
yarn add --dev styled-components-stylefmt
or with npm:
npm install --save-dev styled-components-stylefmt
Features
- works just as stylefmt, addind support for formatting styled-components!
Example
;; const Title = styledh1` font-size: 1.5em; text-align: center; color: palevioletred;`; const Wrapper = styledsection` padding : 4em; background: papayawhip ;`;
yields:
;; const Title = styledh1` font-size: 1.5em; text-align: center; color: palevioletred;`; const Wrapper = styledsection` padding: 4em; background: papayawhip;`;
Usage
in command line
CLI help:
styled-components-stylefmt --help
Usage: styled-components-stylefmt [options] input-name [output-name] Options: -b, --config-basedir Path to the directory that relative paths defining \\"extends\\" -c, --config Path to a specific configuration file -d, --diff Output diff against original file -r, --recursive Format list of space seperated files in place -v, --version Output the version number -h, --help Output usage information -i, --ignore-path Path to a file containing patterns that describe files to ignore.
in Node.js
const formatter = const stylefmtOptions = // ... const formatted =
stylelint rules it can handle
All the rules that stylefmt can.