Skip to content

fix: let the app's htmlAttributes/bodyAttributes take precedence over the ones set by Vike extensions - #249

Open
nitedani wants to merge 1 commit into
mainfrom
claude/tag-attributes-precedence-ljv9nc
Open

nitedani wants to merge 1 commit into
mainfrom
claude/tag-attributes-precedence-ljv9nc

Conversation

@nitedani

@nitedani nitedani commented Sep 18, 2026

Copy link
Copy Markdown
Member

Problem

The values of the cumulative settings +htmlAttributes and +bodyAttributes were merged in the order Vike provides them (most specific value first, values set by Vike extensions last), with the last value winning upon conflict. So, upon conflict:

  • a value set by a Vike extension overrode the app's value, and
  • a value set by +config.js overrode the value set by +htmlAttributes.js / +bodyAttributes.js.

That's the opposite of how every other Vike setting resolves. (The order of cumulative values is pinned by Vike's playground test test/playground/pages/config-meta/cumulative/.)

Fix

mergeTagAttributes() in packages/vike-solid/integration/onRenderHtml.tsx now merges the values so that the most specific value wins. Values set by useConfig() keep the highest precedence (unchanged).

Related

🤖 Generated with Claude Code

https://claude.ai/code/session_01MdJwhUKSfXPVuSvXyxBpr7

…over the ones set by Vike extensions

The values of the cumulative settings `+htmlAttributes` and `+bodyAttributes` were merged in the order Vike provides them (most specific value first, values set by Vike extensions last), with the last value winning upon conflict. Consequently, upon conflict, a value set by a Vike extension would override the app's value, and a value set by `+config.js` would override the value set by `+htmlAttributes.js`.

The values are now merged so that the most specific value wins, while values set by `useConfig()` keep the highest precedence.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MdJwhUKSfXPVuSvXyxBpr7
@nitedani
nitedani force-pushed the claude/tag-attributes-precedence-ljv9nc branch from 03651dd to ba2dcee Compare September 18, 2026 15:00
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