Options in Settings → Appearance
Anyone can customize your theme without opening a file if you declaresettings in theme.json. This is the example’s complete theme.json:
theme.json changes apply on save. Otherwise, press F5.)
In Settings → Appearance two blocks will appear, “Mi primer tema · General”
and “Mi primer tema · Rejilla” (the second name comes from the group field),
with a Reset button. ejGames adds the Navigation sounds picker on its
own (step 8) and an extra CSS box each profile can
use to retouch your theme.
The labels above are Spanish on purpose: they are the source text, and the
dictionary translates them. See Languages.
Each option reaches your page on its own, in two ways:
- A CSS variable on
<html>:--ejg-plus the key in lowercase with hyphens (cardSize→--ejg-card-size). - For
toggleandselect, also adata-…attribute on<html>.
An option with no value (like
wallpaper until something is chosen) does not
create the variable, so always use a fallback in var(). In the example CSS:
--acento: #7c5cff; with the line
above and put var(--carta) where the grid had 160px.)
When you have to read the option from JavaScript (here, the sort order), it
is on ejg.settings, and ejg.on("settings", …) fires when the user
changes it:
The
image type also accepts videos, mp4/webm. A video cannot be a CSS
background. If you want to allow it, check it on ejg.settings and paint a
<video muted loop autoplay> (the Steam theme does it this way).Big Picture
Big Picture is the “TV” mode: fullscreen, and built for a controller. You enter it from the quick menu (Ctrl + K, or the controller’s Guide button → Big Picture) or from Settings → System. On entering, ejGames:- sets
data-mode="tv"on your theme’s<html>(ejg.modeis"tv"andejg.on("mode", …)reports the change); - hides its window buttons;
- and, if you press Back with nothing open (your
backreturnedfalse), opens the quick menu.
"modes": ["desktop", "tv"] field in theme.json is informational. Every
theme receives data-mode="tv" in Big Picture, so design for both.
