Adds spoilers support
This commit is contained in:
parent
a44637b9e6
commit
0f3fff0975
2 changed files with 22 additions and 0 deletions
|
@ -69,6 +69,7 @@ pub fn get_options(path: Option<FilePath>, metadata_type: MType) -> ComrakOption
|
|||
.math_dollars(true)
|
||||
.underline(true)
|
||||
.subscript(true)
|
||||
.spoiler(true)
|
||||
.maybe_link_url_rewriter(match metadata_type {
|
||||
MType::Cours => Some(Arc::new(move |url: &str| {
|
||||
// Exclude external links
|
||||
|
|
|
@ -284,6 +284,21 @@ table:not(.hljs-ln) tr th:last-child {
|
|||
border-right: 0;
|
||||
}
|
||||
|
||||
/* Spoilers */
|
||||
.spoiler {
|
||||
background-color: var(--font-color);
|
||||
color: transparent;
|
||||
border-radius: 3px;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.spoiler:hover,
|
||||
.spoiler:focus {
|
||||
background-color: var(--background);
|
||||
color: var(--font-color);
|
||||
}
|
||||
|
||||
@media print {
|
||||
/* Better colors for paper */
|
||||
blockquote {
|
||||
|
@ -328,6 +343,12 @@ table:not(.hljs-ln) tr th:last-child {
|
|||
visibility: hidden;
|
||||
}
|
||||
|
||||
/* Reveals all spoilers */
|
||||
.spoiler {
|
||||
background-color: var(--background);
|
||||
color: var(--font-color);
|
||||
}
|
||||
|
||||
@page {
|
||||
@bottom-right {
|
||||
content: counter(page) "/" counter(pages);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue