FotobogenDocumentation

Skins

A skin decides how your public site looks. Four come with Fotobogen, each in light and dark. Switching takes effect at once: nothing is rebuilt and no photograph is touched.

Choosing a skin

Open Admin, Skins, pick one, and press Save. Each skin remembers its own options, so you can switch back and find them as you left them.

SkinShows firstWhat makes it itself
SwissDarkThe default. A small site name, hairline gaps between photos, one red accent. Off-white on near-black, or black on white.
PapierLightWarm white paper, heavy black rules, wide margins, photographs set apart like prints on a page. Dark mode is the same page reversed.
PlakatDarkA poster. The site's name set very large, photographs running edge to edge. White on black with a yellow bar, or black on yellow.
Rangefinder DreamsDarkBlack and white throughout. No colour on the page, and every photograph shown in black and white, crisply sharpened.
The Swiss skin in dark mode: a photo page in off-white on near-black, with the photo's date, camera details, album, and tags beside it
Swiss, dark.
The Swiss skin in light mode: the same photo page in black on white
Swiss, light.
The Papier skin in light mode: black type on warm white with a heavy rule under the site name
Papier, light.
The Papier skin in dark mode: warm white type on warm black
Papier, dark.
The Plakat skin in dark mode: the site name set very large in white on black above photographs
Plakat, dark.
The Plakat skin in light mode: the site name set very large in black on yellow above photographs
Plakat, light.

Options

Every skin that comes with Fotobogen has the same three, on the Skins page:

If a colour you choose would make text hard to read, the page warns you and says by how much.

Light and dark

Every skin has both modes. You decide which one a visitor sees first, under Light or dark on the Skins page:

Visitors can switch with the button at the top of your site. Their choice is remembered in a cookie named fb-mode that holds the single word light or dark. It is set only when they press the button, says nothing about who they are, and is not used for anything else.

What the skins are tested for

Each skin is checked, in both modes, on a phone-sized screen (320 pixels wide) and a wide one, against WCAG 2.2 level AA:

A skin that sets a look

A skin can bring a look for every photograph with it. Rangefinder Dreams does: choosing it sets the Film looks module to black and white for the whole site.

  1. When you pick such a skin, the Skins page says what its look is and shows a ticked box, Use this look for all photos. Untick it to have the skin without the look.
  2. When you save, the copies of your photographs that visitors see are made again in the background. With a large library this takes a while; the files you uploaded are never changed.

After that it is an ordinary look, and yours to change:

Adding a skin

  1. Copy the skin's folder into data/skins/ on the server, so that you have data/skins/<name>/skin.json and skin.css.
  2. Restart Fotobogen.
  3. Choose it under Admin, Skins.

A skin with a mistake in it is listed with the reason and cannot be chosen; it never breaks the site.

Making your own

A skin is two files. The quickest way to make one is to copy Swiss, change its colours and measures, and add a few rules of your own. Papier, Plakat, and Rangefinder Dreams were each made that way, and say so in their first lines.

  1. Copy skins/swiss/ to data/skins/mine/, and change "name" in skin.json to mine.
  2. In skin.json, give the colours for both modes, and say which a visitor sees first:
    "mode": "light",
    "modes": {
      "light": { "ground": "#f4f1ea", "text": "#111111", "muted": "#55554f", "line": "#d6d2c8", "accent": "#d4040f" },
      "dark":  { "ground": "#171613", "text": "#f4f1ea", "muted": "#aca89d", "line": "#37352f", "accent": "#ff5a4f" }
    },
    "contrast": [["text", "ground"], ["muted", "ground"]]
    ground is the page, text the words, muted the quieter words, line the rules, and accent the one highlight. Both modes are required.
  3. In skin.css, never write a colour for the page. Use the names instead, and both modes work:
    .fb-public body { background: var(--fb-ground); color: var(--fb-text); }
    .fb-site-header { border-bottom: 4px solid var(--fb-text); }
  4. Add your own rules at the end. Plakat's headline is two lines (shortened here):
    .fb-site-title { font-size: clamp(2.75rem, 11vw, 8.5rem); line-height: 0.88; overflow-wrap: anywhere; }
    .fb-site-title::after { content: ""; display: block; width: 7rem; height: 0.7rem; background: var(--fb-accent); }
  5. To give it a look for every photo, add look to skin.json:
    "look": [
      { "module": "filmlooks", "transform": "film-look", "params": { "look": "Colour slide (Kodachrome style)" } }
    ]
  6. Restart, choose it, and look at the grid, a photo, an album, and the slideshow, in both modes, on a phone and on a wide screen.

That is the short version. Writing a skin is the full guide: every field, the HTML you are styling with every class name, the grid, accessibility, testing, and every error message.

What a skin cannot do

A skin is a stylesheet and a list of settings. It cannot change the pages' structure, run scripts, or load anything from another site. That is deliberate: installing a skin someone else made cannot do more than change how your site looks.

Back: Customization Next: Writing a skin