fix: spoiler now work in paragraph wrapped elements
This commit is contained in:
parent
98ee7a3527
commit
21025cab50
2 changed files with 16 additions and 1 deletions
|
@ -1,11 +1,21 @@
|
||||||
---
|
---
|
||||||
const { tip = '' } = Astro.props
|
const { tip = '' } = Astro.props
|
||||||
---
|
---
|
||||||
{/* TODO: make it work in paragraph wrapped elements */}
|
|
||||||
<span class="spoiler" title={tip}>
|
<span class="spoiler" title={tip}>
|
||||||
<slot/>
|
<slot/>
|
||||||
</span>
|
</span>
|
||||||
<style>
|
<style>
|
||||||
|
:global(.spoiler p) {
|
||||||
|
background-color: #252525;
|
||||||
|
color: #252525;
|
||||||
|
transition: color 0.5s;
|
||||||
|
width: fit-content;
|
||||||
|
}
|
||||||
|
|
||||||
|
:global(.spoiler:hover p) {
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
.spoiler {
|
.spoiler {
|
||||||
background-color: #252525;
|
background-color: #252525;
|
||||||
color: #252525;
|
color: #252525;
|
||||||
|
|
|
@ -14,4 +14,9 @@ testestestest
|
||||||
~~This is the content of the spoiler.~~
|
~~This is the content of the spoiler.~~
|
||||||
</Spoiler>
|
</Spoiler>
|
||||||
|
|
||||||
|
<Spoiler tip="Spoiler Title">
|
||||||
|
~~This is the content of another spoiler.~~
|
||||||
|
</Spoiler>
|
||||||
|
|
||||||
|
|
||||||
<FediStatuses instanceDomain='portal.gb0.dev' userId='me' />
|
<FediStatuses instanceDomain='portal.gb0.dev' userId='me' />
|
Loading…
Add table
Add a link
Reference in a new issue