Skip to content

Commit

Permalink
Merge pull request kubernetes#30068 from sftim/20211013_use_docsy_alerts
Browse files Browse the repository at this point in the history
Use Docsy alert classes
  • Loading branch information
k8s-ci-robot authored Oct 27, 2021
2 parents 9497ae4 + 4a57e58 commit 99e49b2
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 24 deletions.
35 changes: 21 additions & 14 deletions assets/scss/_custom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -313,33 +313,40 @@ main {

// blockquotes and callouts

.td-content, body {
blockquote.callout {
body {
.alert {
// Override Docsy styles
padding: 0.4rem 0.4rem 0.4rem 1rem;
border: 1px solid #eee;
border-left-width: 0.5em;
border-top: 1px solid #eee;
border-bottom: 1px solid #eee;
border-right: 1px solid #eee;
border-radius: 0.25em;
border-left-width: 0.5em; // fallback in case calc() is missing
background: #fff;
color: #000;
margin-top: 0.5em;
margin-bottom: 0.5em;
}
blockquote.callout {
border-radius: calc(1em/3);
// Set minimum width and radius for alert color
.alert {
border-left-width: calc(max(0.5em, 4px));
border-top-left-radius: calc(max(0.5em, 4px));
border-bottom-left-radius: calc(max(0.5em, 4px));
}
.callout.caution {
.alert.callout.caution {
border-left-color: #f0ad4e;
}

.callout.note {
.alert.callout.note {
border-left-color: #428bca;
}

.callout.warning {
.alert.callout.warning {
border-left-color: #d9534f;
}
.alert.third-party-content {
border-left-color: #444;
}


h1:first-of-type + blockquote.callout {
h1:first-of-type + .alert.callout {
margin-top: 1.5em;
}
}
Expand Down Expand Up @@ -367,7 +374,7 @@ main {
background: #f8f9cb;
}

.deprecation-warning {
.deprecation-warning, .pageinfo.deprecation-warning {
padding: 20px;
margin: 20px 0;
background-color: #faf5b6;
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/deprecation-warning.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{ if (.Site.Param "deprecated") }}
<section id="deprecation-warning">
<div class="content deprecation-warning">
<div class="content deprecation-warning pageinfo">
<h3>
{{ T "deprecation_title" }} {{ .Param "version" }}
</h3>
Expand Down
6 changes: 3 additions & 3 deletions layouts/shortcodes/caution.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<blockquote class="caution callout">
<div><strong>{{ T "caution" }}</strong> {{ trim .Inner " \n" | markdownify }}</div>
</blockquote>
<div class="alert alert-warning caution callout" role="alert">
<strong>{{ T "caution" }}</strong> {{ trim .Inner " \n" | markdownify }}
</div>
6 changes: 3 additions & 3 deletions layouts/shortcodes/note.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<blockquote class="note callout">
<div><strong>{{ T "note" }}</strong> {{ trim .Inner " \n" | markdownify }}</div>
</blockquote>
<div class="alert alert-info note callout" role="alert">
<strong>{{ T "note" }}</strong> {{ trim .Inner " \n" | markdownify }}
</div>
7 changes: 4 additions & 3 deletions layouts/shortcodes/warning.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<blockquote class="warning callout">
<div><strong>{{ T "warning" }}</strong> {{ trim .Inner " \n" | markdownify }}</div>
</blockquote>
<div class="alert alert-danger warning callout" role="alert">
<strong>{{ T "warning" }}</strong> {{ trim .Inner " \n" | markdownify }}
</div>

0 comments on commit 99e49b2

Please sign in to comment.