Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions reflex/.templates/jinja/web/styles/styles.css.jinja2
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{%- block imports_styles %}
@layer __reflex_base;
{% for sheet_name in stylesheets %}
{{- "@import url('" + sheet_name + "'); " }}
{% endfor %}
Expand Down
7 changes: 5 additions & 2 deletions tests/units/compiler/test_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ def test_compile_stylesheets(tmp_path: Path, mocker: MockerFixture):
/ "styles"
/ (PageNames.STYLESHEET_ROOT + ".css")
),
"@layer __reflex_base;\n"
"@import url('./__reflex_style_reset.css'); \n"
"@import url('@radix-ui/themes/styles.css'); \n"
"@import url('https://fonts.googleapis.com/css?family=Sofia&effect=neon|outline|emboss|shadow-multiple'); \n"
Expand Down Expand Up @@ -219,6 +220,7 @@ def test_compile_stylesheets_scss_sass(tmp_path: Path, mocker: MockerFixture):
/ "styles"
/ (PageNames.STYLESHEET_ROOT + ".css")
),
"@layer __reflex_base;\n"
"@import url('./__reflex_style_reset.css'); \n"
"@import url('@radix-ui/themes/styles.css'); \n"
"@import url('./style.css'); \n"
Expand All @@ -238,6 +240,7 @@ def test_compile_stylesheets_scss_sass(tmp_path: Path, mocker: MockerFixture):
/ "styles"
/ (PageNames.STYLESHEET_ROOT + ".css")
),
"@layer __reflex_base;\n"
"@import url('./__reflex_style_reset.css'); \n"
"@import url('@radix-ui/themes/styles.css'); \n"
"@import url('./style.css'); \n"
Expand Down Expand Up @@ -285,7 +288,7 @@ def test_compile_stylesheets_exclude_tailwind(tmp_path, mocker: MockerFixture):

assert compiler.compile_root_stylesheet(stylesheets) == (
str(Path(".web") / "styles" / (PageNames.STYLESHEET_ROOT + ".css")),
"@import url('./__reflex_style_reset.css'); \n@import url('@radix-ui/themes/styles.css'); \n@import url('./style.css'); \n",
"@layer __reflex_base;\n@import url('./__reflex_style_reset.css'); \n@import url('@radix-ui/themes/styles.css'); \n@import url('./style.css'); \n",
)


Expand Down Expand Up @@ -324,7 +327,7 @@ def test_compile_stylesheets_no_reset(tmp_path: Path, mocker: MockerFixture):
/ "styles"
/ (PageNames.STYLESHEET_ROOT + ".css")
),
"@import url('@radix-ui/themes/styles.css'); \n@import url('./style.css'); \n",
"@layer __reflex_base;\n@import url('@radix-ui/themes/styles.css'); \n@import url('./style.css'); \n",
)


Expand Down
Loading