Files
danbooru/app/helpers
evazion da6a61b4e7 css: switch to SVG sprites for icons.
Switch to using SVG sprites for icons, instead of using a combination of icon fonts and inline SVG elements.

This means there's a single icons.svg file containing all icons, and icons are referenced like
`<svg><use href="/icons.svg#arrow-alt-up"/></svg>`.

This should make icons more efficient since a) it replaces an 80kb icon font file with a 8kb SVG
file and b) it replaces repeated inline copies of the same icon with references to the sprite sheet.
This most notably affects the upvote and downvote buttons.

This also updates icons from Font Awesome 5 to Font Awesome 6, which fixes a few minor icon
alignment issues in some places.

ref: https://fontawesome.com/docs/web/add-icons/svg-sprites
2022-12-11 02:16:01 -06:00
..
2021-12-14 21:33:27 -06:00

Helpers

This directory contains helper functions used by views. Helpers are used for simple common functions, such as linking to users or formatting timestamps.

Helper functions are globals. If you see an unnamespaced function in a view, and it's not a Rails function, then it's probably a helper defined here.

All helper functions defined in this directory are globally available to all views. They're not limited to single views. For example, the functions in posts_helper.rb are available to all views, not just to app/views/posts.

The use of helper functions should be minimized. Partials or components are preferred for more complex widgets, or for things used in only one or two places. Helper functions should be limited to very simple things used in nearly all views.

See also

External links