From 912196ac3f6050c863619fba3affa4a4e104a73d Mon Sep 17 00:00:00 2001 From: Garrick Aden-Buie Date: Thu, 12 Sep 2024 14:59:14 -0400 Subject: [PATCH 1/2] fix: Use posix paths in import statements in Sass strings --- shiny/ui/_theme.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/shiny/ui/_theme.py b/shiny/ui/_theme.py index 5c4ca225b..27c7e772f 100644 --- a/shiny/ui/_theme.py +++ b/shiny/ui/_theme.py @@ -510,7 +510,10 @@ def path_pkg_preset(preset: ShinyThemePreset, *args: str) -> str: #> "{shiny}/www/shared/sass/preset/shiny/bootstrap.min.css" ``` """ - return os.path.realpath(path_pkg_www("sass", "preset", str(preset), *args)) + path = os.path.realpath(path_pkg_www("sass", "preset", str(preset), *args)) + # these paths end up in strings passed to sass.compile(). Converting to POSIX means + # we use forward slashes to avoid needing to double-escape the Windows backslash + return pathlib.Path(path).as_posix() def check_is_valid_preset(preset: ShinyThemePreset) -> None: From 9d04e1695bad79df88e88a6da6fc6a29dcc22f09 Mon Sep 17 00:00:00 2001 From: Garrick Aden-Buie Date: Thu, 12 Sep 2024 15:07:04 -0400 Subject: [PATCH 2/2] docs: Add changelog item --- CHANGELOG.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee99450f9..446f4182b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Fixed a bug with `Chat()` sometimes silently dropping errors. (#1672) -* `shiny create` now uses the template `id` rather than the directory name as the default directory. (#1666) +* `shiny create` now uses the template `id` rather than the directory name as the default directory. +(#1666) + +* `ui.Theme()` now works correctly on Windows when the theme requires Sass compilation. (thanks @yuuuxt, #1684) ## [1.1.0] - 2024-09-03