10up Stylelint Config
At 10up, we strive to provide digital products that yield a top-notch user experience. In order to improve both our efficiency and consistency, we need to standardize what we use and how we use it. This theme scaffold allows us to share initial set up procedures to make sure all projects can get up and running as quickly as possible while closely adhering to 10up's high quality standards.
- Node & NPM - 3rd party dependencies are managed through NPM, so you will need that installed globally
- Stylelint - as this is a config extention for Stylelint, you will need Stylelint installed in your main project in order for it to work.
First, install Stylelint:
// NPM npm install stylelint --save-dev // Yarn yarn add stylelint
Then install the 10up Stylelint config:
// NPM npm install @10up/stylelint-config --save-dev
Add the following to your
npm install stylelint-webpack-plugin --save-dev. You should already have the proper loader in
postcss-loader, but if you don't install that as well. After installing stylelint and the configuration above add the following to your Webpack config:
;plugins:configFile: ".stylelintrc" // if your config is in a non-standard placefiles: "src/**/*.css" // location of your CSS filesfix: true // if you want to auto-fix some of the basic rules
Read more about these options at stylelint-webpack-plugin, the main stylelint documentation and postcss-loader. That should be all you need, but if there are any errors in this documentation, please file an issue and let us know!
As of version [x] - this stylelint config as well as stylelint itself, will be included in the theme and plugin scaffolds.
Certain rules / violations can be fixed automatically using the
--fix flag via the command line.
To ensure that Stylelint fixes what it can, you can run:
stylelint path/to/css/file.css --fix`
Active: 10up is actively working on this, and we expect to continue work for the foreseeable future including keeping tested up to the most recent version of WordPress. Bug reports, feature requests, questions, and pull requests are welcome.
We don't know everything! We welcome pull requests and spirited, but respectful, debates. Please contribute via pull requests on GitHub.
- Fork it!
- Create your feature branch:
git checkout -b feature/my-new-feature
- Commit your changes:
git commit -am 'Added some great feature!'
- Push to the branch:
git push origin feature/my-new-feature
- Submit a pull request