Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

見出しのスタイルを調整 #42

Merged
merged 3 commits into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 3 additions & 0 deletions src/components/Header.astro
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ const links: HeaderLink[] = [
position: fixed;
width: 100%;
transition: background-color 0.25s ease;
z-index: 100;
/* ナビゲーションが透明のときのスタイルの指定 */
&[data-navigation_style="transparent"] {
background-color: rgba(0, 0, 0, 0.25);
Expand Down Expand Up @@ -262,10 +263,12 @@ const links: HeaderLink[] = [
flex-direction: row;
align-items: center;
width: 100%;
height: $navigation-height;
max-width: $content-width;
margin-inline: auto;
padding-inline: $side-padding;
@media screen and ($sp-query) {
height: auto;
flex-direction: column;
align-items: flex-start;
max-width: none;
Expand Down
1 change: 1 addition & 0 deletions src/layouts/BaseLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const { ...head } = Astro.props;

import "src/styles/reset.scss";
import "src/styles/global.scss";
import "src/styles/heading.scss";

import { GoogleFontsOptimizer } from "astro-google-fonts-optimizer";

Expand Down
14 changes: 4 additions & 10 deletions src/layouts/ContentLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,8 @@ const { ...head } = Astro.props;
<Footer />
</BaseLayout>

<script>
const navigation = document.getElementById("top-navigation");
const main = document.getElementById("content");

// ナビゲーションバーの高さ(maginを含む)を計測
const navigation_height = navigation?.offsetHeight;

if (main) {
main.style.marginTop = `${navigation_height}px`;
<style lang="scss">
main {
margin-block-start: $navigation-height;
}
</script>
</style>
33 changes: 2 additions & 31 deletions src/styles/global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,9 @@ body {

min-height: 100vh;

font-family: $fonts-mulish, $fonts-latin, $fonts-japanese, sans-serif;
}

h1 {
font-family: $fonts-zen, sans-serif;
font-size: 4rem;
font-weight: 300;

@media screen and ($sp-query) {
font-size: 3.2em;
}
}

h2 {
font-size: 1.5rem;
font-weight: 400;
line-height: 1.5;
}
background-color: $background;

h3 {
font-size: 1.125rem;
font-weight: 400;
font-family: $fonts-mulish, $fonts-latin, $fonts-japanese, sans-serif;
}

p {
Expand Down Expand Up @@ -66,16 +47,6 @@ main section {
margin: 1.5rem 0;
}

main h2 {
font-weight: 600;
margin: 0.25em 0;
line-height: 1.5;

/* 左側のオレンジ線 */
border-inline-start: 0.25em solid $orange;
padding-inline-start: 1ch;
}

/* 秘伝のタレ */
.aria {
position: absolute;
Expand Down
51 changes: 51 additions & 0 deletions src/styles/heading.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
h1 {
font-family: $fonts-zen, sans-serif;
font-size: 4rem;
font-weight: 300;

@media screen and ($sp-query) {
font-size: 3.2em;
}
}

h2 {
font-size: 1.5rem;
font-weight: 400;
line-height: 1.5;
}

h3 {
font-size: 1.125rem;
font-weight: 400;
}

main {
h1 {
display: inline-block;
position: relative;
font-size: 2.75em;
font-family: $fonts-zen, sans-serif;
padding-block-end: 0.3em;
border-block-end: 1px solid $blue;
margin: 0.5em 0;
&::before {
content: "";
width: 0.5ic;
height: 1px;
background: $orange;
position: absolute;
bottom: -1px;
left: 0px;
z-index: 1;
}
}
h2 {
font-weight: 600;
margin: 0.25em 0;
line-height: 1.5;

/* 左側のオレンジ線 */
border-inline-start: 0.25em solid $orange;
padding-inline-start: 1ch;
}
}