Skip to content

Commit b56318b

Browse files
committed
Style warning note in book
This adds some style to the warning note in the book. It looks similar to the v1 book style, but with a more semantic structure.
1 parent 8b95d51 commit b56318b

File tree

2 files changed

+46
-2
lines changed

2 files changed

+46
-2
lines changed

docs/book/src/cronjob-tutorial/running-webhook.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,18 @@ kubectl create -f config/samples/batch_v1_cronjob.yaml
5757
You can also try to create an invalid CronJob (e.g. use an ill-formatted
5858
schedule field). You should see a creation failure with a validation error.
5959

60-
<aside>
61-
Note: If you are deploying a webhook for pods in the same cluster, be
60+
<aside class="note warning">
61+
62+
<h1>The Bootstrapping Problem</h1>
63+
64+
If you are deploying a webhook for pods in the same cluster, be
6265
careful about the bootstrapping problem, since the creation request of the
6366
webhook pod would be sent to the webhook pod itself, which hasn't come up yet.
6467

6568
To make it work, you can either use [namespaceSelector] if your kubernetes
6669
version is 1.9+ or use [objectSelector] if your kubernetes version is 1.15+ to
6770
skip itself.
71+
6872
</aside>
6973

7074
[namespaceSelector]: https://github.com/kubernetes/api/blob/kubernetes-1.14.5/admissionregistration/v1beta1/types.go#L189-L233

docs/book/theme/css/general.css

+40
Original file line numberDiff line numberDiff line change
@@ -397,3 +397,43 @@ main > details.collapse-code > summary::after {
397397
fill: black;
398398
stroke: none;
399399
}
400+
401+
/* notes */
402+
aside.note {
403+
border: 1px solid var(--searchbar-border-color);
404+
border-radius: 3px;
405+
}
406+
407+
aside.note > * {
408+
margin-left: 1em;
409+
margin-right: 1em;
410+
}
411+
412+
/* note title */
413+
aside.note > h1 {
414+
border-bottom: 1px solid var(--searchbar-border-color);
415+
margin: 0;
416+
padding: 0.5em 1em;
417+
font-size: 100%;
418+
font-weight: normal;
419+
}
420+
421+
/* warning notes */
422+
aside.note.warning > h1 {
423+
background: var(--warning-note-background-color, #fcf8f2);
424+
}
425+
aside.note.warning > h1::before {
426+
/* TODO(directxman12): fill in these colors in theme.
427+
* If you're good with colors, feel free to play around with this
428+
* in dark mode. */
429+
content: "!";
430+
color: var(--warning-note-color, #f0ad4e);
431+
margin-right: 1em;
432+
font-size: 100%;
433+
vertical-align: middle;
434+
font-weight: bold;
435+
padding-left: 0.6em;
436+
padding-right: 0.6em;
437+
border-radius: 50%;
438+
border: 2px solid var(--warning-note-color, #f0ad4e);
439+
}

0 commit comments

Comments
 (0)