Skip to content

Refactor HTML to remove type attribute from style tags#1294

Open
pardeyke wants to merge 1 commit intobasecamp:mainfrom
pardeyke:main
Open

Refactor HTML to remove type attribute from style tags#1294
pardeyke wants to merge 1 commit intobasecamp:mainfrom
pardeyke:main

Conversation

@pardeyke
Copy link
Copy Markdown

@pardeyke pardeyke commented Apr 1, 2026

This pull request standardizes the way CSS stylesheets and style elements are included throughout the project by removing the unnecessary type="text/css" attribute from <link> and <style> tags. This change simplifies the code and aligns with current HTML standards, as specifying the type is no longer required.

Copilot AI review requested due to automatic review settings April 1, 2026 18:04
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR aligns the project’s HTML/CSS inclusion patterns with modern HTML standards by removing the redundant type="text/css" attribute from <style> and stylesheet <link> tags across source, docs, test fixtures, and the Action Text bundled build.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Changes:

  • Removed type="text/css" from dynamically created <style> elements used for per-custom-element default CSS.
  • Updated test fixtures and test helper HTML-injection to use bare <style> tags.
  • Updated documentation and static HTML assets to omit type="text/css" on stylesheet links and style blocks.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/trix/core/helpers/custom_elements.js Stops setting type="text/css" on injected <style> elements (keeps nonce + data attributes intact).
action_text-trix/app/assets/javascripts/trix.js Mirrors the same removal in the bundled Action Text JS artifact.
src/test/test_helper.js Updates global test <style> injection to omit the type attribute.
src/test/test_helpers/fixtures/editor_with_styled_content.js Updates fixture <style> tag to omit the type attribute.
src/test/test_helpers/fixtures/editor_with_bold_styles.js Updates fixture <style> tag to omit the type attribute.
src/test/test_helpers/fixtures/editor_with_block_styles.js Updates fixture <style> tag to omit the type attribute.
README.md Updates CDN usage example to omit type="text/css" on the stylesheet link.
assets/test.html Updates stylesheet link to omit type="text/css".
assets/index.html Updates stylesheet link and inline <style> to omit type="text/css".

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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