Repository navigation
feat: add_page(stylesheets=...) for stylesheets only one page loads #8007
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
Open
benedikt-bartscher
wants to merge
20
commits into
reflex-dev:main
Choose a base branch
from
benedikt-bartscher:page-stylesheets
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
269c675
feat: add_page(stylesheets=...) for stylesheets only one page loads
benedikt-bartscher f2c7596
Merge remote-tracking branch 'github/main' into page-stylesheets
benedikt-bartscher 8771b81
docs: link the page stylesheet example from the assets root so the do…
benedikt-bartscher 1c67e57
docs: link the page stylesheet example from the assets root so the do…
benedikt-bartscher f626c69
Merge commit '1c67e57c82' into page-stylesheets
benedikt-bartscher 0416e78
fix: keep a page's stylesheets when its @rx.page function is added again
benedikt-bartscher 0a7f236
fix: compile a sass stylesheet named like another one to its own file
benedikt-bartscher 2ed603b
test: navigate client-side between the pages of the page stylesheet test
benedikt-bartscher 15e0b5a
test: compare the plain page's compiled output in full
benedikt-bartscher bbf8c69
fix: keep a page's stylesheets when its @rx.page function is added again
benedikt-bartscher d3ffa21
fix: compile a sass stylesheet named like another one to its own file
benedikt-bartscher d1179ac
test: navigate client-side between the pages of the page stylesheet test
benedikt-bartscher 945a824
test: compare the plain page's compiled output in full
benedikt-bartscher c2e2357
Merge commit '945a824083' into page-stylesheets
benedikt-bartscher 2377cbc
Merge branch 'main' into page-stylesheets
benedikt-bartscher d72b9ba
fix: take a single page stylesheet given as a string as one stylesheet
benedikt-bartscher 29267f9
fix: give page hooks a page's stylesheets in backend-only compiles too
benedikt-bartscher c2d35c5
fix: load page stylesheets in an embedded app, which renders no <Links/>
benedikt-bartscher 24d84bc
docs: say what plugins see of page stylesheets in the reflex-base news
benedikt-bartscher 59c3190
Merge commit '24d84bcd1a' into page-stylesheets
benedikt-bartscher 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
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 @@ | ||
| `add_page` and `@rx.page` take `stylesheets=`, stylesheets only that page loads, after the app's: `app.add_page(pricing, stylesheets=["/pages/pricing.css"])`. They take the same asset files and URLs as `rx.App(stylesheets=...)` and become the page's React Router `links`, so they are in the prerendered `<head>`, load before the page renders on client-side navigation and are removed when it is left, in an `EmbedPlugin` widget too. |
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 @@ | ||
| A sass stylesheet named like another stylesheet next to it, such as `theme.scss` beside `theme.css`, no longer compiles to the same file in `.web/styles`, where whichever compiled last replaced the other: it keeps its suffix there, as `theme.scss.css`. |
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 @@ | ||
| Plugins see a page's stylesheets: the `add_page` that `register_route` receives takes `stylesheets=`, and `PageContext.stylesheets` holds them. `page_template` takes `links`, which the route module exports as React Router's `links`, and an embedded app's entry renders them with their page, as it has no `<Links/>`. |
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
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
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
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
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.
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.