Skip to content

Commit

Permalink
adds main layout and place content utilities
Browse files Browse the repository at this point in the history
  • Loading branch information
stolinski committed Jul 5, 2023
1 parent b39de73 commit 44ca804
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 16 deletions.
8 changes: 2 additions & 6 deletions src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
<div class={'theme-' + $theme + ' theme-wrapper'}>
<Header {user} />

<div class="page-layout">
<main>
<div class="page-layout main-layout">
<main class="place-content">
<slot />
</main>
</div>
Expand All @@ -56,7 +56,6 @@
main {
padding: 2rem;
grid-column: 2;
@media (min-width: 1280px) {
padding: 0;
}
Expand All @@ -70,9 +69,6 @@
@media (min-width: 1280px) {
.page-layout {
gap: 48px;
display: grid;
grid-template-columns: 144px minmax(0, 18fr) 144px;
grid-auto-flow: column;
grid-template-rows: 1fr;
}
Expand Down
11 changes: 2 additions & 9 deletions src/routes/Header.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
$: header_element = $page.route.id === '/' ? 'h1' : 'h2';
</script>

<header>
<div class="header-container">
<header class="main-layout">
<div class="header-container place-content">
<svelte:element this={header_element}>
<a href="/">
<svg width="80px" viewBox="0 0 1371 1212" fill="none" xmlns="http://www.w3.org/2000/svg">
Expand Down Expand Up @@ -55,27 +55,20 @@
}
header {
background-image: url('https://syntax.fm/static/background.jpg');
background-color: var(--bg);
color: var(--color);
@media (min-width: 1280px) {
column-gap: 48px;
display: grid;
grid-template-columns: [start margin] 144px [margin content] minmax(0, 18fr) [content end-margin] 144px [end-margin end];
grid-auto-flow: column;
grid-template-rows: 1fr auto;
}
}
.header-container {
display: grid;
padding: 10px 0;
align-items: center;
grid-column: content / content;
row-gap: 20px;
width: 100%;
grid-template-columns: [start logo] 88px [logo actions] auto [actions end];
max-width: 1600px;
margin: 0 auto;
Expand Down
3 changes: 2 additions & 1 deletion src/routes/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@

/* The main css entry. Primarily used to import stuff */

@layer reset base theme utilities;
@layer reset base layout theme utilities;

/* Import all css themes */
@import '../styles/base.css';
@import '../styles/variables.css';
@import '../styles/layout.css';
@import '../styles/buttons.css';

/* FYI you have to use import-glob for all of these or else it gets mad */
Expand Down
14 changes: 14 additions & 0 deletions src/styles/layout.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
@layer layout {
.main-layout {
@media (min-width: 1280px) {
column-gap: 48px;
display: grid;
grid-template-columns: [start margin] 144px [margin content] minmax(0, 18fr) [content end-margin] 144px [end-margin end];
}
}

.place-content {
grid-column: content / content;
width: 100%;
}
}

1 comment on commit 44ca804

@vercel
Copy link

@vercel vercel bot commented on 44ca804 Jul 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

sytnax-website-v2 – ./

sytnax-website-v2-git-v2-syntax.vercel.app
sytnax-website-v2-syntax.vercel.app
beta.syntax.fm

Please sign in to comment.