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

fix: insert styles before first style tag #218

Merged
merged 2 commits into from
Jul 29, 2024
Merged

Conversation

HADB
Copy link
Contributor

@HADB HADB commented Jul 26, 2024

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

The styles of icons are prepended to head which is not very appropriate.

Screenshots:

iShot_2024-07-26_19 06 43

@antfu
Copy link
Member

antfu commented Jul 26, 2024

The order of style matters for the CSS overrides. Icons CSS should have lower priority than other utils. I am not sure what would be the problem of prepending other than readability. If this is something really matters - we should insert before the first <style tag, but appending is definitely not ideal solution

@HADB HADB force-pushed the fix/head-styles branch from 739be1d to 2981036 Compare July 29, 2024 04:05
@HADB
Copy link
Contributor Author

HADB commented Jul 29, 2024

@antfu Thanks for replying. I modified the code to insert styles before the first style tag for better readability and more compliant with the HTML5 specifications: character-encoding-declaration.

Restriction: The element containing the character encoding declaration must be serialized completely within the first 1024 bytes of the document.

Recommanded: In HTML, to declare that the character encoding is UTF-8, the author could include the following markup near the top of the document (in the head element): <meta charset="utf-8">

Please take a look.

@HADB HADB changed the title fix: append styles instead of prepending fix: insert styles before first style tag Jul 29, 2024
@antfu antfu merged commit aa15b2a into nuxt:main Jul 29, 2024
1 check passed
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.

2 participants