Skip to content

Commit

Permalink
style(create-vite): use quotes for attributes consistently
Browse files Browse the repository at this point in the history
As part of my changes in vitejs#12374, I unintentionally removed the quotes
for the Vite logos from the vanilla templates, perhaps because the rest
of the templates didn't need them.

While HTML5 allows no quotes for attribute values if the value doesn't contain
a space, keeping a consistent style is important for cognitive load when
reading and maintaining. Hence, I've marked this as a style change.

While not a functional change in these templates, it could be if someone
later changed the import path to contain a space (perhaps after
generating a project using the template).
  • Loading branch information
XanderXAJ committed Mar 12, 2023
1 parent 21ffc6a commit 4aafa6b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/create-vite/template-vanilla-ts/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { setupCounter } from './counter'
document.querySelector<HTMLDivElement>('#app')!.innerHTML = `
<div>
<a href="https://vitejs.dev" target="_blank">
<img src=${viteLogo} class="logo" alt="Vite logo" />
<img src="${viteLogo}" class="logo" alt="Vite logo" />
</a>
<a href="https://www.typescriptlang.org/" target="_blank">
<img src="${typescriptLogo}" class="logo vanilla" alt="TypeScript logo" />
Expand Down
2 changes: 1 addition & 1 deletion packages/create-vite/template-vanilla/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { setupCounter } from './counter.js'
document.querySelector('#app').innerHTML = `
<div>
<a href="https://vitejs.dev" target="_blank">
<img src=${viteLogo} class="logo" alt="Vite logo" />
<img src="${viteLogo}" class="logo" alt="Vite logo" />
</a>
<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript" target="_blank">
<img src="${javascriptLogo}" class="logo vanilla" alt="JavaScript logo" />
Expand Down

0 comments on commit 4aafa6b

Please sign in to comment.