Extract alt badge styles out from tag

- Differentiate clickable version vs non-clickable version
- Also differentiate alt badge vs the other "tags" on media
This commit is contained in:
Lim Chee Aun 2023-09-28 23:48:01 +08:00
parent 01c90150a8
commit f9cb9502b1
3 changed files with 30 additions and 18 deletions

View file

@ -141,7 +141,7 @@ function MediaModal({
setShowMediaAlt(media.description);
}}
>
<span class="tag collapsed">ALT</span>
<span class="alt-badge">ALT</span>
<span class="media-alt-desc">{media.description}</span>
</button>
)}

View file

@ -34,7 +34,7 @@ const AltBadge = (props) => {
return (
<button
type="button"
class="tag collapsed clickable"
class="alt-badge clickable"
{...rest}
onClick={(e) => {
e.stopPropagation();

View file

@ -853,31 +853,16 @@
&[data-has-alt] {
position: relative;
.tag {
.alt-badge {
position: absolute;
bottom: 8px;
left: 8px;
font-size: 12px;
font-weight: bold;
color: var(--media-fg-color);
background-color: var(--media-bg-color);
border: var(--hairline-width) solid var(--media-outline-color);
mix-blend-mode: luminosity;
opacity: 0.75;
&:before {
content: '';
position: absolute;
inset: -12px;
}
&:is(:hover, :focus):not(:active) {
transition: 0.15s ease-out;
transition-property: transform, opacity, mix-blend-mode;
transform: scale(1.15);
opacity: 0.8;
mix-blend-mode: normal;
}
}
}
}
@ -1674,3 +1659,30 @@ a.card:is(:hover, :focus):visited {
#reactions-container .reactions-block .reblog-icon {
color: var(--reblog-color);
}
/* ALT BADGE */
.alt-badge {
font-size: 12px;
font-weight: bold;
color: var(--media-fg-color);
background-color: var(--media-bg-color);
border: var(--hairline-width) solid var(--media-outline-color);
mix-blend-mode: luminosity;
border-radius: 4px;
padding: 4px;
opacity: 0.65;
&.clickable {
opacity: 0.75;
border-width: 2px;
&:is(:hover, :focus):not(:active) {
transition: 0.15s ease-out;
transition-property: transform, opacity, mix-blend-mode;
transform: scale(1.15);
opacity: 0.8;
mix-blend-mode: normal;
}
}
}