Expose minimal getClassOrder
API without requiring __unstable__loadDesignSystem
#17804
garrett-hopper
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The prettier-plugin-tailwindcss plugin currently depends on using
__unstable__loadDesignSystem
to get access to thegetClassOrder
API. This requires a bit of complex logic to defineloadModule
andloadStylesheet
. (For v4 at least)Ideally
getClassOrder
could be exposed by thetailwindcss
package itself with minimal dependencies, using the same defaultloadModule
andloadStylesheet
logic as the normal build process.My own interest comes from a VSCode extension I wrote to allow sorting of Tailwind classes in Clojure code, where the Prettier plugin would not have worked. (See tailwindcss-clojure-class-sorter/index.js#L113)
Having a dependable class sorting API beyond the Prettier plugin would be very useful in other contexts as well. There are a number of languages/syntaxes that can use tailwindcss-intellisense's
tailwindCSS.experimental.classRegex
option to get completion but are not able to benefit from the Prettier plugin for class sorting.Beta Was this translation helpful? Give feedback.
All reactions