Giter Club home page Giter Club logo

Comments (5)

hudochenkov avatar hudochenkov commented on September 16, 2024

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.

nickngqs avatar nickngqs commented on September 16, 2024

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.

hudochenkov avatar hudochenkov commented on September 16, 2024

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.

nickngqs avatar nickngqs commented on September 16, 2024

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.

hudochenkov avatar hudochenkov commented on September 16, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.