From 367b31f8f8e4392066a2c79593c5d4fa75ab8b23 Mon Sep 17 00:00:00 2001 From: Lorenzo Gaifas Date: Fri, 16 Dec 2022 01:15:53 +0100 Subject: [PATCH] Expose `syntax_style` (#261) * allow syntax_style field and add icon to examples/tests * bump Co-authored-by: Nathan Clack --- _docs/example_manifest.yaml | 2 ++ npe2/manifest/contributions/_themes.py | 1 + tests/sample/my_plugin/napari.yaml | 2 ++ 3 files changed, 5 insertions(+) diff --git a/_docs/example_manifest.yaml b/_docs/example_manifest.yaml index 33844339..c49701f1 100644 --- a/_docs/example_manifest.yaml +++ b/_docs/example_manifest.yaml @@ -42,6 +42,7 @@ contributions: - label: "Monokai" id: "monokai" type: "dark" + syntax_style: "monokai" colors: canvas: "#000000" console: "#000000" @@ -51,6 +52,7 @@ contributions: secondary: "#f8f8f2" highlight: "#e6db74" text: "#a1ef34" + icon: "#a1ef34" warning: "#f92672" current: "#66d9ef" sample_data: diff --git a/npe2/manifest/contributions/_themes.py b/npe2/manifest/contributions/_themes.py index bf5691ba..55d05f67 100644 --- a/npe2/manifest/contributions/_themes.py +++ b/npe2/manifest/contributions/_themes.py @@ -54,6 +54,7 @@ class ThemeContribution(BaseModel): description="Base theme type, used for icons and filling in unprovided colors. " "Must be either `'dark'` or `'light'`." ) + syntax_style: Optional[str] colors: ThemeColors = Field( description=f"Theme colors. Valid keys include: {_color_keys}. All keys " "are optional. Color values can be defined via:\n" diff --git a/tests/sample/my_plugin/napari.yaml b/tests/sample/my_plugin/napari.yaml index 856214a5..a9b83350 100644 --- a/tests/sample/my_plugin/napari.yaml +++ b/tests/sample/my_plugin/napari.yaml @@ -75,6 +75,7 @@ contributions: - label: "SampleTheme" id: "sample_theme" type: "dark" + syntax_style: "default" colors: canvas: "#000000" console: "#000000" @@ -84,6 +85,7 @@ contributions: secondary: "#f8f8f2" highlight: "#e6db74" text: "#a1ef34" + icon: "#a1ef34" warning: "#f92672" current: "#66d9ef" sample_data: