Repository navigation
Fix unreadable initial heading in the State overview demo in dark mode #7681
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
6904d41
Fix unreadable initial heading in the State overview demo in dark mode
FarhanAliRaza 458e141
Add regression test for the State overview heading color
FarhanAliRaza 51c85e3
Match the embedded example source in the State overview regression test
FarhanAliRaza 9830c09
Anchor the State overview test to the test file instead of the workin…
FarhanAliRaza f8f1a74
Render the State overview test under its own virtual path
FarhanAliRaza cc3338b
Isolate the State overview test's state registration
FarhanAliRaza File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Fix the State overview example heading rendering black on the dark background in dark mode. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| """Regression coverage for the State overview page's color-cycling example.""" | ||
|
|
||
| import re | ||
| from pathlib import Path | ||
|
|
||
| import pytest | ||
| import reflex as rx | ||
| from reflex_base.registry import RegistrationContext | ||
|
|
||
| from reflex_docs.docgen_pipeline import render_docgen_document | ||
|
|
||
| DOCS = Path(__file__).resolve().parents[2] | ||
|
|
||
|
|
||
| @pytest.fixture(autouse=True) | ||
| def isolated_registration(): | ||
| """Keep the demo's state class out of the shared registries other tests use.""" | ||
| with RegistrationContext( | ||
| _config=rx.Config(app_name="reflex_docs", frontend_path="/docs") | ||
| ): | ||
| yield | ||
|
|
||
|
|
||
| def test_example_heading_starts_theme_aware(): | ||
| """The first color is the theme foreground, not black, so it reads in dark mode.""" | ||
| # A test-specific virtual path keeps the demo's state class from colliding | ||
| # with the one test_docgen_double_eval registers for the real page. | ||
| body, _ = render_docgen_document( | ||
| "docs/state/overview_heading_test.md", str(DOCS / "state" / "overview.md") | ||
| ) | ||
| rendered = str(body) | ||
| # The example source is embedded with escaped quotes, so match loosely. | ||
| assert re.search(r'colors: list\[str\] = \[\\?"var\(--gray-12\)\\?"', rendered) | ||
| assert not re.search(r'colors: list\[str\] = \[\\?"black\\?"', rendered) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.