Skip to content

Commit 2dee252

Browse files
authored
Merge pull request fastapi#23 from fastapilabs/add-rich-toolkit-configuration
✨ Add rich toolkit configuration
2 parents 63267a3 + 6d14289 commit 2dee252

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ classifiers = [
3434
]
3535
dependencies = [
3636
"typer >= 0.12.3",
37+
"rich-toolkit >= 0.6.3",
3738
]
3839

3940
[project.optional-dependencies]

src/fastapi_cli/utils/__init__.py

Whitespace-only changes.

src/fastapi_cli/utils/cli.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
from rich_toolkit import RichToolkit, RichToolkitTheme
2+
from rich_toolkit.styles import TaggedStyle
3+
4+
5+
def get_rich_toolkit() -> RichToolkit:
6+
theme = RichToolkitTheme(
7+
style=TaggedStyle(tag_width=11),
8+
theme={
9+
"tag.title": "black on #A7E3A2",
10+
"tag": "white on #009485",
11+
"placeholder": "grey85",
12+
"text": "white",
13+
"selected": "green",
14+
"result": "grey85",
15+
"progress": "on #009485",
16+
"error": "red",
17+
},
18+
)
19+
20+
return RichToolkit(theme=theme)

0 commit comments

Comments
 (0)