Skip to content

Commit 4a57e58

Browse files
author
Tim Bannister
committed
Use Docsy alert classes
Update the Kubernetes overrides from the Docsy theme to diverge less, specifically in the areas of callouts (alerts) and pageinfo blocks.
1 parent 85d3fb9 commit 4a57e58

File tree

5 files changed

+32
-24
lines changed

5 files changed

+32
-24
lines changed

assets/scss/_custom.scss

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -313,33 +313,40 @@ main {
313313

314314
// blockquotes and callouts
315315

316-
.td-content, body {
317-
blockquote.callout {
316+
body {
317+
.alert {
318+
// Override Docsy styles
318319
padding: 0.4rem 0.4rem 0.4rem 1rem;
319-
border: 1px solid #eee;
320-
border-left-width: 0.5em;
320+
border-top: 1px solid #eee;
321+
border-bottom: 1px solid #eee;
322+
border-right: 1px solid #eee;
323+
border-radius: 0.25em;
324+
border-left-width: 0.5em; // fallback in case calc() is missing
321325
background: #fff;
322326
color: #000;
323327
margin-top: 0.5em;
324328
margin-bottom: 0.5em;
325329
}
326-
blockquote.callout {
327-
border-radius: calc(1em/3);
330+
// Set minimum width and radius for alert color
331+
.alert {
332+
border-left-width: calc(max(0.5em, 4px));
333+
border-top-left-radius: calc(max(0.5em, 4px));
334+
border-bottom-left-radius: calc(max(0.5em, 4px));
328335
}
329-
.callout.caution {
336+
.alert.callout.caution {
330337
border-left-color: #f0ad4e;
331338
}
332-
333-
.callout.note {
339+
.alert.callout.note {
334340
border-left-color: #428bca;
335341
}
336-
337-
.callout.warning {
342+
.alert.callout.warning {
338343
border-left-color: #d9534f;
339344
}
345+
.alert.third-party-content {
346+
border-left-color: #444;
347+
}
340348

341-
342-
h1:first-of-type + blockquote.callout {
349+
h1:first-of-type + .alert.callout {
343350
margin-top: 1.5em;
344351
}
345352
}
@@ -367,7 +374,7 @@ main {
367374
background: #f8f9cb;
368375
}
369376

370-
.deprecation-warning {
377+
.deprecation-warning, .pageinfo.deprecation-warning {
371378
padding: 20px;
372379
margin: 20px 0;
373380
background-color: #faf5b6;

layouts/partials/deprecation-warning.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{{ if (.Site.Param "deprecated") }}
22
<section id="deprecation-warning">
3-
<div class="content deprecation-warning">
3+
<div class="content deprecation-warning pageinfo">
44
<h3>
55
{{ T "deprecation_title" }} {{ .Param "version" }}
66
</h3>

layouts/shortcodes/caution.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
<blockquote class="caution callout">
2-
<div><strong>{{ T "caution" }}</strong> {{ trim .Inner " \n" | markdownify }}</div>
3-
</blockquote>
1+
<div class="alert alert-warning caution callout" role="alert">
2+
<strong>{{ T "caution" }}</strong> {{ trim .Inner " \n" | markdownify }}
3+
</div>

layouts/shortcodes/note.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
<blockquote class="note callout">
2-
<div><strong>{{ T "note" }}</strong> {{ trim .Inner " \n" | markdownify }}</div>
3-
</blockquote>
1+
<div class="alert alert-info note callout" role="alert">
2+
<strong>{{ T "note" }}</strong> {{ trim .Inner " \n" | markdownify }}
3+
</div>

layouts/shortcodes/warning.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
<blockquote class="warning callout">
2-
<div><strong>{{ T "warning" }}</strong> {{ trim .Inner " \n" | markdownify }}</div>
3-
</blockquote>
1+
<div class="alert alert-danger warning callout" role="alert">
2+
<strong>{{ T "warning" }}</strong> {{ trim .Inner " \n" | markdownify }}
3+
</div>
4+

0 commit comments

Comments
 (0)