Skip to content

Commit 5fdea0d

Browse files
authored
Merge pull request #6513 from Textualize/ansi-themes
Ansi themes
2 parents 49a24d6 + 992eb86 commit 5fdea0d

40 files changed

Lines changed: 790 additions & 270 deletions

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

8+
## [8.2.5] - 2026-04-30
9+
10+
### Added
11+
12+
- Two new themes: "ansi-dark" and "ansi-light" https://github.com/Textualize/textual/pull/6513
13+
- Added an `ansi` value to themes https://github.com/Textualize/textual/pull/6513
14+
15+
### Changed
16+
17+
- `App.ansi_color` may now be `None` to use the `ansi` value from the theme. https://github.com/Textualize/textual/pull/6513
18+
819
## [8.2.4] - 2026-04-19
920

1021
### Added
@@ -3423,6 +3434,7 @@ https://textual.textualize.io/blog/2022/11/08/version-040/#version-040
34233434
- New handler system for messages that doesn't require inheritance
34243435
- Improved traceback handling
34253436

3437+
[8.2.5]: https://github.com/Textualize/textual/compare/v8.2.4...v8.2.5
34263438
[8.2.4]: https://github.com/Textualize/textual/compare/v8.2.3...v8.2.4
34273439
[8.2.3]: https://github.com/Textualize/textual/compare/v8.2.2...v8.2.3
34283440
[8.2.2]: https://github.com/Textualize/textual/compare/v8.2.1...v8.2.2

docs/guide/design.md

Lines changed: 62 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -123,19 +123,19 @@ Textual will attempt to generate the other base colors if they're not supplied.
123123

124124
The following table lists each of 11 base colors (as used in CSS) and a description of where they are used by default.
125125

126-
| Color | Description |
127-
| ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
128-
| `$primary` | The primary color, can be considered the *branding* color. Typically used for titles, and backgrounds for strong emphasis. |
129-
| `$secondary` | An alternative branding color, used for similar purposes as `$primary`, where an app needs to differentiate something from the primary color. |
130-
| `$foreground` | The default text color, which should be legible on `$background`, `$surface`, and `$panel`. |
131-
| `$background` | A color used for the background, where there is no content. Used as the default background color for screens. |
132-
| `$surface` | The default background color of widgets, typically sitting on top of `$background`. |
133-
| `$panel` | A color used to differentiate a part of the UI form the main content. Used sparingly in Textual itself. |
134-
| `$boost` | A color with alpha that can be used to create *layers* on a background. |
135-
| `$warning` | Indicates a warning. Typically used as a background color. `$text-warning` can be used for foreground. |
136-
| `$error` | Indicates an error. Typically used as a background color. `$text-error` can be used for foreground. |
137-
| `$success` | Used to indicate success. Typically used as a background color. `$text-success` can be used for foreground. |
138-
| `$accent` | Used sparingly to draw attention. Typically contrasts with `$primary` and `$secondary`. |
126+
| Color | Description |
127+
| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
128+
| `$primary` | The primary color, can be considered the *branding* color. Typically used for titles, and backgrounds for strong emphasis. |
129+
| `$secondary` | An alternative branding color, used for similar purposes as `$primary`, where an app needs to differentiate something from the primary color. |
130+
| `$foreground` | The default text color, which should be legible on `$background`, `$surface`, and `$panel`. |
131+
| `$background` | A color used for the background, where there is no content. Used as the default background color for screens. |
132+
| `$surface` | The default background color of widgets, typically sitting on top of `$background`. |
133+
| `$panel` | A color used to differentiate a part of the UI form the main content. Used sparingly in Textual itself. |
134+
| `$boost` | A color with alpha that can be used to create *layers* on a background. |
135+
| `$warning` | Indicates a warning. Typically used as a background color. `$text-warning` can be used for foreground. |
136+
| `$error` | Indicates an error. Typically used as a background color. `$text-error` can be used for foreground. |
137+
| `$success` | Used to indicate success. Typically used as a background color. `$text-success` can be used for foreground. |
138+
| `$accent` | Used sparingly to draw attention. Typically contrasts with `$primary` and `$secondary`. |
139139

140140
## Shades
141141

@@ -261,74 +261,74 @@ Here's a comprehensive list of these variables, their purposes, and default valu
261261

262262
### Border
263263

264-
| Variable | Purpose | Default Value |
265-
|----------|---------|---------------|
266-
| `$border` | The border color for focused widgets with a border | `$primary` |
267-
| `$border-blurred` | The border color for unfocused widgets | Slightly darkened `$surface` |
264+
| Variable | Purpose | Default Value |
265+
| ----------------- | -------------------------------------------------- | ---------------------------- |
266+
| `$border` | The border color for focused widgets with a border | `$primary` |
267+
| `$border-blurred` | The border color for unfocused widgets | Slightly darkened `$surface` |
268268

269269
### Cursor
270270

271-
| Variable | Purpose | Default Value |
272-
|----------|---------|---------------|
273-
| `$block-cursor-foreground` | Text color for block cursor (e.g., in OptionList) | `$text` |
274-
| `$block-cursor-background` | Background color for block cursor | `$primary` |
275-
| `$block-cursor-text-style` | Text style for block cursor | `"bold"` |
276-
| `$block-cursor-blurred-foreground` | Text color for unfocused block cursor | `$text` |
277-
| `$block-cursor-blurred-background` | Background color for unfocused block cursor | `$primary` with 30% opacity |
278-
| `$block-cursor-blurred-text-style` | Text style for unfocused block cursor | `"none"` |
279-
| `$block-hover-background` | Background color when hovering over a block | `$boost` with 5% opacity |
271+
| Variable | Purpose | Default Value |
272+
| ---------------------------------- | ------------------------------------------------- | --------------------------- |
273+
| `$block-cursor-foreground` | Text color for block cursor (e.g., in OptionList) | `$text` |
274+
| `$block-cursor-background` | Background color for block cursor | `$primary` |
275+
| `$block-cursor-text-style` | Text style for block cursor | `"bold"` |
276+
| `$block-cursor-blurred-foreground` | Text color for unfocused block cursor | `$text` |
277+
| `$block-cursor-blurred-background` | Background color for unfocused block cursor | `$primary` with 30% opacity |
278+
| `$block-cursor-blurred-text-style` | Text style for unfocused block cursor | `"none"` |
279+
| `$block-hover-background` | Background color when hovering over a block | `$boost` with 5% opacity |
280280

281281
### Input
282282

283-
| Variable | Purpose | Default Value |
284-
|----------|---------|---------------|
285-
| `$input-cursor-background` | Background color of the input cursor | `$foreground` |
286-
| `$input-cursor-foreground` | Text color of the input cursor | `$background` |
287-
| `$input-cursor-text-style` | Text style of the input cursor | `"none"` |
288-
| `$input-selection-background` | Background color of selected text | `$primary-lighten-1` with 40% opacity |
283+
| Variable | Purpose | Default Value |
284+
| ----------------------------- | ------------------------------------ | ------------------------------------- |
285+
| `$input-cursor-background` | Background color of the input cursor | `$foreground` |
286+
| `$input-cursor-foreground` | Text color of the input cursor | `$background` |
287+
| `$input-cursor-text-style` | Text style of the input cursor | `"none"` |
288+
| `$input-selection-background` | Background color of selected text | `$primary-lighten-1` with 40% opacity |
289289

290290
### Scrollbar
291291

292-
| Variable | Purpose | Default Value |
293-
|----------|---------|---------------|
294-
| `$scrollbar` | Color of the scrollbar | `$panel` |
295-
| `$scrollbar-hover` | Color of the scrollbar when hovered | `$panel-lighten-1` |
296-
| `$scrollbar-active` | Color of the scrollbar when active (being dragged) | `$panel-lighten-2` |
297-
| `$scrollbar-background` | Color of the scrollbar track | `$background-darken-1` |
298-
| `$scrollbar-corner-color` | Color of the scrollbar corner | Same as `$scrollbar-background` |
299-
| `$scrollbar-background-hover` | Color of the scrollbar track when hovering over the scrollbar area | Same as `$scrollbar-background` |
300-
| `$scrollbar-background-active` | Color of the scrollbar track when the scrollbar is active | Same as `$scrollbar-background` |
292+
| Variable | Purpose | Default Value |
293+
| ------------------------------ | ------------------------------------------------------------------ | ------------------------------- |
294+
| `$scrollbar` | Color of the scrollbar | `$panel` |
295+
| `$scrollbar-hover` | Color of the scrollbar when hovered | `$panel-lighten-1` |
296+
| `$scrollbar-active` | Color of the scrollbar when active (being dragged) | `$panel-lighten-2` |
297+
| `$scrollbar-background` | Color of the scrollbar track | `$background-darken-1` |
298+
| `$scrollbar-corner-color` | Color of the scrollbar corner | Same as `$scrollbar-background` |
299+
| `$scrollbar-background-hover` | Color of the scrollbar track when hovering over the scrollbar area | Same as `$scrollbar-background` |
300+
| `$scrollbar-background-active` | Color of the scrollbar track when the scrollbar is active | Same as `$scrollbar-background` |
301301

302302
### Links
303303

304-
| Variable | Purpose | Default Value |
305-
|----------|---------|---------------|
306-
| `$link-background` | Background color of links | `"initial"` |
307-
| `$link-background-hover` | Background color of links when hovered | `$primary` |
308-
| `$link-color` | Text color of links | `$text` |
309-
| `$link-style` | Text style of links | `"underline"` |
310-
| `$link-color-hover` | Text color of links when hovered | `$text` |
311-
| `$link-style-hover` | Text style of links when hovered | `"bold not underline"` |
304+
| Variable | Purpose | Default Value |
305+
| ------------------------ | -------------------------------------- | ---------------------- |
306+
| `$link-background` | Background color of links | `"initial"` |
307+
| `$link-background-hover` | Background color of links when hovered | `$primary` |
308+
| `$link-color` | Text color of links | `$text` |
309+
| `$link-style` | Text style of links | `"underline"` |
310+
| `$link-color-hover` | Text color of links when hovered | `$text` |
311+
| `$link-style-hover` | Text style of links when hovered | `"bold not underline"` |
312312

313313
### Footer
314314

315-
| Variable | Purpose | Default Value |
316-
|----------|---------|---------------|
317-
| `$footer-foreground` | Text color in the footer | `$foreground` |
318-
| `$footer-background` | Background color of the footer | `$panel` |
319-
| `$footer-key-foreground` | Text color for key bindings in the footer | `$accent` |
320-
| `$footer-key-background` | Background color for key bindings in the footer | `"transparent"` |
321-
| `$footer-description-foreground` | Text color for descriptions in the footer | `$foreground` |
315+
| Variable | Purpose | Default Value |
316+
| -------------------------------- | ----------------------------------------------- | --------------- |
317+
| `$footer-foreground` | Text color in the footer | `$foreground` |
318+
| `$footer-background` | Background color of the footer | `$panel` |
319+
| `$footer-key-foreground` | Text color for key bindings in the footer | `$accent` |
320+
| `$footer-key-background` | Background color for key bindings in the footer | `"transparent"` |
321+
| `$footer-description-foreground` | Text color for descriptions in the footer | `$foreground` |
322322
| `$footer-description-background` | Background color for descriptions in the footer | `"transparent"` |
323-
| `$footer-item-background` | Background color for items in the footer | `"transparent"` |
323+
| `$footer-item-background` | Background color for items in the footer | `"transparent"` |
324324

325325
### Button
326326

327-
| Variable | Purpose | Default Value |
328-
|----------|---------|---------------|
329-
| `$button-foreground` | Foreground color for standard buttons | `$foreground` |
330-
| `$button-color-foreground` | Foreground color for colored buttons | `$text` |
331-
| `$button-focus-text-style` | Text style for focused buttons | `"bold reverse"` |
327+
| Variable | Purpose | Default Value |
328+
| -------------------------- | ------------------------------------- | ---------------- |
329+
| `$button-foreground` | Foreground color for standard buttons | `$foreground` |
330+
| `$button-color-foreground` | Foreground color for colored buttons | `$text` |
331+
| `$button-focus-text-style` | Text style for focused buttons | `"bold reverse"` |
332332

333333
## App-specific variables
334334

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "textual"
3-
version = "8.2.4"
3+
version = "8.2.5"
44
homepage = "https://github.com/Textualize/textual"
55
repository = "https://github.com/Textualize/textual"
66
documentation = "https://textual.textualize.io/"

0 commit comments

Comments
 (0)