| Filename | Latest commit message | Latest commit date |
|---|---|---|
Prompt V (prompts.md rows 51-54). Mother theme folder + <name> renamed to vanilla_respondage (version 3.3.0); client variants renamed to respondage_defensie / respondage_erasmus (<extends>vanilla_respondage</extends>, auto-derived by build.php). export_public.sh now derives the release name from the theme dir and the leak-check glob matches ../respondage_* siblings, so the public-release leak check keeps working after the rename (sabotage-tested). All doc/tooling references updated; local-only files stay gitignored. Also includes the pending uncommitted theme work from this testing week (custom options page, header logos, sticky-header options, bundled OFL fonts, per-element font overrides, font-dropdown reordering, jsdom tests) that was verified locally but not yet pushed. Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai> |
||
| .. | ||
| eb-garamond-var.woff2 | ||
| inter-var.woff2 | ||
| liberation-sans-400.woff2 | ||
| liberation-sans-700.woff2 | ||
| noto-sans-var.woff2 | ||
| noto-serif-var.woff2 | ||
| OFL-eb-garamond.txt | ||
| OFL-inter.txt | ||
| OFL-liberation-sans.txt | ||
| OFL-noto-sans.txt | ||
| OFL-noto-serif.txt | ||
| OFL-open-sans.txt | ||
| OFL-source-serif-4.txt | ||
| open-sans-var.woff2 | ||
| README.md | ||
| source-serif-4-var.woff2 | ||
Fonts bundled with this theme
This theme ships seven open source fonts so users can see that self-hosted (custom) fonts work just as well as the browser/system fonts:
| Font | Style | File(s) | License |
|---|---|---|---|
| EB Garamond | serif | eb-garamond-var.woff2 |
OFL 1.1 (OFL-eb-garamond.txt) |
| Inter | sans-serif | inter-var.woff2 |
OFL 1.1 (OFL-inter.txt) |
| Liberation Sans | sans-serif | liberation-sans-400.woff2, liberation-sans-700.woff2 |
OFL 1.1 (OFL-liberation-sans.txt) |
| Noto Sans | sans-serif | noto-sans-var.woff2 |
OFL 1.1 (OFL-noto-sans.txt) |
| Noto Serif | serif | noto-serif-var.woff2 |
OFL 1.1 (OFL-noto-serif.txt) |
| Open Sans | sans-serif | open-sans-var.woff2 |
OFL 1.1 (OFL-open-sans.txt) |
| Source Serif 4 | serif | source-serif-4-var.woff2 |
OFL 1.1 (OFL-source-serif-4.txt) |
All except Liberation Sans are variable fonts (weight axis declared in the
@font-face rule in css/fonts.css; Noto Sans/Serif and Open Sans also carry
a width axis, left at its default); Liberation Sans is static, so its 400 and
700 weights are shipped as separate files. All are subsetted to latin +
latin-ext and served locally by the theme — no external requests.
How to add your own font (walkthrough)
LimeSurvey only knows its core font packages (application/config/fonts.php),
so a theme cannot register a font-* package itself. Instead, the theme ships
the font file plus a small css file. The font chosen in the theme options is
applied as the class font-<value> on <body> (see views/layout_survey_list.twig).
-
License — only use fonts with a free/open license (SIL OFL 1.1, Apache-2.0, MIT, …). Put a copy of the license text in this folder, e.g.
OFL-myfont.txt, and keep the font's copyright notice. -
Font file — drop the font file in this folder. Prefer
.woff2(small, supported everywhere). A.ttf/.otfalso works — useformat('truetype')/format('opentype')in thesrcthen. Variable fonts are fine: declare their weight range, e.g.font-weight: 100 900;. -
CSS — add an
@font-facerule and a GENERIC class rule (.font-<value>, notbody.font-<value>!) tocss/fonts.css:@font-face { font-family: 'My Font'; src: url('../files/fonts/my-font.woff2') format('woff2'); font-weight: 100 900; /* the weight range your (variable) font supports */ font-style: normal; font-display: swap; } .font-my_font { font-family: 'My Font', Arial, Helvetica, sans-serif; /* keep fallbacks */ }The rule must be generic because the class is applied in two ways: on
<body>for the base font, and on individual elements (header, progress bar, question titles, answers, group titles/descriptions, buttons) for the per-element font overrides (thefontselectoptions).../files/fonts/...works because the asset manager copies the whole theme directory to the assets folder. Rather not touch the sharedfonts.css? Create your own file (e.g.css/myfonts.css) and register it inconfig.xmlunder<files><css><add>css/myfonts.css</add>…. -
Dropdown entry — add the font to the font dropdown in
config.xml, inside the optgroup"Bundled open source fonts"(keep options ordered alphabetically):<option class="font-my_font" value="my_font" data-font-package="websafe">My Font</option>valuebecomes the classfont-<value>: use only[a-z0-9_].- Keep
data-font-package="websafe": LimeSurvey only knows its core packages andwebsafeis the neutral one, so no missing package is requested. The real font is loaded by your css, not by a package. - To make your font the default for new installs, set the default value of
the
fontoption:<font …>my_font</font>.
-
Activate — copy/upload the theme into
upload/themes/survey/vanilla_respondage/and reset the theme in LimeSurvey (Survey settings → Theme options → Reset) soconfig.xmlis re-imported into the DB. While developing you can force the XML instead: inupload/config.phpadd'force_xmlsettings_for_survey_rendering' => true. -
Verify — open a survey, select your font in the theme options, then in the browser devtools check Network (the
.woff2loads, HTTP 200) and Elements → Computed →font-familyon<body>.
Keeping font files small
Subset the font to the languages you actually need and compress to woff2,
e.g. with pyftsubset (fonttools):
pyftsubset MyFont.ttf --flavor=woff2 \
--unicodes="U+0000-00FF,U+0100-024F,U+2000-206F" \
--name-IDs='*' --name-languages='*' --layout-features='*' \
--output-file=my-font.woff2
Client-specific fonts (variants)
Do not add client house-style fonts here. Per-client fonts are built per
variant from the private variants repo: font files in the variant's
files/fonts/, the @font-face in the variant's own css (e.g.
css/variant.css), declared via fontOptions + files_add in
variants/<client>.json and processed by variants/build.php
(see the theme README.md, "Custom fonts per variant").