Skip to content

Commit 390a13d

Browse files
committed
Use icons from ndl, set admon title size
1 parent c3168cf commit 390a13d

File tree

10 files changed

+111
-19
lines changed

10 files changed

+111
-19
lines changed

preview-src/admonitions.adoc

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,4 +179,57 @@ $ npm i -g @antora/cli @antora/site-generator-default
179179
====
180180

181181
Nominavi luptatum eos, an vim hinc philosophia intellegebat.
182-
Eu mea inani iriure.
182+
Eu mea inani iriure.
183+
184+
== Admonition in a table
185+
186+
[options="header",width="100%",cols="2,3a"]
187+
|===
188+
| Parameter
189+
| Explanation
190+
191+
192+
| Parameter name
193+
| Parameter explanation
194+
Lorem ipsum
195+
196+
Dolor sit est.
197+
198+
[NOTE]
199+
====
200+
Note text goes here.
201+
Note should be nicely aligned and have no borders
202+
====
203+
204+
|===
205+
206+
207+
== Admonition first element in an example block
208+
209+
210+
[.tabbed-example]
211+
=====
212+
[.include-with-admonition-first]
213+
======
214+
215+
216+
[WARNING]
217+
====
218+
Admonition should be given enough margin if it is the first element in an example block.
219+
====
220+
221+
======
222+
223+
[.include-with-admonition-not-first]
224+
======
225+
226+
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
227+
228+
Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
229+
230+
[TIP]
231+
====
232+
Admonition should be given normal margin if it is not the first element in an example block.
233+
====
234+
235+
=====

src/css/doc.css

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,15 @@ body {
200200

201201
.doc i.fa {
202202
font-style: normal;
203+
font-size: var(--admonition-title-font-size);
204+
}
205+
206+
.doc i.fa::before {
207+
width: 24px;
208+
height: inherit;
209+
background-size: 20px;
210+
background-position-y: center;
211+
filter: brightness(0) saturate(100%) invert(100%) sepia(0%) saturate(7500%) hue-rotate(199deg) brightness(103%) contrast(103%); /* filter to white */
203212
}
204213

205214
.doc p code,
@@ -286,7 +295,7 @@ body {
286295
padding: 0.5rem;
287296
}
288297

289-
.doc table.tableblock td,
298+
.doc table.tableblock > tbody > tr > td,
290299
.doc table.tableblock > :not(thead) th {
291300
border-top: 1px solid var(--table-border-color);
292301
border-bottom: 1px solid var(--table-border-color);
@@ -360,13 +369,18 @@ body {
360369
padding: 0;
361370
position: absolute;
362371
top: 0;
363-
transform: translate(-0.75rem, -50%);
372+
transform: translate(-1rem, -50%);
373+
}
374+
375+
.doc .tableblock .admonitionblock td.icon {
376+
transform: translate(0, -50%);
377+
border: none;
364378
}
365379

366380
.doc .admonitionblock td.icon i {
367381
color: rgba(var(--colors-neutral-15));
368382
align-items: center;
369-
border-radius: 1rem;
383+
border-radius: 9999px;
370384
display: inline-flex;
371385
filter: none;
372386
height: 1.5rem;
@@ -380,7 +394,7 @@ body {
380394
font-style: normal;
381395
font-weight: 600;
382396
font-weight: var(--admonition-label-font-weight);
383-
padding-left: 0.5rem;
397+
/* padding-left: 0.5rem; */
384398
text-transform: uppercase;
385399
}
386400

@@ -409,24 +423,28 @@ body {
409423
/* admonition icon contents */
410424

411425
.fa.icon-note::before {
412-
content: "\f05a";
413-
background: none;
426+
background: url(../img/ndl-icons/information-circle.svg) no-repeat;
427+
content: "";
414428
}
415429

416430
.fa.icon-tip::before {
417-
content: "\f0eb";
431+
background: url(../img/ndl-icons/light-bulb.svg) no-repeat;
432+
content: "";
418433
}
419434

420435
.fa.icon-important::before {
421-
content: "\f06a";
436+
background: url(../img/ndl-icons/exclamation-circle.svg) no-repeat;
437+
content: "";
422438
}
423439

424440
.fa.icon-caution::before {
425-
content: "\f06d";
441+
background: url(../img/ndl-icons/fire.svg) no-repeat;
442+
content: "";
426443
}
427444

428445
.fa.icon-warning::before {
429-
content: "\f071";
446+
background: url(../img/ndl-icons/exclamation-triangle.svg) no-repeat;
447+
content: "";
430448
}
431449

432450
.doc .admonitionblock td .content {
@@ -790,7 +808,7 @@ body {
790808
padding: 0.75rem;
791809
} */
792810

793-
.doc .exampleblock > .content > :first-child {
811+
.doc .exampleblock > .content > :first-child:not(.admonitionblock) {
794812
margin-top: 0;
795813
}
796814

@@ -1143,13 +1161,13 @@ body {
11431161
/* table-layout: fixed; */
11441162
}
11451163

1146-
.doc table.tableblock.frame-all tr:last-child td,
1147-
.doc table.tableblock.frame-ends tr:last-child td {
1164+
.doc table.tableblock.frame-all > tbody > tr:last-child > td,
1165+
.doc table.tableblock.frame-ends > tbody > tr:last-child > td {
11481166
border-bottom: 2.5px solid var(--table-border-color);
11491167
}
11501168

1151-
.doc table.tableblock.frame-all tr:first-child td,
1152-
.doc table.tableblock.frame-ends tr:first-child td {
1169+
.doc table.tableblock.frame-all > tbody > tr:first-child > td,
1170+
.doc table.tableblock.frame-ends > tbody > tr:first-child > td {
11531171
border-top: 2.5px solid var(--table-border-color);
11541172
}
11551173

src/css/labels.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ h2 > .flex-label {
9393
background: rgba(var(--colors-baltic-50));
9494
color: rgba(var(--colors-baltic-10));
9595
font-weight: 600;
96-
font-size: 0.7rem;
96+
font-size: var(--label-title-font-size);
9797
font-style: normal;
9898
}
9999

src/css/themes.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ body.docs #preamble .abstract blockquote {
102102
color: rgba(var(--colors-baltic-60));
103103
}
104104

105-
body.docs .tableblock .icon i {
105+
body.docs .tableblock .icon i:not(.fa) {
106106
color: var(--color-docs);
107107
}
108108

@@ -337,7 +337,7 @@ body.developer #preamble .abstract blockquote {
337337
border-left-color: var(--color-green-600);
338338
}
339339

340-
body.developer .tableblock .icon i {
340+
body.developer .tableblock .icon i:not(.fa) {
341341
color: var(--color-green-600);
342342
}
343343

src/css/vars.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,11 @@
380380
--alpha-beta-color: var(--color-black);
381381
--alpha-beta-background-color: rgba(var(--colors-marigold-40));
382382

383+
/* labels and admonitions */
384+
385+
--label-title-font-size: calc(0.8 * var(--font-size-label)); /* set label font size from ndl */
386+
--admonition-title-font-size: var(--font-size-label); /* set admonitino font size from ndl */
387+
383388
/* footer */
384389
--footer-font-size: var(--font-size-body-medium);
385390
--footer-line-height: var(--doc-line-height);
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading

src/img/ndl-icons/fire.svg

Lines changed: 4 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading

src/img/ndl-icons/light-bulb.svg

Lines changed: 3 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)