-
Notifications
You must be signed in to change notification settings - Fork 114
fix: include_css and include_js can't use files from same dir #2069
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 6 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
5aaa249
including notes
elnelson575 cc15245
Removing notes to self
elnelson575 e6b8260
cleanup
elnelson575 0fb5ccf
Merge branch 'main' into fix/js_css_inclusion
elnelson575 03839f0
Fixing types
elnelson575 649c856
Merge branch 'fix/js_css_inclusion' of github.com:posit-dev/py-shiny …
elnelson575 c1a11a1
Updating tests
elnelson575 ff8581e
Debugging
elnelson575 c888903
fixes
elnelson575 f00c2b9
Minor update
elnelson575 6488c37
Updating the js scripts
elnelson575 5418fe4
updates
elnelson575 d701018
Merge branch 'main' into fix/js_css_inclusion
elnelson575 7525f41
Update shiny/ui/_include_helpers.py
elnelson575 afe3018
Update shiny/ui/_include_helpers.py
elnelson575 8e39226
Update shiny/ui/_include_helpers.py
elnelson575 7ae5671
Update shiny/ui/_include_helpers.py
elnelson575 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,22 @@ | ||
| from shiny import App, Inputs, Outputs, Session, ui | ||
|
|
||
| # Define the UI | ||
| app_ui = ui.page_fluid( | ||
| ui.include_css("./www/style.css"), # Reference the external CSS file | ||
| ui.include_js("./www/customjs.js"), | ||
| ui.h1("Simple Shiny App with External CSS"), | ||
| ui.div( | ||
| ui.p("This is a simple Shiny app that demonstrates ui.include_css()"), | ||
| ui.p("The styling comes from an external CSS file!"), | ||
| class_="content", | ||
| ), | ||
| ) | ||
|
|
||
|
|
||
| # Define the server | ||
| def server(input: Inputs, output: Outputs, session: Session): | ||
| pass | ||
|
|
||
|
|
||
| # Create and run the app | ||
| app = App(app_ui, server) | ||
1 change: 1 addition & 0 deletions
1
tests/playwright/shiny/bugs/2061-css-js-inclusion/www/customjs.js
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 @@ | ||
| console.log("heyo") | ||
elnelson575 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
19 changes: 19 additions & 0 deletions
19
tests/playwright/shiny/bugs/2061-css-js-inclusion/www/style.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,19 @@ | ||
|
|
||
| body { | ||
| background-color: #f0f8ff; | ||
| font-family: Arial, sans-serif; | ||
| } | ||
|
|
||
| h1 { | ||
| color: #4682b4; | ||
| border-bottom: 2px solid #4682b4; | ||
| padding-bottom: 10px; | ||
| } | ||
|
|
||
| .content { | ||
| margin: 20px; | ||
| padding: 15px; | ||
| background-color: white; | ||
| border-radius: 5px; | ||
| box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); | ||
| } |
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.