feat: Rewrite comments thingy from https://carlschwan.eu/2020/12/29/adding-comments-to-your-static-blog-with-mastodon/
This commit is contained in:
@ -1,45 +1,43 @@
|
||||
.instance.op::before,
|
||||
.reblogs::before,
|
||||
.favourites::before {
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
display: inline-block;
|
||||
font-family: "bootstrap-icons" !important;
|
||||
font-style: normal;
|
||||
font-variant: normal;
|
||||
font-weight: normal !important;
|
||||
line-height: 1;
|
||||
text-transform: none;
|
||||
vertical-align: -0.125em;
|
||||
}
|
||||
|
||||
section#comments {
|
||||
#comments-wrapper {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2rem;
|
||||
margin-top: 2rem;
|
||||
}
|
||||
|
||||
.comment {
|
||||
display: grid;
|
||||
column-gap: 1rem;
|
||||
grid-template-areas:
|
||||
"avatar name"
|
||||
"avatar time"
|
||||
"avatar post"
|
||||
"...... card"
|
||||
"avatar name "
|
||||
"avatar time "
|
||||
"avatar post "
|
||||
"...... interactions";
|
||||
grid-template-columns: min-content;
|
||||
justify-items: start;
|
||||
margin: 2rem 0 2rem 0;
|
||||
|
||||
&.comment-reply {
|
||||
border-left: 0.25rem solid var(--fg-muted-2);
|
||||
border-radius: 0.2rem;
|
||||
padding-left: 1rem;
|
||||
}
|
||||
|
||||
.avatar-link {
|
||||
grid-area: avatar;
|
||||
width: 4rem;
|
||||
height: 4rem;
|
||||
position: relative;
|
||||
width: 4rem;
|
||||
|
||||
.avatar {
|
||||
all: unset;
|
||||
background-color: var(--fg-muted-1);
|
||||
background-position: 50%;
|
||||
background-size: cover;
|
||||
border-radius: var(--rounded-corner);
|
||||
box-shadow: var(--shadow);
|
||||
display: block;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
transition: var(--transition);
|
||||
width: 100%;
|
||||
|
||||
@ -57,9 +55,8 @@ section#comments {
|
||||
|
||||
.author {
|
||||
align-items: center;
|
||||
cursor: default;
|
||||
display: flex;
|
||||
font-weight: bold;
|
||||
font-weight: 600;
|
||||
gap: 0.25rem;
|
||||
grid-area: name;
|
||||
|
||||
@ -68,7 +65,6 @@ section#comments {
|
||||
border-radius: 999px;
|
||||
color: var(--fg-color);
|
||||
font-size: 0.8rem;
|
||||
font-weight: 600;
|
||||
padding: 0.25rem 0.75rem;
|
||||
text-decoration: none;
|
||||
transition: var(--transition);
|
||||
@ -78,8 +74,12 @@ section#comments {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
&:active {
|
||||
transform: scale(var(--active));
|
||||
}
|
||||
|
||||
&.op {
|
||||
background-color: unset;
|
||||
background-color: transparent;
|
||||
color: var(--primary-color);
|
||||
|
||||
&:hover {
|
||||
@ -87,116 +87,52 @@ section#comments {
|
||||
}
|
||||
|
||||
&::before {
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
content: "\F4B5";
|
||||
display: inline-block;
|
||||
font-family: "bootstrap-icons" !important;
|
||||
font-style: normal;
|
||||
font-variant: normal;
|
||||
font-weight: normal !important;
|
||||
line-height: 1;
|
||||
margin-inline-end: 0.25rem;
|
||||
margin-inline-start: -0.25rem;
|
||||
text-transform: none;
|
||||
vertical-align: -0.125em;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
time {
|
||||
@extend small;
|
||||
.emoji {
|
||||
display: inline;
|
||||
height: 1.25rem;
|
||||
vertical-align: middle;
|
||||
width: 1.25rem;
|
||||
}
|
||||
|
||||
time {
|
||||
color: var(--fg-muted-5);
|
||||
font-size: 0.8rem;
|
||||
grid-area: time;
|
||||
|
||||
&.edited::after {
|
||||
content: " *";
|
||||
}
|
||||
}
|
||||
|
||||
main {
|
||||
grid-area: post;
|
||||
justify-self: stretch;
|
||||
|
||||
p:first-child {
|
||||
margin-top: 0.25rem;
|
||||
}
|
||||
|
||||
p:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.card {
|
||||
color: inherit;
|
||||
grid-area: card;
|
||||
max-width: 400px;
|
||||
text-decoration: none;
|
||||
|
||||
&:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
figure {
|
||||
border-radius: var(--rounded-corner);
|
||||
background-color: var(--fg-muted-1);
|
||||
box-shadow: var(--shadow);
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
overflow: hidden;
|
||||
transition: var(--transition);
|
||||
|
||||
img {
|
||||
all: unset;
|
||||
display: block;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
transform: translateY(-0.5rem);
|
||||
}
|
||||
}
|
||||
|
||||
figcaption {
|
||||
color: var(--fg-color);
|
||||
display: grid;
|
||||
gap: 0.5rem;
|
||||
margin: 0;
|
||||
padding: 1rem;
|
||||
text-align: left;
|
||||
|
||||
h5 {
|
||||
font-weight: 600;
|
||||
all: unset;
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
p {
|
||||
font-weight: 400;
|
||||
color: var(--fg-muted-5);
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
|
||||
* {
|
||||
display: inline-block;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Hide the card from the shared post
|
||||
&:first-of-type .card {
|
||||
display: none;
|
||||
}
|
||||
|
||||
footer {
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
grid-area: interactions;
|
||||
margin-top: 1rem;
|
||||
|
||||
.reblogs,
|
||||
.favourites {
|
||||
.faves {
|
||||
background-color: transparent;
|
||||
border-radius: var(--rounded-corner);
|
||||
font-size: 1rem;
|
||||
color: var(--red-fg);
|
||||
font-variant-numeric: tabular-nums;
|
||||
font-weight: 400;
|
||||
padding: 0.5rem 1rem;
|
||||
@ -204,6 +140,7 @@ section#comments {
|
||||
transition: var(--transition);
|
||||
|
||||
&:hover {
|
||||
background-color: var(--red-bg);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
@ -212,58 +149,20 @@ section#comments {
|
||||
}
|
||||
|
||||
&::before {
|
||||
margin-inline-end: 0.25rem;
|
||||
}
|
||||
}
|
||||
|
||||
.reblogs {
|
||||
color: var(--orange-fg);
|
||||
|
||||
&:hover {
|
||||
background-color: var(--orange-bg);
|
||||
}
|
||||
|
||||
&::before {
|
||||
content: "\F813";
|
||||
}
|
||||
}
|
||||
|
||||
.favourites {
|
||||
color: var(--red-fg);
|
||||
|
||||
&:hover {
|
||||
background-color: var(--red-bg);
|
||||
}
|
||||
|
||||
&::before {
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
content: "\F417";
|
||||
display: inline-block;
|
||||
font-family: "bootstrap-icons" !important;
|
||||
font-style: normal;
|
||||
font-variant: normal;
|
||||
font-weight: normal !important;
|
||||
line-height: 1;
|
||||
margin-inline-end: 0.25rem;
|
||||
text-transform: none;
|
||||
vertical-align: -0.125em;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.emoji {
|
||||
all: unset;
|
||||
display: inline;
|
||||
width: 1.25rem;
|
||||
height: 1.25rem;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.invisible {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.ellipsis::after {
|
||||
content: "…";
|
||||
}
|
||||
|
||||
details {
|
||||
summary {
|
||||
color: var(--yellow-fg);
|
||||
}
|
||||
|
||||
margin-top: 1rem;
|
||||
background-color: var(--yellow-bg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,8 @@
|
||||
background-color: white;
|
||||
float: right;
|
||||
height: 155px;
|
||||
margin: 3rem 0 0 0;
|
||||
margin-left: 1rem;
|
||||
margin-top: 3rem;
|
||||
padding: 15px;
|
||||
width: 155px;
|
||||
|
||||
|
Reference in New Issue
Block a user