Skip to content

Commit

Permalink
[AppLayout] Use margin instead of padding on main to not conflict wit…
Browse files Browse the repository at this point in the history
…h `<main class="p-4">` usage
  • Loading branch information
techniq committed Jun 21, 2024
1 parent 91b58c5 commit 11b68b0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/popular-steaks-help.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'svelte-ux': patch
---

[AppLayout] Use margin instead of padding on main to not conflict with `<main class="p-4">` usage
8 changes: 7 additions & 1 deletion packages/svelte-ux/src/lib/components/AppLayout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,13 @@
style:--areas={areas}
class={cls(
'AppLayout',
'grid grid-cols-[auto,1fr] grid-rows-[var(--headerHeight),1fr] h-screen',
'[&>header]:fixed [&>header]:top-0 [&>header]:h-[var(--headerHeight)] [&>header]:transition-all',
headerPosition === 'full' || temporaryDrawer
? '[&>header]:w-full'
: '[&>header]:w-[calc(100%-var(--drawerWidth))] [&>header]:left-[var(--drawerWidth)] [&>header]:duration-500',
'[&>main]:md:ml-[var(--drawerWidth)] [&>main]:mt-[var(--headerHeight)] [&>main]:transition-[margin] [&>main]:duration-500',
/* Fix scrolling offset for headings (h1, ...) or other elements with an id set (`<a href="#id">`) */
'[:where(&_[id])]:scroll-m-[var(--headerHeight)]',
settingsClasses.root,
classes.root,
$$props.class
Expand Down

0 comments on commit 11b68b0

Please sign in to comment.