Skip to content

Commit 3f47a03

Browse files
authored
Fix spoilers leaking emojis and mentions (#807)
<!-- Please read https://github.com/SableClient/Sable/blob/dev/CONTRIBUTING.md before submitting your pull request --> ### Description <!-- Please include a summary of the change. Please also include relevant motivation and context. List any dependencies that are required for this change. --> At some point everything (maybe?) other than plaintext got was no longer hidden by spoilers, instead showing on top of them. This fixes that. #### Type of change - [x] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] This change requires a documentation update ### Checklist: - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings ### AI disclosure: - [ ] Partially AI assisted (clarify which code was AI assisted and briefly explain what it does). - [ ] Fully AI generated (explain what all the generated code does in moderate detail). <!-- Write any explanation required here, but do not generate the explanation using AI!! You must prove you understand what the code in this PR does. -->
2 parents 438c71f + c2c82b5 commit 3f47a03

2 files changed

Lines changed: 24 additions & 13 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
default: patch
3+
---
4+
5+
Fix spoilers not hiding nested content like mentions, emoji images, and custom-colored spans.

src/app/styles/CustomHtml.css.ts

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { style } from '@vanilla-extract/css';
1+
import { globalStyle, style } from '@vanilla-extract/css';
22
import { recipe } from '@vanilla-extract/recipes';
33
import { color, config, DefaultReset, toRem } from 'folds';
44
import { ContainerColor } from './ContainerColor.css';
@@ -60,20 +60,26 @@ export const Code = style([
6060
},
6161
]);
6262

63-
export const Spoiler = recipe({
64-
base: [
65-
DefaultReset,
66-
{
67-
padding: `0 ${config.space.S100}`,
68-
backgroundColor: color.SurfaceVariant.ContainerLine,
69-
borderRadius: config.radii.R300,
70-
selectors: {
71-
'&[aria-pressed=true]': {
72-
color: 'transparent',
73-
},
63+
const SpoilerBase = style([
64+
DefaultReset,
65+
{
66+
padding: `0 ${config.space.S100}`,
67+
backgroundColor: color.SurfaceVariant.ContainerLine,
68+
borderRadius: config.radii.R300,
69+
selectors: {
70+
'&[aria-pressed=true]': {
71+
color: 'transparent',
7472
},
7573
},
76-
],
74+
},
75+
]);
76+
77+
globalStyle(`${SpoilerBase}[aria-pressed="true"] *`, {
78+
visibility: 'hidden',
79+
});
80+
81+
export const Spoiler = recipe({
82+
base: SpoilerBase,
7783
variants: {
7884
active: {
7985
true: {

0 commit comments

Comments
 (0)