furo icon indicating copy to clipboard operation
furo copied to clipboard

icons.html: reduce size by 54%

Open haampie opened this issue 5 months ago • 5 comments

since these icons are part of the HTML and aren't cached, it wouldn't hurt to reduce their size a bit

  • reduce the size of icons.html from 6330 to 2900 bytes (svgomg + manual fixes)
  • fix invalid <svg> nested inside <svg>
  • use <use/> instead of <use></use>
  • move ^ icon to icons.html
  • remove redundant xmlns= attribute from inline <svg> elements

haampie avatar Sep 17 '25 07:09 haampie

* use `<use/>` instead of `<use></use>`

Should perhaps be avoided: https://github.com/prettier/prettier/issues/15336

polyzen avatar Sep 17 '25 14:09 polyzen

  • use <use/> instead of <use></use>

Should perhaps be avoided: prettier/prettier#15336

Self-closing tags are already used, e.g.

https://github.com/pradyunsg/furo/blob/83c3446288014357bb8a7875bb81b664b7f15896/src/furo/theme/furo/partials/icons.html#L54

See this comment by the person who created https://svgomg.net/, or more authoritatively the html spec which says it's not an error when in <svg>)

haampie avatar Sep 17 '25 19:09 haampie

Is there any way to ensure/enforce this? Without that, I'm certain that there'd be a regression around this the next time that the icons need any changes.

pradyunsg avatar Sep 18 '25 13:09 pradyunsg

I'm not in the loop regarding web development tooling.

Just know about w3 validator (ancient) and svgo as an npm package (but I used the web interface).

haampie avatar Sep 18 '25 13:09 haampie

@pradyunsg would you accept this as is or do you want to merge it exclusively with tooling? I cannot work on tooling unfortunately.

haampie avatar Sep 30 '25 13:09 haampie