fix icon svg handling, update grid/list icons

This commit is contained in:
Justin Edmund 2025-12-13 23:17:42 -08:00
parent 4745baca1c
commit 04469ee202
4 changed files with 23 additions and 5 deletions

View file

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect width="9" height="9" x="2" y="2" rx="1"/><rect width="9" height="9" x="13" y="2" rx="1"/><rect width="9" height="9" x="2" y="13" rx="1"/><rect width="9" height="9" x="13" y="13" rx="1"/></svg>

Before

Width:  |  Height:  |  Size: 380 B

10
src/assets/icons/grid.svg Normal file
View file

@ -0,0 +1,10 @@
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_2746_377)">
<path d="M4 8C5.10457 8 6 8.89543 6 10V11C6 12.1046 5.10457 13 4 13H3C1.89543 13 1 12.1046 1 11V10C1 8.89543 1.89543 8 3 8H4ZM11 8C12.1046 8 13 8.89543 13 10V11C13 12.1046 12.1046 13 11 13H10C8.89543 13 8 12.1046 8 11V10C8 8.89543 8.89543 8 10 8H11ZM4 1C5.10457 1 6 1.89543 6 3V4C6 5.10457 5.10457 6 4 6H3C1.89543 6 1 5.10457 1 4V3C1 1.89543 1.89543 1 3 1H4ZM11 1C12.1046 1 13 1.89543 13 3V4C13 5.10457 12.1046 6 11 6H10C8.89543 6 8 5.10457 8 4V3C8 1.89543 8.89543 1 10 1H11Z" fill="currentColor"/>
</g>
<defs>
<clipPath id="clip0_2746_377">
<rect width="14" height="14" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 746 B

View file

@ -1 +1,10 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="8" x2="21" y1="6" y2="6"/><line x1="8" x2="21" y1="12" y2="12"/><line x1="8" x2="21" y1="18" y2="18"/><line x1="3" x2="3.01" y1="6" y2="6"/><line x1="3" x2="3.01" y1="12" y2="12"/><line x1="3" x2="3.01" y1="18" y2="18"/></svg>
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_2746_363)">
<path d="M11.5 10C12.3284 10 13 10.6716 13 11.5C13 12.3284 12.3284 13 11.5 13H2.5C1.67157 13 1 12.3284 1 11.5C1 10.6716 1.67157 10 2.5 10H11.5ZM11.5 5.5C12.3284 5.5 13 6.17157 13 7C13 7.82843 12.3284 8.5 11.5 8.5H2.5C1.67157 8.5 1 7.82843 1 7C1 6.17157 1.67157 5.5 2.5 5.5H11.5ZM11.5 1C12.3284 1 13 1.67157 13 2.5C13 3.32843 12.3284 4 11.5 4H2.5C1.67157 4 1 3.32843 1 2.5C1 1.67157 1.67157 1 2.5 1H11.5Z" fill="currentColor"/>
</g>
<defs>
<clipPath id="clip0_2746_363">
<rect width="14" height="14" fill="white"/>
</clipPath>
</defs>
</svg>

Before

Width:  |  Height:  |  Size: 418 B

After

Width:  |  Height:  |  Size: 674 B

View file

@ -28,9 +28,9 @@
const iconModule = await import(`../../assets/icons/${name}.svg?raw`);
let content = iconModule.default;
// Remove width and height attributes to make it responsive
content = content.replace(/width="[^"]*"/g, '');
content = content.replace(/height="[^"]*"/g, '');
// Remove width and height from root <svg> only (preserve inner element dimensions)
content = content.replace(/<svg([^>]*)width="[^"]*"/, '<svg$1');
content = content.replace(/<svg([^>]*)height="[^"]*"/, '<svg$1');
// Add viewBox if not present (fallback to 0 0 24 24)
if (!content.includes('viewBox')) {