Recourse

Look and feel

Color and theme

# config/initializers/recourse.rb
Recourse.color = :orange
Recourse.theme = :nord

color is the family every button, link and focus ring is drawn in: blue, gray, orange, purple, pink or brown. theme repaints the whole palette in both modes: dawn, dracula, gruvbox, monokai, nord, one_dark, solarized, tokyo_night, or bootstrap for upstream’s own. Anything else raises.

What the reader chooses

The moon at the foot of the sidebar moves the page to another palette and into the other mode, kept in the browser. Two more choices are cookies the server reads back: the page size, and on a phone whether the chrome shows its words. Every time is drawn in the reader’s own zone, reported by the browser, without touching the host’s config.time_zone.

Where the assets come from

Bootstrap, its icons, Turbo, Stimulus and the controllers are served by bh, a dependency, at /bh/. A host serving them from elsewhere says so once:

Recourse.assets = 'https://cdn.example.com/bh'

A recourses/head partial in the host is drawn last in the head, for the tab’s icon or a stylesheet of the host’s own. Every screen renders in the gem’s layouts/recourses; a host replaces it by writing its own, or by declaring layout 'application' on RecoursesController, yielding :actions and :search where it wants the buttons and the search box.

The locale

Every string is a key in config/locales/recourse.en.yml, and a host rewords one in a locale of its own: recourse.add is Add %{model}. Dates and times read from date.formats.recourse and time.formats.recourse. A heading is renamed by translating the attribute.