mirror of
https://github.com/maciejpedzich/maciejpedzi.ch.git
synced 2024-11-27 23:55:47 +01:00
Add global styling for post list and article links
This commit is contained in:
parent
550f361792
commit
e97a8217bd
@ -26,11 +26,10 @@ const posts = (
|
|||||||
<main>
|
<main>
|
||||||
<section>
|
<section>
|
||||||
<h2>My blog</h2>
|
<h2>My blog</h2>
|
||||||
<ul>
|
<ul class="post-list">
|
||||||
{
|
{
|
||||||
posts.map((post) => (
|
posts.map((post) => (
|
||||||
<li>
|
<li>
|
||||||
<FormattedDate date={post.data.pubDate} />
|
|
||||||
<a href={`/blog/${post.slug}/`}>{post.data.title}</a>
|
<a href={`/blog/${post.slug}/`}>{post.data.title}</a>
|
||||||
</li>
|
</li>
|
||||||
))
|
))
|
||||||
|
@ -14,9 +14,10 @@ import { SITE_TITLE, SITE_DESCRIPTION } from '../consts';
|
|||||||
<body>
|
<body>
|
||||||
<Header title={SITE_TITLE} />
|
<Header title={SITE_TITLE} />
|
||||||
<main>
|
<main>
|
||||||
<h2>Welcome to my website!</h2>
|
<section>
|
||||||
|
<h2>Welcome to my website</h2>
|
||||||
<p>
|
<p>
|
||||||
My name is <strong>Maciej</strong>, but if you don't know how to
|
My name is <strong>Maciej</strong>, but if you're not sure how to
|
||||||
pronounce it, then you can call me <strong>Mac</strong>. I'm an
|
pronounce it, then you can call me <strong>Mac</strong>. I'm an
|
||||||
eighteen-year-old frontend developer from <strong>Poland</strong>.
|
eighteen-year-old frontend developer from <strong>Poland</strong>.
|
||||||
Although I mainly use <strong>Vue</strong> and <strong>Nuxt</strong> for
|
Although I mainly use <strong>Vue</strong> and <strong>Nuxt</strong> for
|
||||||
@ -24,29 +25,32 @@ import { SITE_TITLE, SITE_DESCRIPTION } from '../consts';
|
|||||||
>Astro</strong
|
>Astro</strong
|
||||||
>.
|
>.
|
||||||
</p>
|
</p>
|
||||||
|
</section>
|
||||||
|
<section>
|
||||||
<h3>My blog</h3>
|
<h3>My blog</h3>
|
||||||
<p>
|
<p>
|
||||||
It serves as a means of documenting the development process and inner
|
It serves as a means of documenting the development process and inner
|
||||||
workings of <a href="/projects">my applications</a>. Check out my latest
|
workings of <a href="/projects">my applications</a>. Check out the
|
||||||
posts below:
|
latest posts below:
|
||||||
</p>
|
</p>
|
||||||
<ul>
|
<ul class="post-list">
|
||||||
<li>
|
<li>
|
||||||
<FormattedDate date={new Date()} />
|
<a href="#">This link leads nowhere</a>
|
||||||
<a href="#">Lorem Ipsum</a>
|
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<FormattedDate date={new Date()} />
|
<a href="#"
|
||||||
<a href="#">Lorem Ipsum</a>
|
>And so does this one. But why is that, some of you may ask</a
|
||||||
|
>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<FormattedDate date={new Date()} />
|
<a href="#">The answer is simple. They're placeholders</a>
|
||||||
<a href="#">Lorem Ipsum</a>
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
</section>
|
||||||
|
<section>
|
||||||
<h3>Enjoy my work?</h3>
|
<h3>Enjoy my work?</h3>
|
||||||
<p>
|
<p>
|
||||||
If so, then make sure to follow me on <a
|
If so, make sure to follow me on <a
|
||||||
href="https://github.com/maciejpedzich"
|
href="https://github.com/maciejpedzich"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener noreferrer">GitHub</a
|
rel="noopener noreferrer">GitHub</a
|
||||||
@ -58,6 +62,7 @@ import { SITE_TITLE, SITE_DESCRIPTION } from '../consts';
|
|||||||
>Mastodon</a
|
>Mastodon</a
|
||||||
>.
|
>.
|
||||||
</p>
|
</p>
|
||||||
|
</section>
|
||||||
</main>
|
</main>
|
||||||
<Footer />
|
<Footer />
|
||||||
<style>
|
<style>
|
||||||
@ -65,9 +70,8 @@ import { SITE_TITLE, SITE_DESCRIPTION } from '../consts';
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
h2,
|
section {
|
||||||
h3 {
|
margin-bottom: 1.25rem;
|
||||||
text-transform: none;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
h3 {
|
h3 {
|
||||||
@ -75,7 +79,7 @@ import { SITE_TITLE, SITE_DESCRIPTION } from '../consts';
|
|||||||
}
|
}
|
||||||
|
|
||||||
p {
|
p {
|
||||||
margin: 0.5rem 0 1rem 0;
|
margin: 0 0 1rem 0;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</body>
|
</body>
|
||||||
|
@ -4,19 +4,24 @@
|
|||||||
License MIT: https://github.com/HermanMartinus/bearblog/blob/master/LICENSE.md
|
License MIT: https://github.com/HermanMartinus/bearblog/blob/master/LICENSE.md
|
||||||
*/
|
*/
|
||||||
body {
|
body {
|
||||||
|
margin: 0 auto;
|
||||||
|
padding: 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
max-width: min(65ch, 90%);
|
max-width: min(65ch, 90%);
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
|
line-height: 1.8;
|
||||||
|
font-size: 1rem;
|
||||||
font-family: Arial, Helvetica, sans-serif;
|
font-family: Arial, Helvetica, sans-serif;
|
||||||
margin: 0 auto;
|
|
||||||
padding: 0;
|
|
||||||
background-color: #485870;
|
background-color: #485870;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
overflow-wrap: break-word;
|
overflow-wrap: break-word;
|
||||||
line-height: 1.8;
|
}
|
||||||
|
|
||||||
|
main {
|
||||||
|
flex: 1 1 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
h1,
|
h1,
|
||||||
@ -34,7 +39,7 @@ a:visited {
|
|||||||
|
|
||||||
a:hover,
|
a:hover,
|
||||||
a:active {
|
a:active {
|
||||||
color: rgba(255, 255, 255, 0.4);
|
color: #bbb;
|
||||||
}
|
}
|
||||||
|
|
||||||
a:focus {
|
a:focus {
|
||||||
@ -46,30 +51,22 @@ p {
|
|||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
main {
|
|
||||||
flex: 1 1 auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
a:visited {
|
a:visited {
|
||||||
color: unset;
|
color: unset;
|
||||||
}
|
}
|
||||||
|
|
||||||
ul {
|
ul {
|
||||||
list-style-type: none;
|
list-style: none;
|
||||||
padding: unset;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ul li {
|
ul li {
|
||||||
display: flex;
|
text-align: left;
|
||||||
justify-content: center;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ul li::before {
|
li::before {
|
||||||
content: '-';
|
content: '\25A1';
|
||||||
}
|
font-size: 1.2em;
|
||||||
|
margin-right: 3px;
|
||||||
ul li time {
|
|
||||||
flex: 0 0 112px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
textarea {
|
textarea {
|
||||||
@ -131,7 +128,7 @@ h1.cmr2-text {
|
|||||||
|
|
||||||
.cmr2-text > span,
|
.cmr2-text > span,
|
||||||
.cmr2-text > a {
|
.cmr2-text > a {
|
||||||
border-left-width: 0.05em;
|
border-left-width: 1px;
|
||||||
border-left-style: solid;
|
border-left-style: solid;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
@ -149,7 +146,7 @@ h1.cmr2-text {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.cmr2-text > a {
|
.cmr2-text > a {
|
||||||
padding: 0.05em 0.7em;
|
padding: 0 0.7em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cmr2-text > span:first-of-type,
|
.cmr2-text > span:first-of-type,
|
||||||
@ -161,3 +158,66 @@ h1.cmr2-text {
|
|||||||
.cmr2-text > a:focus {
|
.cmr2-text > a:focus {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* The following styling rules have been adopted from: https://github.com/codrops/LineHoverStyles/ */
|
||||||
|
|
||||||
|
.post-list a {
|
||||||
|
position: relative;
|
||||||
|
outline: none;
|
||||||
|
cursor: pointer;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.post-list a:focus {
|
||||||
|
outline: 2px solid #bbb;
|
||||||
|
outline-offset: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.post-list a:focus:not(:focus-visible) {
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:focus-visible {
|
||||||
|
outline: 2px solid #bbb;
|
||||||
|
outline-offset: 3px;
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.post-list a:hover {
|
||||||
|
outline: none;
|
||||||
|
color: #bbb;
|
||||||
|
}
|
||||||
|
|
||||||
|
.post-list a::before,
|
||||||
|
.post-list a::after {
|
||||||
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
height: 1px;
|
||||||
|
background: currentColor;
|
||||||
|
top: 100%;
|
||||||
|
left: 0;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.post-list a::before {
|
||||||
|
content: '';
|
||||||
|
transform-origin: 0% 50%;
|
||||||
|
transform: scale3d(0, 1, 1);
|
||||||
|
transition: transform 0.3s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.post-list a:hover::before {
|
||||||
|
transform: scale3d(1, 1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.post-list a::after {
|
||||||
|
content: '';
|
||||||
|
top: calc(100% + 4px);
|
||||||
|
transition: transform 0.3s;
|
||||||
|
transform-origin: 100% 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.post-list a:hover::after {
|
||||||
|
transform: scale3d(0, 1, 1);
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user