Skip to content

Commit 695f9cb

Browse files
authored
fix: Use posix paths in import statements in Sass strings (#1684)
1 parent b16d1a3 commit 695f9cb

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2828
* Fixed a bug with `Chat()` sometimes not removing it's loading icon (on error or a `None` transform). (#1679)
2929
* `.messages(format="anthropic")` correctly removes non-user starting messages (once again). (#1685)
3030

31-
* `shiny create` now uses the template `id` rather than the directory name as the default directory. (#1666)
31+
* `shiny create` now uses the template `id` rather than the directory name as the default directory.
32+
(#1666)
33+
34+
* `ui.Theme()` now works correctly on Windows when the theme requires Sass compilation. (thanks @yuuuxt, #1684)
3235

3336
## [1.1.0] - 2024-09-03
3437

shiny/ui/_theme.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,10 @@ def path_pkg_preset(preset: ShinyThemePreset, *args: str) -> str:
510510
#> "{shiny}/www/shared/sass/preset/shiny/bootstrap.min.css"
511511
```
512512
"""
513-
return os.path.realpath(path_pkg_www("sass", "preset", str(preset), *args))
513+
path = os.path.realpath(path_pkg_www("sass", "preset", str(preset), *args))
514+
# these paths end up in strings passed to sass.compile(). Converting to POSIX means
515+
# we use forward slashes to avoid needing to double-escape the Windows backslash
516+
return pathlib.Path(path).as_posix()
514517

515518

516519
def check_is_valid_preset(preset: ShinyThemePreset) -> None:

0 commit comments

Comments
 (0)