Skip to content

Commit 970b130

Browse files
authored
Merge pull request #78 from PreTeXtBook/details
Details
2 parents d66bfbf + 0ffe807 commit 970b130

File tree

4 files changed

+77
-8
lines changed

4 files changed

+77
-8
lines changed

knowls_default.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ table [data-knowl] {
4848
z-index: 0;
4949
}
5050
/* is the next only for a proof or other content that is only a knowl? */
51-
article > [data-knowl]::after, article > [data-knowl]:hover::after, article > [data-knowl].active::after {
51+
article > [data-knowl]::after, article > [data-knowl]:hover::after, article > [data-knowl].active::after,
52+
section > details > summary > .heading, article + details > summary > .heading {
5253
content: "";
5354
position: absolute;
5455
top: 0;

pretext.css

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,55 @@ so that we can set our own later */
348348

349349

350350

351+
/* 9/23/23 a knowled article is now in a "details", so we add style
352+
to mimic the old style below */
351353

354+
.ptx-content section > details > summary {
355+
cursor: pointer;
356+
}
357+
358+
.ptx-content section > details > summary::marker,
359+
.ptx-content article + details > summary::marker {
360+
content: "";
361+
}
352362

363+
.ptx-content section > details, .ptx-content .paragraphs > details,
364+
.ptx-content article + details {
365+
margin-top: 1.25em;
366+
}
367+
.ptx-content summary + article {
368+
margin-top: 1em;
369+
}
370+
.ptx-content section details + details,
371+
.ptx-content section .introduction + details,
372+
.ptx-content section .para + details,
373+
.ptx-content section .posterior + details {
374+
margin-top: 1.75em;
375+
}
376+
377+
.ptx-content details > article {
378+
padding-top: 0.25em;
379+
}
380+
.ptx-content details > article:not(.theorem-like):not(.definition-like) {
381+
padding: 0.25em;
382+
padding-left: 0.5em;
383+
}
384+
.ptx-content details > article {
385+
background-color: #f5f5ff;
386+
}
387+
.ptx-content details > article details > article,
388+
.ptx-content details > article details > .answer {
389+
margin: 0.5em;
390+
padding: 0.25em;
391+
padding-left: 0.5em;
392+
background-color: #fffff5;
393+
}
394+
.ptx-content details > article details > article details > article {
395+
background-color: #fff5ff;
396+
}
397+
.ptx-content details > article details > article details > article details > article {
398+
background-color: #fafffa;
399+
}
353400

354401
/* this > may be too restrictive. The purpose is to not put a
355402
top margin on an article at the top of a knowl */
@@ -523,6 +570,26 @@ https://yoshiwarabooks.org/mfg/MathModels.html */
523570
.ptx-content .abstract > .title + .para {
524571
display: inline;
525572
}
573+
574+
/* born hidden articls are now in "details", so adding markup
575+
to immitate what is below. */
576+
577+
.ptx-content summary,
578+
.ptx-content summary > .heading {
579+
position: relative;
580+
}
581+
582+
.ptx-content summary > .heading {
583+
font-size: 1.125em;
584+
line-height: 1.125em;
585+
margin-top: 0;
586+
display: inline;
587+
}
588+
589+
590+
/* ----- */
591+
592+
526593
.ptx-content article > .heading,
527594
.ptx-content article > a .heading {
528595
font-size: 1.125em;

pretext_add_on.css

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2235,23 +2235,24 @@ nested tasks. see
22352235
https://pretextbook.org/examples/sample-article/html/interesting-corollary.html#aBc
22362236
*/
22372237

2238-
.ptx-content .exercise-like > .exercise-like {
2238+
/* 9/27/23 added "article" because of details.exercise-like */
2239+
.ptx-content article.exercise-like > .exercise-like {
22392240
margin-left: 40px;
22402241
}
2241-
.ptx-content .exercise-like > .exercise-like.task {
2242+
.ptx-content article.exercise-like > .exercise-like.task {
22422243
margin-left: 20px;
22432244
}
2244-
.ptx-content .exercise-like > .exercise-like > .para {
2245+
.ptx-content article.exercise-like > .exercise-like > .para {
22452246
margin-top: 1.25em;
22462247
/* margin-bottom: 0.25em; */
22472248
}
2248-
.ptx-content .example-like > .heading + .introduction {
2249+
.ptx-content article.example-like > .heading + .introduction {
22492250
display: inline;
22502251
}
2251-
.ptx-content .example-like > .heading + .introduction > .para:first-child {
2252+
.ptx-content article.example-like > .heading + .introduction > .para:first-child {
22522253
display: inline;
22532254
}
2254-
.ptx-content .example-like > .exercise-like > .para {
2255+
.ptx-content article.example-like > .exercise-like > .para {
22552256
margin-top: 1.25em;
22562257
}
22572258

setcolors.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ body.pretext {
9595
background: var(--highlighttoc);
9696
}
9797

98-
.ptx-content [data-knowl], .ptx-content [data-knowl]:hover, .ptx-content [data-knowl]:active, .ptx-content [data-knowl].active {
98+
.ptx-content [data-knowl], .ptx-content [data-knowl]:hover, .ptx-content [data-knowl]:active, .ptx-content [data-knowl].active, .ptx-content summary {
9999
color: var(--bodytitle);
100100
}
101101
.ptx-content [data-knowl]:hover, .ptx-content [data-knowl]:active, .ptx-content [data-knowl].active {

0 commit comments

Comments
 (0)