Releases: milkstrawai/env_style
Releases · milkstrawai/env_style
Release list
0.1.0
Added
- Initial release.
- Mountable Rails engine that tints an application's favicon a distinct color per environment at runtime, leaving production untouched.
- Environment resolution mirroring env.style:
config.environment→ENV["ENV_STYLE_ENV"]→Rails.env, with per-environment colors and adefault_colorfor unknown non-production environments. - Source resolution with zero-config auto-discovery (
public/icon.svg→public/icon.png→public/favicon.svg→public/favicon.ico, SVG preferred), an explicitconfig.sourceoverride (contained withinRails.root), and per-environment source hashes. The servedContent-Typereflects the source's true media type, sniffed from its magic bytes. - SVG tinting with no image library: a
fill/stroke/currentColorswap for monochrome marks and a luminance-preserving<feColorMatrix>duotone for multicolor marks. Color spellings are canonicalized (3-digit hex, common CSS names) when counting distinctness, so a mark written#000/black/#000000is treated as monochrome. - Raster tinting with libvips (
ruby-vips): a luminance-preserving recolor with alpha preserved andexclude_colors, plusexclude_toleranceto also preserve the anti-aliased halo of near-matching pixels around an excluded region. - Opt-in
rasterize_svgto render an SVG source to a tinted PNG at a configurablerasterize_size(default32px), staying crisp on hi-dpi tabs. env_style_favicon_tagsview helper that emits the favicon<link>for the resolved source, working identically in Hotwire and Inertia apps.- On-demand, deterministic tinting keyed on
(source digest, environment, color, format, exclude_colors, exclude_tolerance, rasterize_size), served with a strong ETag andCache-Control: no-cache, must-revalidate, so browsers cache the icon and revalidate with a304 Not Modifiedbefore any image work. - Graceful degradation: if tinting ever fails, the favicon route serves the untouched source (non-cacheably) instead of raising, matching the never-break-the-page contract.
Full Changelog: https://github.com/milkstrawai/env_style/commits/0.1.0