]> git.draconx.ca Git - homepage.git/commit
Embed SVG icons directly into output.
authorNick Bowler <nbowler@draconx.ca>
Tue, 23 Feb 2021 01:29:38 +0000 (20:29 -0500)
committerNick Bowler <nbowler@draconx.ca>
Wed, 24 Feb 2021 03:48:54 +0000 (22:48 -0500)
commit0015d84bea1204b4534e5568ff7c0920b9ef02b7
treed4f3a5cec112b7f65d85a02cd432397fc909fc6f
parent3f707bce834daa1c9c3f5029611090430caa2178
Embed SVG icons directly into output.

Inlining SVGs directly in the markup seems to interoperate somewhat
better than linking SVGs in img elements, and we can fairly easily
create fallback markup that degrades to a raster image.

Currently this is only applicable to the file listings because the
fallback markup is hardcoded to the icons on these pages.  This will
need to be expanded in the future.

The results seem pretty good, although nothing I do in old Mozilla
versions seems to be able to get the stylesheet sizes to properly
apply to SVG elements, so the icons are rendered correctly but at
the wrong scale.  SVG support can be disabled in this browser and
the fallback works properly.  More work may be required.
14 files changed:
Rules
content/icons/down.svg [moved from content/images/down.svg with 100% similarity]
content/icons/folder.svg [moved from content/images/folder.svg with 100% similarity]
content/icons/return.svg [moved from content/images/return.svg with 100% similarity]
content/icons/up.svg [moved from content/images/up.svg with 100% similarity]
content/style.scss
layouts/clickytable.xsl
layouts/default.xsl
layouts/embed-svg.xsl [new file with mode: 0644]
layouts/functions.xsl
layouts/listing.erb
lib/css-clean-selectors.rb
lib/svg2png.rb [new file with mode: 0644]
lib/xhtml-compat.rb