1
0
mirror of https://github.com/cotes2020/jekyll-theme-chirpy.git synced 2025-12-18 05:41:31 +00:00

perf(ui): improve related posts design

This commit is contained in:
Cotes Chung
2023-03-21 07:20:32 +08:00
parent 97b8dfeed6
commit 2918da9f29
9 changed files with 48 additions and 75 deletions

View File

@@ -1,7 +1,6 @@
/*
Style for Homepage
*/
$card-radius: 0.5rem;
#post-list {
margin-top: 1.75rem;
@@ -19,31 +18,6 @@ $card-radius: 0.5rem;
}
.card {
border-radius: $card-radius;
border: 0;
background: var(--card-bg);
box-shadow: rgba(0, 0, 0, 0.05) 0 6px 14px 0,
rgba(172, 169, 169, 0.08) 0 0 0 1px;
&::before {
content: '';
position: absolute;
background: var(--card-hovor-bg);
opacity: 0;
width: 100%;
height: 100%;
border-radius: $card-radius;
z-index: 1;
}
&:hover {
border-color: var(--card-hovor-bg);
&::before {
opacity: 0.5;
}
}
%img-radius {
border-radius: $card-radius $card-radius 0 0;
}
@@ -168,16 +142,6 @@ $card-radius: 0.5rem;
} /* .page-item */
} /* .pagination */
@media (hover: hover) {
#post-list .card {
transition: border-color 0.35s ease-in-out;
&::before {
transition: opacity 0.35s ease-in-out;
}
}
}
/* Tablet */
@media all and (min-width: 768px) {
#post-list {

View File

@@ -333,24 +333,13 @@ h1 + .post-meta {
}
a:hover {
text-decoration: none;
@extend %no-decoration;
}
.card {
border-color: var(--card-border-color);
background-color: var(--card-bg);
box-shadow: 0 0 5px 0 var(--card-box-shadow);
transition: all 0.3s ease-in-out;
h3 {
@extend %text-color;
}
&:hover {
-webkit-transform: translate3d(0, -3px, 0);
transform: translate3d(0, -3px, 0);
box-shadow: 0 10px 15px -4px rgba(0, 0, 0, 0.15);
}
}
}