Replies: 1 comment
-
@codevogel have you found a better way of doing the ordering for the tailwind classes? I have the same situation here and have not found a very developer-friendly way of doing this. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Either I'm doing something silly, or this workflow is just very silly and might need to be improved.
I am working on an Umbraco project, which uses
.cshtml
files, or Razor files. Basically, html with .NET code embedded in it.There is currently only support for class ordering through the
prettier-plugin-tailwindcss
. Prettier does not, however, support.cshtml
files. I tried installing prettier and the tailwind prettier plugin, and adding this to my.prettierrc.json
Then I ran
npx prettier --write . --plugin tailwindcss
, but no changes were made to my.cshtml
files.I found a botchy workaround, with the emphasis on botchy:
settings.json
Code is combined and put on line:
After a prettier run through VSCode as an HTML document:

After an autoformat in rider the syntax is still broken and needs manual edits:

I jump back into Rider and run the .cshtml formatter there, to undo the prettier formatting that was applied to the embedded C# code.
I now have my tailwind classes sorted in my Razor file.
I could think of a few ways to automate this process, but that just feels very botchy to me. It would be nice to have native support for formatting tailwind in Razor files.
Beta Was this translation helpful? Give feedback.
All reactions