Skip to content

Commit 90445d5

Browse files
committed
styles navtabs for web and pdf/print targets, uses CSS counters to highlight association between tab headers and tab content when printed, issue #211
1 parent f2106a0 commit 90445d5

File tree

2 files changed

+63
-1
lines changed

2 files changed

+63
-1
lines changed

css/customstyles-precice.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,3 +314,14 @@ ul.devlist>li {
314314
}
315315
}
316316

317+
/* style navtabs */
318+
.post-content ol li, .post-content ul li {
319+
margin: 0px;
320+
}
321+
div.tab-content {
322+
padding: 0px;
323+
background-color: white;
324+
}
325+
div.tab-content div.tab-pane pre {
326+
margin-top: 0px;
327+
}

css/printstyles.css

Lines changed: 52 additions & 1 deletion
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)