Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sort class attribute on components and custom elements in Astro #129

Merged
merged 5 commits into from
Mar 2, 2023

Conversation

thecrypticace
Copy link
Contributor

Fixes #128

@thecrypticace
Copy link
Contributor Author

@Princesseuh 👋

The original implementation didn't include support for sorting classes on components (maybe was early enough to not need it?). Do you see any problems with supporting this?

@Princesseuh
Copy link
Contributor

Princesseuh commented Mar 1, 2023

@Princesseuh 👋

The original implementation didn't include support for sorting classes on components (maybe was early enough to not need it?). Do you see any problems with supporting this?

Hello! Unlike Vue for example, it's not a built-in pattern in Astro to have a class attribute on component. So I figured it wasn't necessary to include, but I can admit that it's useful and in most most cases it'll be CSS classes in there.

You also probably want to add custom-element in this check, for, well, custom elements.

In both cases, I believe it should be supported, definitely seems useful!

Copy link
Contributor

@Princesseuh Princesseuh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval from the Astro team!

@thecrypticace thecrypticace merged commit 2dd9fcd into main Mar 2, 2023
@reinink reinink deleted the fix/astro-component-class branch March 2, 2023 18:48
@reinink reinink changed the title Add support for sorting class attribute on Astro components Sort class attribute on components and custom elements in Astro Mar 2, 2023
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.

Classes on custom Astro components aren't getting sorted
2 participants