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 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: