Skip to content

Commit fdd466a

Browse files
authored
Style tables in admonitions (#311)
I don't know if we have any admonitions that contain tables, and maybe we shouldn't. But just in case we do now or at any point...
1 parent 151e639 commit fdd466a

File tree

3 files changed

+61
-3
lines changed

3 files changed

+61
-3
lines changed

preview-src/admonitions.adoc

+49-1
Original file line numberDiff line numberDiff line change
@@ -247,4 +247,52 @@ Icons that are not part of an admonition block should have no color filter appli
247247
| `LOCAL DATETIME` | {check-mark} | {check-mark} |
248248
| `ZONED DATETIME` | {check-mark} | {check-mark} | {check-mark}
249249
| `DURATION` | `-` | `-` | `-`
250-
|===
250+
|===
251+
252+
== Admonition that contains a code block
253+
254+
[source, shell]
255+
----
256+
docker container exec -u neo4j -it <containerName> /bin/bash
257+
----
258+
259+
260+
[TIP]
261+
====
262+
If working with a Neo4j Docker container, ensure you connect to it with the user `neo4j` before issuing import commands, or you will get permission issues after the import.
263+
264+
[source, shell]
265+
----
266+
docker container exec -u neo4j -it <containerName> /bin/bash
267+
----
268+
====
269+
270+
271+
== Admonition that contains a table?
272+
273+
274+
[TIP]
275+
====
276+
This is an admonition that contains a table.
277+
278+
[options="header", cols="^,^,^,^"]
279+
|===
280+
| Type | Date support | Time support | Time zone support
281+
| `DATE` | {check-mark} | |
282+
| `LOCAL TIME` | | {check-mark} |
283+
| `ZONED TIME` | | {check-mark} | {check-mark}
284+
| `LOCAL DATETIME` | {check-mark} | {check-mark} |
285+
| `ZONED DATETIME` | {check-mark} | {check-mark} | {check-mark}
286+
| `DURATION` | `-` | `-` | `-`
287+
|===
288+
289+
====
290+
291+
== Admonition with a title
292+
293+
.note with title
294+
[NOTE]
295+
====
296+
This is a note with a title.
297+
====
298+

src/css/doc.css

+10-2
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ body {
203203
}
204204

205205
/* style the icons in admonition blocks only */
206-
.doc .admonitionblock i.fa::before {
206+
.doc .admonitionblock td.icon i.fa::before {
207207
width: 24px;
208208
height: inherit;
209209
background-size: 20px;
@@ -448,7 +448,6 @@ body {
448448
}
449449

450450
.doc .admonitionblock td .content {
451-
word-wrap: anywhere;
452451
padding: 1rem 1rem 0.75rem;
453452
width: 100%;
454453
}
@@ -1181,6 +1180,15 @@ body {
11811180
border: 0 solid var(--table-border-color);
11821181
}
11831182

1183+
.doc .admonitionblock .tableblock thead {
1184+
background: none;
1185+
}
1186+
1187+
.doc .admonitionblock table.tableblock,
1188+
.doc .admonitionblock table.tableblock > * > tr > * {
1189+
border-color: var(--admonition-table-border-color);
1190+
}
1191+
11841192
.doc table.grid-all > * > tr > * {
11851193
border-width: 1px;
11861194
}

src/css/vars.css

+2
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,8 @@
265265
--warning-border-color: rgba(var(--theme-light-palette-danger-bg-strong));
266266
--warning-background-color: rgba(var(--theme-light-palette-danger-bg-weak));
267267
--mark-background: rgba(var(--theme-light-palette-primary-bg-weak));
268+
--admonition-table-border-color: rgba(var(--colors-neutral-70));
269+
--admonition-table-header-color: rgba(var(--colors-neutral-20));
268270

269271
/* success */
270272
--success-color: rgba(var(--theme-light-palette-success-bg-strong));

0 commit comments

Comments
 (0)