Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
feat: add
<svelte:html>
element #14397base: main
Are you sure you want to change the base?
feat: add
<svelte:html>
element #14397Changes from 1 commit
81bd131
5ba013e
d61291e
a88e814
0c1c8b9
8634231
0a95949
8f8a5b1
6bf6c74
dd748e2
8df29aa
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Someone might have an existing classname in their HTML template, in which case giving them a string would make it awkward to combine stuff. Should we return an object instead of a string, so that they have more flexibility?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I briefly thought about that but it seemed unnecessary - in which case would you have existing attributes on a html tag but in such a way that you know which ones to then merge them in some way? Even if, the regex for adjusting the html attributes string would be straightforward. So I opted for making the simple case more ergonomic.
It is an interesting question for SvelteKit specifically though, which currently sets
lang="en"
inapp.html
by default. What would we do here? (regardless of whether we return a string or an object). The easiest would be to havelang="en"
after the string and rely on browser being forgiving about it (they ignore duplicate attributes) / the user removing it in case they set it themselves in<svelte:html>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it only really matters for new projects, I think, since we can't retroactively add
%htmlAttributes%
anyway. I think we just replacelang="en"
with%htmlAttributes%
in the template project'sapp.html
, and add this to the root layout: