Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 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
5 changes: 3 additions & 2 deletions shiny/ui/_include_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,11 +240,12 @@ def maybe_copy_files(path: Path | str, include_files: bool) -> tuple[str, str]:

def get_hash(path: Path | str, include_files: bool) -> str:
if include_files:
key = get_file_key(path)
else:
dir = os.path.dirname(path)
files = glob.iglob(os.path.join(dir, "**"), recursive=True)
key = "\n".join([get_file_key(x) for x in files])
else:
key = get_file_key(path)

return hash_deterministic(key)


Expand Down
22 changes: 22 additions & 0 deletions tests/playwright/shiny/bugs/2061-css-js-inclusion/app.py
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)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log("heyo")
19 changes: 19 additions & 0 deletions tests/playwright/shiny/bugs/2061-css-js-inclusion/www/style.css
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);
}
Loading