Skip to content

Commit

Permalink
feat: removed wrapper <div> inside root
Browse files Browse the repository at this point in the history
There's just one left now!
  • Loading branch information
arctic-hen7 committed Sep 2, 2022
1 parent 011f0e1 commit 3198558
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
6 changes: 3 additions & 3 deletions examples/demos/full_page_layout/static/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
/* This makes all the elements that wrap our code take up the whole page, so that we can put things at the bottom.
* Without this, the footer would be just beneath the content if the content doesn't fill the whole page (try disabling this).
*
* Quirk: we have to deal with the wrapper around `#root` created by `PerseusRoot` as well as the wrapper inside it (both will be gone by v0.4.0 stabilization)
* Quirk: we have to deal with the wrapper around `#root` created by `PerseusRoot`
*/
html, body, body > div, #root, #root > div {
html, body, body > div, #root {
height: 100%;
}
/* This makes the `<div>` that wraps our whole app use CSS Grid to display three sections: the header, content, and footer.
* Quirk: soon, this will just be `#root`
*/
#root > div {
#root {
display: grid;
grid-template-columns: 1fr;
/* The header will be automatically sized, the footer will be as small as possible, and the content will take up the rest of the space in the middle */
Expand Down
5 changes: 1 addition & 4 deletions packages/perseus/src/router/router_component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -391,10 +391,7 @@ pub(crate) fn perseus_router(
// The main reason for this is that the router only intercepts click events from its children

view! { cx,
// BUG (Sycamore): We can't remove this `div` yet...
div {
(*curr_view.get())
}
(*curr_view.get())
}
}
)
Expand Down
2 changes: 1 addition & 1 deletion packages/perseus/src/server/html_shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ impl fmt::Display for HtmlShell {
let html_replacement = format!(
// We give the content a specific ID so that it can be deleted if an error page needs
// to be rendered on the client-side
"{}<div>{}</div>",
"{}{}",
&html_to_replace_double, self.content,
);
// Now interpolate that HTML into the HTML shell
Expand Down

0 comments on commit 3198558

Please sign in to comment.