Skip to content

Conversation

@bradlc
Copy link
Contributor

@bradlc bradlc commented Aug 31, 2023

This PR adds a new "Sort Selection" command to the extension. When activated this command will sort the selection(s) in the same way that prettier-plugin-tailwindcss sorts lists of CSS classes.

This useful when you want to sort a list of classes that prettier-plugin-tailwindcss does not handle, e.g.

const myVar = 'these classes here'
Sort.Selection.Demo.mov

The command is only available when:

  • The editor has one or more active text selections
  • There is an active Tailwind project for the current active file
  • The Tailwind version for the active Tailwind project is at least 3.0.0
  • The active file is not excluded (via tailwindCSS.files.exclude)

@bradlc bradlc merged commit 1cc8e62 into master Aug 31, 2023
@bradlc bradlc deleted the sort-selection branch August 31, 2023 14:53
@Benbinbin
Copy link

really need "sort classes name" as the built-in feature the extension, maybe take a further step to make this feature as "sort on save" will be more convenient

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants