Skip to content

Instantly share code, notes, and snippets.

@claudioluciano
Created April 10, 2024 18:07
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save claudioluciano/1c108c5fe7804d3ff393f27667d84971 to your computer and use it in GitHub Desktop.
Save claudioluciano/1c108c5fe7804d3ff393f27667d84971 to your computer and use it in GitHub Desktop.
Obsidian - snippet to create spoilers on notes
.cm-active[data-task="#"] * {
display: initial;
}
.cm-active[data-task="#"]>label {
display: none
}
[data-task="#"]>* {
display: none;
}
[data-task="#"]>.cm-list-1 {
display: initial;
position: relative;
}
[data-task="#"]:not(.cm-active)>.cm-list-1::before {
content: ' ';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgb(23, 23, 26);
border-radius: 2px;
}
[data-task="#"]>.cm-list-1:hover::before {
display: none
}
@claudioluciano
Copy link
Author

claudioluciano commented Apr 10, 2024

This code is based on this reddit comment

- [#] test

*** For now, it's not work in callout or other blocks

show.mov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment