Skip to content

Commit aa855d5

Browse files
authored
Merge pull request #23029 from sftim/20200808_improve_callout_styling
Improve styling for callouts
2 parents b29e66f + 4febf74 commit aa855d5

File tree

7 files changed

+30
-39
lines changed

7 files changed

+30
-39
lines changed

assets/scss/_custom.scss

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -268,22 +268,34 @@ main {
268268

269269
// blockquotes and callouts
270270

271-
blockquote {
272-
padding: 0.4rem 0.4rem 0.4rem 1rem !important;
273-
}
274-
275-
// callouts are contained in static CSS as well. these require override.
271+
.td-content, body {
272+
blockquote.callout {
273+
padding: 0.4rem 0.4rem 0.4rem 1rem;
274+
border: 1px solid #eee;
275+
border-left-width: 0.5em;
276+
background: #fff;
277+
color: #000;
278+
margin-top: 0.5em;
279+
margin-bottom: 0.5em;
280+
}
281+
blockquote.callout {
282+
border-radius: calc(1em/3);
283+
}
284+
.callout.caution {
285+
border-left-color: #f0ad4e;
286+
}
276287

277-
.caution {
278-
border-left-color: #f0ad4e !important;
279-
}
288+
.callout.note {
289+
border-left-color: #428bca;
290+
}
280291

281-
.note {
282-
border-left-color: #428bca !important;
283-
}
292+
.callout.warning {
293+
border-left-color: #d9534f;
294+
}
284295

285-
.warning {
286-
border-left-color: #d9534f !important;
296+
h1:first-of-type + blockquote.callout {
297+
margin-top: 1.5em;
298+
}
287299
}
288300

289301
.deprecation-warning {

layouts/partials/css.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
{{- end }}
1717

1818
<link rel="stylesheet" href="{{ "css/jquery-ui.min.css" | relURL }}">
19-
<link rel="stylesheet" href="{{ "css/callouts.css" | relURL }}">
19+
<link rel="stylesheet" href="{{ "css/feature-states.css" | relURL }}">
2020
<link rel="stylesheet" href="{{ "css/custom-jekyll/tags.css" | relURL }}">
2121
{{- if .Site.Params.announcement }}
2222
<link rel="stylesheet" href="{{ "css/announcement.css" | relURL }}">

layouts/shortcodes/caution.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
<blockquote class="caution">
1+
<blockquote class="caution callout">
22
<div><strong>{{ T "caution" }}</strong> {{ trim .Inner " \n" | markdownify }}</div>
33
</blockquote>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
<blockquote class="deprecation_file_warning">
1+
<blockquote class="deprecation_file_warning callout">
22
<div><h4>{{ T "deprecation_file_warning" }}</h4> {{ .Inner | markdownify }}</div>
33
</blockquote>

layouts/shortcodes/note.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
<blockquote class="note">
1+
<blockquote class="note callout">
22
<div><strong>{{ T "note" }}</strong> {{ trim .Inner " \n" | markdownify }}</div>
33
</blockquote>

layouts/shortcodes/warning.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
<blockquote class="warning">
1+
<blockquote class="warning callout">
22
<div><strong>{{ T "warning" }}</strong> {{ trim .Inner " \n" | markdownify }}</div>
33
</blockquote>

static/css/callouts.css renamed to static/css/feature-states.css

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,3 @@
1-
/* Callouts */
2-
.caution, .note, .warning {
3-
padding: 20px;
4-
margin: 20px 0;
5-
border: 1px solid #eee;
6-
border-left-width: 5px;
7-
border-radius: 3px;
8-
}
9-
10-
.caution {
11-
border-left-color: #f0ad4e;
12-
}
13-
14-
.note {
15-
border-left-color: #428bca;
16-
}
17-
18-
.warning {
19-
border-left-color: #d9534f;
20-
}
21-
221
/* Feature States */
232

243
.beta, .stable, .alpha, .deprecated {

0 commit comments

Comments
 (0)