Skip to content
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
5 changes: 5 additions & 0 deletions .changeset/fix-spoiler-hides-mentions-and-images.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
default: patch
---

Fix spoilers not hiding nested content like mentions, emoji images, and custom-colored spans.
32 changes: 19 additions & 13 deletions src/app/styles/CustomHtml.css.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { style } from '@vanilla-extract/css';
import { globalStyle, style } from '@vanilla-extract/css';
import { recipe } from '@vanilla-extract/recipes';
import { color, config, DefaultReset, toRem } from 'folds';
import { ContainerColor } from './ContainerColor.css';
Expand Down Expand Up @@ -60,20 +60,26 @@ export const Code = style([
},
]);

export const Spoiler = recipe({
base: [
DefaultReset,
{
padding: `0 ${config.space.S100}`,
backgroundColor: color.SurfaceVariant.ContainerLine,
borderRadius: config.radii.R300,
selectors: {
'&[aria-pressed=true]': {
color: 'transparent',
},
const SpoilerBase = style([
DefaultReset,
{
padding: `0 ${config.space.S100}`,
backgroundColor: color.SurfaceVariant.ContainerLine,
borderRadius: config.radii.R300,
selectors: {
'&[aria-pressed=true]': {
color: 'transparent',
},
},
],
},
]);

globalStyle(`${SpoilerBase}[aria-pressed="true"] *`, {
visibility: 'hidden',
});

export const Spoiler = recipe({
base: SpoilerBase,
variants: {
active: {
true: {
Expand Down
Loading