| 1 |
<?php |
| 2 |
|
| 3 |
namespace FluentCart\App\Services\Theme\Readers; |
| 4 |
|
| 5 |
/** |
| 6 |
* Reads the colours a theme's owner set in the theme's own settings. |
| 7 |
* |
| 8 |
* Palette slots only say which colours a theme offers; settings say which of |
| 9 |
* them the owner put where. A reader reports the second, so inheritance |
| 10 |
* follows the owner's Accent, Body Text, Content Background and Button choices |
| 11 |
* instead of guessing them from slot positions. |
| 12 |
* |
| 13 |
* One reader per vendor. Each states only what the theme actually states: a |
| 14 |
* role the reader cannot read is omitted, never guessed, and ThemePalette |
| 15 |
* derives it exactly as it would without a reader. |
| 16 |
*/ |
| 17 |
interface ThemeSettingsReader |
| 18 |
{ |
| 19 |
/** |
| 20 |
* Whether this reader applies to the running site. |
| 21 |
* |
| 22 |
* Detect by capability (the vendor's API), not by theme name, so child |
| 23 |
* themes and renamed theme folders keep working. |
| 24 |
* |
| 25 |
* @return bool |
| 26 |
*/ |
| 27 |
public static function applies(): bool; |
| 28 |
|
| 29 |
/** |
| 30 |
* Role => value for the roles the theme states. |
| 31 |
* |
| 32 |
* Roles: surface, text, accent, border, button_bg, button_text, |
| 33 |
* button_hover_bg, button_hover_text. A value is a hex, or a live |
| 34 |
* reference with its measurable fallback (`var(--x, #hex)`) — normalise |
| 35 |
* each through ThemePalette::settingValue(). |
| 36 |
* |
| 37 |
* @return array |
| 38 |
*/ |
| 39 |
public static function roles(): array; |
| 40 |
} |
| 41 |
|