Coder Social home page Coder Social logo

enzo-mourany / css-property-sorter Goto Github PK

View Code? Open in Web Editor NEW
11.0 3.0 1.0 408 KB

VSCode extension that allows to sort css properties in a logical and consistent order

Home Page: https://marketplace.visualstudio.com/items?itemName=EnzoMourany.css-property-sorter

License: MIT License

TypeScript 100.00%
css css-properties vscode vscode-extension sass scss extension linter prettier typescript

css-property-sorter's Introduction

I'm a freelance web and mobile developer based in France, on Périgueux

css-property-sorter's People

Contributors

enzo-mourany avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

lhari

css-property-sorter's Issues

Not working on my machine

It's not working on my vs code setup, either run it with command command palette, or via status bar, i'm still trying to figure out why but here some error if it's help.
Capture

[Feature Request] Support for CSS-in-JS like styled components

I'd like to see this workflow if possible

  1. Highlight/select css-in-js object properties such as those used in Emotion and Styled Components.
  2. Type ctrl+p and select format selection with CSS Property Sorter.

Screenshot example of selected properties from CSS-in-JS object:
Screenshot 2023-06-08 at 10 08 43 AM

[Bug] Media queries and intendation break

Indentation and nesting for rules inside media queries are messed up when sorting properties.

Before After
before after

Actually, indentation higher than 1 levels breaks anywhere, for that matter.

Don't sort @keyframes properties

Sort.ts don't have to sort @Keyframes properties, like on this example :

Before :

section
{
        min-height: 100vh;
	justify-content: center;
	align-items: center;
	display: flex;
	background: #1c1c25;
}

@keyframes identifier
{
	0%
	{
		transform: translateX(-100%);
	}
	100%
	{
		transform: translateX(0);
	}
}

After

section
{
	display: flex;
	justify-content: center;
	align-items: center;
        min-height: 100vh;
	background: #1c1c25;
}

@keyframes identifier
{
	0%
	{
		transform: translateX(-100%);
	}
	100%
	{
		transform: translateX(0);
	}
}

The keyframes part must remain as it is after sort.

Idea to add

Sometimes, we miss to put the semicolon, it can be great if the extension patch the error when we sort the css, cause there's no error if there's no semicolon at the line before the closing bracket. I hade to repair that for 5 lines, so not a big problem, but will be a good feature. Great work 👏🏻👏🏻

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.