This repository has been archived by the owner on Jun 3, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Themes
James Burke edited this page Nov 25, 2019
·
1 revision
Themes allow your components to take on different visuals. By setting a theme, you're usually indicating some kind of context for your component.
Every component has a top level object of public $themes = [ 'default' ];
. This is a whitelist of theme options.
Use the method set_theme( string $theme_name, bool $force = false )
to update the theme for your component. This will only work for values you've whitelisted, unless $force is true.
This will modify the config value for theme_name
.
Themes should follow WordPress naming conventions as underscores. Similar to all config keys, the value of theme_name
is also camel cased upon rendering to JSON, to follow JavaScript conventions.