add some styling
This commit is contained in:
parent
3ef5b9e59d
commit
beb7642637
@ -14,7 +14,105 @@
|
|||||||
</html>
|
</html>
|
||||||
|
|
||||||
<style is:global>
|
<style is:global>
|
||||||
/* Unscoped, delivered as-is to the browser.
|
* {
|
||||||
Applies to all <h1> tags on your site. */
|
margin: 0;
|
||||||
h1 { color: red; }
|
padding: 0;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
font-size: 1.25rem;
|
||||||
|
line-height: 1.25;
|
||||||
|
}
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
font-size: 0.875rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
margin-block-end: 1.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
font-family: system-ui, sans-serif;
|
||||||
|
font-size: 1rem;
|
||||||
|
line-height: 1.7;
|
||||||
|
color: #161616;
|
||||||
|
background-color: #f3f3f3;
|
||||||
|
|
||||||
|
min-block-size: 100vh;
|
||||||
|
min-block-size: 100dvh;
|
||||||
|
display: grid;
|
||||||
|
/* grid-template-columns: 100px 150px 200px 200px; */
|
||||||
|
/* grid-template-columns: 100px auto 10rem 200px; */
|
||||||
|
/* grid-template-columns: 100px auto repeat(2, 200px); */
|
||||||
|
/* grid-template-columns: repeat(2, 100px 200px); */
|
||||||
|
grid-template-columns: 5rem 1fr;
|
||||||
|
|
||||||
|
/* grid-template-rows: 100px 200px 100px; */
|
||||||
|
grid-template-rows: auto 1fr auto;
|
||||||
|
|
||||||
|
grid-template-areas:
|
||||||
|
"header header"
|
||||||
|
"sidebar main"
|
||||||
|
"footer footer";
|
||||||
|
|
||||||
|
grid-template-areas:
|
||||||
|
"sidebar header"
|
||||||
|
"sidebar main"
|
||||||
|
"footer footer";
|
||||||
|
|
||||||
|
transition: grid-template-columns 0.3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
body.sb-expand {
|
||||||
|
grid-template-columns: 12.5rem 1fr;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dashboard-header {
|
||||||
|
grid-area: header;
|
||||||
|
background-color: #fff;
|
||||||
|
padding: 1.25rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dashboard-footer {
|
||||||
|
grid-area: footer;
|
||||||
|
background-color: #fff;
|
||||||
|
padding: 1.25rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dashboard-main {
|
||||||
|
grid-area: main;
|
||||||
|
padding: 1.25rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dashboard-sidebar {
|
||||||
|
overflow: hidden;
|
||||||
|
position: relative;
|
||||||
|
grid-area: sidebar;
|
||||||
|
color: #fff;
|
||||||
|
background-color: #1d1d29;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dashboard-sidebar button {
|
||||||
|
position: absolute;
|
||||||
|
inset: 4.5rem -0.75rem auto auto;
|
||||||
|
width: 1.5rem;
|
||||||
|
aspect-ratio: 1;
|
||||||
|
background-color: #fff;
|
||||||
|
border: solid 1px;
|
||||||
|
border-radius: 50%;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.logo {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
font-size: 3rem;
|
||||||
|
line-height: 1.3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mynavi {
|
||||||
|
overflow-x: auto;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -7,5 +7,73 @@ import Layout from '../layouts/Layout.astro';
|
|||||||
---
|
---
|
||||||
|
|
||||||
<Layout>
|
<Layout>
|
||||||
<h1>bla bla bla</h1>
|
<header class="dashboard-header">
|
||||||
|
<h1>CSS Grid - Full-Height Page Layout</h1>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<aside class="dashboard-sidebar">
|
||||||
|
<div class="logo">♔</div>
|
||||||
|
<button type="button" id="resize">
|
||||||
|
☰
|
||||||
|
</button>
|
||||||
|
<div class="mynav">
|
||||||
|
blabla<br/>
|
||||||
|
blabla<br/>
|
||||||
|
blabla<br/>
|
||||||
|
blabla<br/>
|
||||||
|
blabla<br/>
|
||||||
|
blabla<br/>
|
||||||
|
blabla<br/>
|
||||||
|
blabla<br/>
|
||||||
|
blabla<br/>
|
||||||
|
blabla<br/>
|
||||||
|
blabla<br/>
|
||||||
|
blabla<br/>
|
||||||
|
blabla<br/>
|
||||||
|
blabla<br/>
|
||||||
|
blabla<br/>
|
||||||
|
blabla<br/>
|
||||||
|
blabla<br/>
|
||||||
|
blabla<br/>
|
||||||
|
blabla<br/>
|
||||||
|
blabla<br/>
|
||||||
|
blabla<br/>
|
||||||
|
blabla<br/>
|
||||||
|
blabla<br/>
|
||||||
|
blabla<br/>
|
||||||
|
blabla<br/>
|
||||||
|
blabla<br/>
|
||||||
|
blabla<br/>
|
||||||
|
blabla<br/>
|
||||||
|
blabla<br/>
|
||||||
|
blabla<br/>
|
||||||
|
blabla<br/>
|
||||||
|
blabla<br/>
|
||||||
|
blabla<br/>
|
||||||
|
blabla<br/>
|
||||||
|
blabla<br/>
|
||||||
|
</div>
|
||||||
|
</aside>
|
||||||
|
|
||||||
|
<main class="dashboard-main">
|
||||||
|
Main<br/>
|
||||||
|
Main<br/>
|
||||||
|
Main<br/>
|
||||||
|
Main<br/>
|
||||||
|
Main<br/>
|
||||||
|
Main<br/>
|
||||||
|
Main<br/>
|
||||||
|
</main>
|
||||||
|
|
||||||
|
<footer class="dashboard-footer">
|
||||||
|
Footer
|
||||||
|
</footer>
|
||||||
</Layout>
|
</Layout>
|
||||||
|
|
||||||
|
<script is:inline>
|
||||||
|
const resizeBtn = document.getElementById('resize');
|
||||||
|
resizeBtn.addEventListener('click', function(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
document.body.classList.toggle('sb-expand');
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user