Comments (5)
stylelint-order uses internally postcss-sorting for autofix linting errors. If you want just sorting functionality without linting, then you need postcss-sorting only. For Sublime Text install PostCSS Sorting package, and then configure it.
What exactly do you want to achieve? What is your current setup and config?
from postcss-sorting.
Essentially i was using postcss-sorting to style format my scss. I have order and order groups and space in between to sort of format and beautify the spaces and order groupings. Should i go back to using v2? Im trying to find options for v2 and can't seem the locate them since they've move to v3 docs.
For example
.a {
margin:50px
font-weight: 20px;
padding: 20px;
font-size: 15px;
}
becomes
.a {
margin:50px
padding: 20px;
font-size: 15px;
font-weight: 20px;
}
from postcss-sorting.
Now I understand. v3 doesn't care about empty lines, only about order. To achieve what you want you to need to setup stylelint with stylelint-order plugin. And run stylelint --fix
. I'm not aware of packages for Sublime Text which could run stylelint --fix
on save. I think it's possible to create a build system in ST, and use SublimeOnSaveBuild package to run this build system on save.
In your case it might be easier to stick to v2 for Sublime Text plugin, if you don't use stylelint.
P. S. If you don't use stylelint, I highly recommend to start using it. It helps avoid errors in CSS.
from postcss-sorting.
Ahh now that make sense, cause I only know of having npm run stylelint --fix on safe. I had the initial idea that postcss-sort will use stylelint internally. In the case, can you point me to your own v2 options list?
My current issue is actually trying to place certain at rules of include seprately. How would you advise me to do that?
.a {
@include grid-column(2)
@include grid-container()
@include media() {
}
}
to a line in between for specific at rules -> in this case is @include media()
.a {
@include grid-column(2)
@include grid-container()
@include media() {
}
}
Right now my config only allows to include all at rules of @include
from postcss-sorting.
Here are the latest v2 docs. You can't enforce empty line between includes. But you can group them:
{
"order": [
...,
{
type: 'at-rule',
name: 'include',
parameter: 'grid-column'
},
{
type: 'at-rule',
name: 'include',
parameter: 'grid-container'
},
{
type: 'at-rule',
name: 'include',
parameter: 'media'
}
]
}
from postcss-sorting.
Related Issues (20)
- Bootstrap 5 support? HOT 8
- CSS in HTML HOT 1
- Feature request: sort simple media queries by query parameter values HOT 1
- 01:24:53 [vite] Internal server error: Cannot read properties of undefined (reading 'length') HOT 2
- Error when using with postcss-sass: Cannot read properties of undefined (reading 'includes') HOT 2
- suggestion: wildcards to prevent re-ordering to affect the visual outcome HOT 1
- SASS mixins not getting sorted alphabetically HOT 1
- Error when run with error `TypeError: Cannot read property 'includes' of undefined` HOT 1
- Support for alphabetical sort with specific properties before all HOT 1
- postcss-sorting not working as expected HOT 6
- security vulnerability PostCSS HOT 1
- Extend sorting rule from another file HOT 1
- Less variables order in declaration block HOT 3
- Feature request: Non-standard CSS compatible HOT 2
- Could we support *.vue file? HOT 5
- Compine at rules with properties in sorting HOT 1
- rule sorting HOT 3
- Using astroturf composes HOT 4
- Add limited sorting support for CSS-in-JS with interpolation HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from postcss-sorting.