Skip to main content

Options in Settings → Appearance

Anyone can customize your theme without opening a file if you declare settings in theme.json. This is the example’s complete theme.json:
(With developer mode, 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:
  1. A CSS variable on <html>: --ejg- plus the key in lowercase with hyphens (cardSize → --ejg-card-size).
  2. For toggle and select, also a data-… 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:
(If you have followed the guide, replace --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.mode is "tv" and ejg.on("mode", …) reports the change);
  • hides its window buttons;
  • and, if you press Back with nothing open (your back returned false), opens the quick menu.
CSS is enough to adapt: larger type and covers, and hide what a controller does not use.
The "modes": ["desktop", "tv"] field in theme.json is informational. Every theme receives data-mode="tv" in Big Picture, so design for both.