Skip to content

fix(runtime): place scoped component styles after preconnect links but before custom styles#5938

Merged
christian-bromann merged 5 commits intomainfrom
cb/fix-style-tag-location
Aug 14, 2024
Merged

fix(runtime): place scoped component styles after preconnect links but before custom styles#5938
christian-bromann merged 5 commits intomainfrom
cb/fix-style-tag-location

Conversation

@christian-bromann
Copy link
Copy Markdown
Member

@christian-bromann christian-bromann commented Aug 12, 2024

What is the current behavior?

This is an enhancement to a fix we made in in #5926 which caused our Nightly build to fail due to the inability to place custom styles in the HTML template as all component styles were injected last in the <head /> tag.

STENCIL-1372

What is the new behavior?

Place scoped component styles after existing preconnect links but allow custom styles to be set at the end of the <head /> tag.

Documentation

I will raise a separate PR to the docs page mentioning this behavior.

Does this introduce a breaking change?

  • Yes
  • No

Testing

Enhanced existing e2e test.

Other information

n/a

@christian-bromann christian-bromann requested a review from a team as a code owner August 12, 2024 19:53
Copy link
Copy Markdown
Contributor

@tanner-reits tanner-reits left a comment

Choose a reason for hiding this comment

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

Tested this out with the failing Framework test and still having the same issue. If there are no preconnect links, can we insert the styles where they were going before (i.e. before the first link tag)?

@christian-bromann
Copy link
Copy Markdown
Member Author

Good catch @tanner-reits , I totally missed that use case but added a change with a test.

Copy link
Copy Markdown
Contributor

@tanner-reits tanner-reits left a comment

Choose a reason for hiding this comment

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

Looks good in the Framework test case 👍

@christian-bromann christian-bromann added this pull request to the merge queue Aug 14, 2024
Merged via the queue into main with commit 8f92b11 Aug 14, 2024
@christian-bromann christian-bromann deleted the cb/fix-style-tag-location branch August 14, 2024 00:17
@christian-bromann
Copy link
Copy Markdown
Member Author

This patch has been published in Stencil v4.21.0!

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