Skip to content

Commit cad7439

Browse files
chlorenzkss682
authored andcommitted
styles navtabs for web and pdf/print targets, uses CSS counters to highlight association between tab headers and tab content when printed, issue precice#211
1 parent 0b6c047 commit cad7439

File tree

2 files changed

+62
-1
lines changed

2 files changed

+62
-1
lines changed

css/customstyles-precice.css

+10
Original file line numberDiff line numberDiff line change
@@ -340,4 +340,14 @@ div#tg-sb-sidebar {
340340
div#tg-sb-sidebar {
341341
position: static;
342342
}
343+
/* style navtabs */
344+
.post-content ol li, .post-content ul li {
345+
margin: 0px;
346+
}
347+
div.tab-content {
348+
padding: 0px;
349+
background-color: white;
350+
}
351+
div.tab-content div.tab-pane pre {
352+
margin-top: 0px;
343353
}

css/printstyles.css

+52-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ a[href^="http:"]::after, a[href^="https:"]::after, a[href^="ftp:"]::after {
4040
a[href] {
4141
color: #0A76BB !important;
4242
}
43-
a[href*="mailto"]::after, a[data-toggle="tooltip"]::after, a[href].noCrossRef::after {
43+
a[href*="mailto"]::after, a[data-toggle="tooltip"]::after, a[href].noCrossRef::after, a[data-toggle="tab"]::after {
4444
content: "";
4545
}
4646

@@ -219,4 +219,55 @@ pre > code {
219219
h1[id], h2[id], h3[id], h4[id], h5[id], h6[id], dt[id] {
220220
padding-top: 1.5em;
221221
margin-top: -1em;
222+
}
223+
224+
/* prepare nav tabs for printing */
225+
.nav > li.active > a, /* tab headers */
226+
.nav > li > a {
227+
color: black;
228+
background-color: white;
229+
border: 1px solid #ccc;
230+
border-radius: 4px 4px 0 0;
231+
}
232+
.tab-content > .tab-pane {
233+
display: block !important; /* display non-active panes */
234+
position: relative;
235+
}
236+
div.tab-content div.tab-pane pre {
237+
margin-top: 1em;
238+
}
239+
/* create counters to link tab headers to tab contents */
240+
.post-content ul.nav.nav-tabs {
241+
counter-reset: tab_number; /* creates a new instance of counter with name tab_number */
242+
}
243+
.post-content .nav.nav-tabs li::after {
244+
counter-increment: tab_number; /* increment counter */
245+
content: counter(tab_number); /* display value in small bubble */
246+
position: absolute;
247+
top: -1em;
248+
left: -1em;
249+
padding: 2px 5px;
250+
background-color: white;
251+
color: black;
252+
font-size: 0.65em;
253+
border-radius: 50%;
254+
border: 1px solid #ccc;
255+
box-shadow: 1px 1px 1px grey;
256+
}
257+
div.tab-content {
258+
counter-reset: pane_number;
259+
}
260+
div.tab-pane::after {
261+
counter-increment: pane_number;
262+
content: counter(pane_number);
263+
position: absolute;
264+
top: -1em;
265+
left: -1em;
266+
padding: 2px 5px;
267+
background-color: white;
268+
color: black;
269+
font-size: 0.65em;
270+
border-radius: 50%;
271+
border: 1px solid #ccc;
272+
box-shadow: 1px 1px 1px gray;
222273
}

0 commit comments

Comments
 (0)