constverum / Stylelint Config Rational Order
Licence: apache-2.0
Stylelint config that sorts related property declarations by grouping together in the rational order 🚦
Stars: ✭ 313
Programming Languages
javascript
184084 projects - #8 most used programming language
Projects that are alternatives of or similar to Stylelint Config Rational Order
stylelint-config-twbs-bootstrap
Stylelint config for Bootstrap
Stars: ✭ 115 (-63.26%)
Mutual labels: stylelint
react-component-library-lerna
Build your own React component library managed with lerna, presented with storybook and published in private npm registry.
Stars: ✭ 55 (-82.43%)
Mutual labels: stylelint
the-joy-of-css
How to touch a users eyes without hurting them or freaking out.
Stars: ✭ 17 (-94.57%)
Mutual labels: stylelint
Vscode Stylelint
A Visual Studio Code extension to lint CSS/SCSS/Less with stylelint
Stars: ✭ 260 (-16.93%)
Mutual labels: stylelint
dva-typescript-antd-starter-kit
A admin dashboard application demo based on antd by typescript and dva
Stars: ✭ 61 (-80.51%)
Mutual labels: stylelint
react-js-boilerplate
A React + Redux + HOT + Webpack + Material-UI + Sass boilerplate
Stars: ✭ 14 (-95.53%)
Mutual labels: stylelint
stylelint-processor-glamorous
💄 Lint glamorous and related css-in-js with stylelint
Stars: ✭ 18 (-94.25%)
Mutual labels: stylelint
electron-vue-boilerplate
Simple boilerplate for building Vue app with Electron and Webpack.
Stars: ✭ 53 (-83.07%)
Mutual labels: stylelint
Stylelint Config Recommended
The recommended shareable config for stylelint
Stars: ✭ 255 (-18.53%)
Mutual labels: stylelint
vscode-stylelint-plus
A Visual Studio Code extension to lint CSS/SCSS/Less with stylelint, support auto fix on save.
Stars: ✭ 32 (-89.78%)
Mutual labels: stylelint
vue-cli-plugin-stylelint
Vue cli 3.x plugin for stylelint
Stars: ✭ 48 (-84.66%)
Mutual labels: stylelint
Web Configs
Common configurations for building web apps at Shopify
Stars: ✭ 302 (-3.51%)
Mutual labels: stylelint
starbase
⭐ Production-ready website boilerplate made with webpack 5, modern JS (via Babel 7) & Sass
Stars: ✭ 70 (-77.64%)
Mutual labels: stylelint
stylelint-config-rational-order
Stylelint config that sorts related property declarations by grouping together following the order:
- Positioning
- Box Model
- Typography
- Visual
- Animation
- Misc
.declaration-order {
/* Positioning */
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 10;
/* Box Model */
display: block;
float: right;
width: 100px;
height: 100px;
margin: 10px;
padding: 10px;
/* Typography */
color: #888;
font: normal 16px Helvetica, sans-serif;
line-height: 1.3;
text-align: center;
/* Visual */
background-color: #eee;
border: 1px solid #888;
border-radius: 4px;
opacity: 1;
/* Animation */
transition: all 1s;
/* Misc */
user-select: none;
}
Usage
- Add
stylelint
,stylelint-order
and this package to your project:
npm install --save-dev stylelint stylelint-order stylelint-config-rational-order
# or, if you prefer yarn over npm:
yarn add --dev stylelint stylelint-order stylelint-config-rational-order
- Add this package to the end of your extends array inside Stylelint configuration (.stylelintrc for example):
{
"extends": [
// "stylelint-config-standard",
"stylelint-config-rational-order"
]
}
This shareable config contains the following:
{
"plugins": [
"stylelint-order",
"stylelint-config-rational-order/plugin"
],
"rules": {
"order/properties-order": [],
"plugin/rational-order": [true, {
"border-in-box-model": false,
"empty-line-between-groups": false,
}]
}
}
Since it adds stylelint-order
and stylelint-config-rational-order
to plugins and also adds required rules, you don't have to do this yourself when extending this config.
Optional options / rules
border-in-box-model
Defines to which group the border property belongs to.
If true
border property belongs to the box model section.
The default value is false
(border property belongs to the visual section).
empty-line-between-groups
If true
adds an empty line between groups. The default value is false
.
FAQ
Why should I use the rational order and group and sort CSS properties by type instead of alphabetical order?
The pros and cons of both ways in detail:
Credits
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].