Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,54 @@ The widgets cover text entry, choices, filesystem browsing and gates. Each links
</tr>
</table>

## Themes

Every form is themeable. Five themes ship built-in, selected by name - and any of them can be forced light or dark, or left to auto-detect from the terminal:

```php
$form = Form::create('My form')->theme('midnight')/* ... */;
```

| Name | Palette |
|------|---------|
| `default` | Cyan accents on an auto-detected dark or light base - the out-of-the-box look. |
| `midnight` | Violet accents, green values, pink highlights. |
| `frost` | Arctic frost-blue accents, sage values, sand highlights. |
| `ember` | Burnt-orange accents, olive values, gold highlights. |
| `mono` | Hue-free - bold weight, grey levels and reverse video for maximum compatibility. |

Each renders across every widget and degrades to plain text without ANSI. Every theme adapts to the terminal - here the dark palette (left) and the light palette (right):

**`midnight`**

<p>
<img src="docs/assets/theme-midnight.svg" width="48%" alt="midnight theme, dark mode">
<img src="docs/assets/theme-midnight-light.svg" width="48%" alt="midnight theme, light mode">
</p>

**`frost`**

<p>
<img src="docs/assets/theme-frost.svg" width="48%" alt="frost theme, dark mode">
<img src="docs/assets/theme-frost-light.svg" width="48%" alt="frost theme, light mode">
</p>

**`ember`**

<p>
<img src="docs/assets/theme-ember.svg" width="48%" alt="ember theme, dark mode">
<img src="docs/assets/theme-ember-light.svg" width="48%" alt="ember theme, light mode">
</p>

**`mono`**

<p>
<img src="docs/assets/theme-mono.svg" width="48%" alt="mono theme, dark mode">
<img src="docs/assets/theme-mono-light.svg" width="48%" alt="mono theme, light mode">
</p>

Write your own by subclassing `DefaultTheme` and overriding just its palette - see the [theming guide](https://phptui.dev/themes).

## Maintenance

```bash
Expand Down
1 change: 1 addition & 0 deletions docs/assets/theme-ember-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/assets/theme-ember.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/assets/theme-frost-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/assets/theme-frost.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/assets/theme-midnight-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading