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.
This PR addresses an issue in theme switching functionality. Previously, the theme switcher was not correctly removing the link to the dark theme CSS file due to a mismatch between absolute and relative URLs.
The issue arose because when setting
themeLink.href = '/dark.css';
, the browser automatically converted this relative URL to an absolute URL, which includes the protocol and domain. As a result,themeLink.href
becamehttp://localhost:5600/dark.css
instead of the expected/dark.css
.To resolve this, I've updated the code to use the URL object to extract the pathname (the relative URL) from
themeLink.href
. This ensures that we're correctly targeting the link element to remove when switching themes.Summary:
This PR fixes the theme switching by using the
URL
object to correctly target the link element for removal inTheme.vue
.Key points:
Theme.vue
URL
object to parsethemeLink.href
Generated with ❤️ by ellipsis.dev