linkrobins/font-sizer

Accessibility-focused font size controls for Flarum 2.0. Users can adjust reading text size and interface size via a header button, with preferences saved in cookies. Admins set sitewide defaults from the extension settings.

Maintainers

Package info

github.com/linkrobins/font-sizer

Language:JavaScript

Type:flarum-extension

pkg:composer/linkrobins/font-sizer

Statistics

Installs: 57

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.9 2026-05-03 00:24 UTC

This package is auto-updated.

Last update: 2026-05-03 00:24:35 UTC


README

A Flarum 2.0 extension that gives users accessibility-focused font size controls directly in the forum header — no CSS editing required. Admins set sitewide defaults; users override them with their own preferences, saved in cookies.

Features

  • Header button — a fa-text-height icon in the forum header opens a modal for all users, including guests
  • Reading text slider — scales post body text and discussion titles from 100% to 150% in 5% increments
  • Interface size toggle — Default or Large (115%) mode for navigation, buttons, and other UI elements
  • Cookie persistence — preferences are saved for 1 year so returning visitors keep their settings
  • Admin defaults — set a sitewide default for both reading text size and interface size from the extension settings page
  • Live preview — the admin panel previews changes as you drag the slider
  • Debounced save — settings save 500ms after you stop dragging to prevent API conflicts
  • Theme agnostic — uses Flarum CSS variables throughout; works on all light and dark themes

How it works

The reading text slider runs from 100% (Flarum default) to 150% in 5% increments. The interface size toggle offers Default or Large (115%). Both values are stored as cookies (lr_text_scale and lr_ui_size) on the user's browser. If no cookie exists, the user sees whatever the admin has configured as the sitewide default.

Admin defaults are saved to Flarum's settings table under linkrobins-font-sizer.scale and linkrobins-font-sizer.ui, and served to the forum frontend in the page payload.

Installation

composer require linkrobins/font-sizer

Compatibility

  • Flarum 2.0 RC1+
  • No dependencies beyond flarum/core

License

MIT