Class UISchemes
iz/css/iiziThemes.css (THEME-DESIGN.md sections 3.2, 4.5 and 4.6, order CC-THEME-A1-TOKENS).The CSS is the source of truth; this class lists the family names for the Designer's "Theme and Client" menu and for validation of what a client reports. Every name is new and never one of the Dojo widget style names of UIThemes.Name (flat, dbootstrap, ios7) nor a removed one (claro and the others), so that an old name always means the old theme (ruled 2026-09-25). ThemeSheetTest in com.iizix.js.tests keeps this list, the sheet and iz/uischeme.js in step.
A scheme travels as the string "family/mode": in the $scheme client property (ClientProps.setUIScheme(String)), in the uiScheme environment property a client reports (EnvProps.getUIScheme()) and in a Browser's storage. The client resolves auto itself; a reported scheme is never auto. The CHOICE, auto included, is reported beside it in uiSchemeChoice (EnvProps.getUISchemeChoice()), and an application sets both halves from Java through IClientSessionGyro.setUIScheme (order CC-THEME-DARK-V5).
The modes auto and auto_light are one mode, auto with light as the fallback when the system cannot tell; auto_dark is auto with dark as the fallback. A page shows dark only when the application allows it: applyModesMarker(String,int) writes the application's allowed modes into the page's first-paint lines, and the $schemeModes client property (ClientProps.setUISchemeModes(String)) tells a connected client the same.
- Author:
- Christopher Mindus
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe shipped theme families (ruling R7): IIZI, Graphite and Contrast.static enumThe modes: light, dark, or auto that follows the OS (ruled Q6, R6).static final recordA scheme: a family and a mode.Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe attribute on the document element that carries the resolved mode.static final StringThe attribute on the document element that carries the modes the application allows, set by the first-paint lines of the page fromMODES_MARKER:light,dark, or absent for both.static final StringThe attribute on the document element that carries the family.static final UISchemes.FamilyThe default family: IIZI.static final StringThe name of the string property under the environment properties in which a client reports the scheme it shows.static final StringThe name of the string property under the environment properties in which a client reports the scheme it was told to show, the mode as chosen: light, dark, auto or auto_dark.static final intThe value of an application's allowed modes meaning both, light and dark: the default.static final intThe value of an application's allowed modes meaning dark only.static final intThe value of an application's allowed modes meaning light only.static final StringThe marker iniiziApp.htmlthe server replaces, per application, by the modes the application allows (modesValue(int)), or by nothing: "%%MODES%%".static final charThe separator between the family and the mode in the string form.static final StringThe shipped sheet, relative to the web root.static final StringThe key under which a Browser keeps the choice in its storage.Constructor Summary
ConstructorsMethod Summary
Modifier and TypeMethodDescriptionstatic StringapplyModesMarker(String html, int modes) Replaces theMODES_MARKERof a page by an application's allowed modes.static StringapplyModesMarker(String html, String modes) Replaces theMODES_MARKERof a page by an application's allowed modes, given as the valuemodesValue(int)produces.static StringmodesValue(int modes) Gets the value the client reads for an application's allowed modes, in the page'sMODES_MARKERand in the$schemeModesproperty.static UISchemes.SchemeParses a scheme string.static UISchemes.ModeParses a mode string: a mode alone, as thethemeURL parameter and the API carry it.static StringtoString(UISchemes.Family family, UISchemes.Mode mode) Formats a scheme string.
Field Details
DEFAULT_FAMILY
The default family: IIZI.SEPARATOR
public static final char SEPARATORThe separator between the family and the mode in the string form.- See Also:
SHEET
ATTR_SCHEME
The attribute on the document element that carries the family.- See Also:
ATTR_MODE
The attribute on the document element that carries the resolved mode.- See Also:
ENV_PROP
The name of the string property under the environment properties in which a client reports the scheme it shows.- See Also:
STORAGE_KEY
The key under which a Browser keeps the choice in its storage.- See Also:
ENV_PROP_CHOICE
The name of the string property under the environment properties in which a client reports the scheme it was told to show, the mode as chosen: light, dark, auto or auto_dark.- See Also:
ATTR_MODES
The attribute on the document element that carries the modes the application allows, set by the first-paint lines of the page fromMODES_MARKER:light,dark, or absent for both.- See Also:
MODES_MARKER
The marker iniiziApp.htmlthe server replaces, per application, by the modes the application allows (modesValue(int)), or by nothing: "%%MODES%%". A copy served without the server keeps the marker, which the page reads as "both".- See Also:
MODES_BOTH
public static final int MODES_BOTHThe value of an application's allowed modes meaning both, light and dark: the default.- See Also:
MODES_LIGHT
public static final int MODES_LIGHTThe value of an application's allowed modes meaning light only.- See Also:
MODES_DARK
public static final int MODES_DARKThe value of an application's allowed modes meaning dark only.- See Also:
Constructor Details
UISchemes
public UISchemes()
Method Details
parse
Parses a scheme string.- Parameters:
s- The scheme as"family/mode", or null.- Returns:
- The scheme, or null when the string is null, or names an unknown family or mode, or carries no mode.
parseMode
Parses a mode string: a mode alone, as thethemeURL parameter and the API carry it.- Parameters:
s- The mode name,auto_lightincluded, or null.- Returns:
- The mode, or null when the string is null or names no mode.
toString
Formats a scheme string.- Parameters:
family- The family.mode- The mode.- Returns:
- The scheme as
"family/mode".
modesValue
Gets the value the client reads for an application's allowed modes, in the page'sMODES_MARKERand in the$schemeModesproperty.- Parameters:
modes-MODES_BOTH,MODES_LIGHTorMODES_DARK; any other value counts as both.- Returns:
"light","dark"or the empty string for both.
applyModesMarker
Replaces theMODES_MARKERof a page by an application's allowed modes.- Parameters:
html- The page.modes- The allowed modes, asmodesValue(int)reads them.- Returns:
- The page, unchanged when it carries no marker.
applyModesMarker
Replaces theMODES_MARKERof a page by an application's allowed modes, given as the valuemodesValue(int)produces.- Parameters:
html- The page.modes-"light","dark", or the empty string or null for both; any other value counts as both.- Returns:
- The page, unchanged when it carries no marker.