applyTheme
Theme
stable
Inject (or replace) a single theme's CSS variable block into <head> at runtime. SSR-safe: returns null when document is unavailable or the theme is empty.
API
Signature
Signature TypeScript complète, extraite du fichier util.
API
Paramètres
Paramètres d'entrée acceptés par cet util.
- themerequisIOrigamTheme
- The theme object containing name, mode (light | dark), and the CSS variable map to inject.
API
Valeur de retour
La valeur retournée par cet util.
- The id of the injected <style> element (keyed by name × mode), or null when skipped (SSR or empty theme).
Usage
Exemples
Extraits de code prêts à coller.
Inject a brand theme at runtime