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

ブログの文字両端ぞろえ & カスタムコンポーネント追加 #29

Merged
merged 3 commits into from
Jan 5, 2024
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
7 changes: 7 additions & 0 deletions src/components/Anchor.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
const props = Astro.props;
---

<a {...props} target="_blank" rel="noopener noreferrer">
<slot />
</a>
11 changes: 10 additions & 1 deletion src/components/ImageWrapper.astro
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ interface Props {
src: ImageMetadata;
alt: string;
quality: string;
description?: string;
}

const { src, alt, quality } = Astro.props;
const { src, alt, quality, description } = Astro.props;
---

<div>
<Image {src} {alt} {quality} />
{description && <p>{description}</p>}
</div>

<style>
Expand All @@ -22,5 +24,12 @@ const { src, alt, quality } = Astro.props;
width: 100%;
height: auto;
}

& p {
font-size: 0.8rem;
color: var(--darker-type);
margin-top: 0;
text-align: center;
}
}
</style>
1 change: 1 addition & 0 deletions src/layouts/Layout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ const { title, description } = Astro.props;
<style is:global>
:root {
--type-color: #d8d8d8;
--darker-type: #999999;
--background-color: #232323;
--main-color: #06cdf4;
--darker-main: #059ab7;
Expand Down
42 changes: 42 additions & 0 deletions src/layouts/MarkdownPostLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ const { frontmatter } = Astro.props;
max-width: 700px;
margin: auto;
margin-top: 30px;
text-align: justify;

& .post-title {
font-size: 1.7em;
Expand Down Expand Up @@ -80,6 +81,7 @@ const { frontmatter } = Astro.props;
}
}

/* インラインコード */
p > code {
color: hsla(250, 14%, 80%, 1);
font-family: "Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono",
Expand All @@ -89,4 +91,44 @@ const { frontmatter } = Astro.props;
margin: 0 5px;
border-radius: 5px;
}

/* 引用 CSS Stock(https://pote-chil.com/css-stock/ja/quote)を参考 */
blockquote {
position: relative;
font-style: italic;
margin: 0;
padding: 3em 3.5em 2.5em 3.5em;
color: #d8d8d8;
background-color: #333333;

& ::before {
display: inline-block;
position: absolute;
top: 1em;
left: 1.5em;
width: 2em;
height: 2em;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4.58341 17.3211C3.55316 16.2274 3 15 3 13.0103C3 9.51086 5.45651 6.37366 9.03059 4.82318L9.92328 6.20079C6.58804 8.00539 5.93618 10.346 5.67564 11.822C6.21263 11.5443 6.91558 11.4466 7.60471 11.5105C9.40908 11.6778 10.8312 13.159 10.8312 15C10.8312 16.933 9.26416 18.5 7.33116 18.5C6.2581 18.5 5.23196 18.0095 4.58341 17.3211ZM14.5834 17.3211C13.5532 16.2274 13 15 13 13.0103C13 9.51086 15.4565 6.37366 19.0306 4.82318L19.9233 6.20079C16.588 8.00539 15.9362 10.346 15.6756 11.822C16.2126 11.5443 16.9156 11.4466 17.6047 11.5105C19.4091 11.6778 20.8312 13.159 20.8312 15C20.8312 16.933 19.2642 18.5 17.3312 18.5C16.2581 18.5 15.232 18.0095 14.5834 17.3211Z' fill='%2306cdf4'%3E%3C/path%3E%3C/svg%3E");
background-repeat: no-repeat;
content: "";
}

& ::after {
display: inline-block;
position: absolute;
bottom: 1em;
right: 1.5em;
width: 2em;
height: 2em;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4.58341 17.3211C3.55316 16.2274 3 15 3 13.0103C3 9.51086 5.45651 6.37366 9.03059 4.82318L9.92328 6.20079C6.58804 8.00539 5.93618 10.346 5.67564 11.822C6.21263 11.5443 6.91558 11.4466 7.60471 11.5105C9.40908 11.6778 10.8312 13.159 10.8312 15C10.8312 16.933 9.26416 18.5 7.33116 18.5C6.2581 18.5 5.23196 18.0095 4.58341 17.3211ZM14.5834 17.3211C13.5532 16.2274 13 15 13 13.0103C13 9.51086 15.4565 6.37366 19.0306 4.82318L19.9233 6.20079C16.588 8.00539 15.9362 10.346 15.6756 11.822C16.2126 11.5443 16.9156 11.4466 17.6047 11.5105C19.4091 11.6778 20.8312 13.159 20.8312 15C20.8312 16.933 19.2642 18.5 17.3312 18.5C16.2581 18.5 15.232 18.0095 14.5834 17.3211Z' fill='%2306cdf4'%3E%3C/path%3E%3C/svg%3E");
background-repeat: no-repeat;
content: "";
transform: rotate(180deg);
}

& p {
margin: 0;
text-align: justify;
}
}
</style>
Binary file modified tests/vrt.spec.ts-snapshots/記事ページ-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.