forked from docker/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_notes.scss
156 lines (129 loc) · 3.77 KB
/
_notes.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
//noinspection CssNoGenericFontName
/*
These rules control the display of notes/notifications/alerts. They can be used like so:
> **This is a paid feature**
>
> Docker Hub Vulnerability Scanning is available for developers subscribed to a Pro or a Team plan. For more information about the pricing plans, see [Docker Pricing](https://www.docker.com/pricing?utm_source=docker&utm_medium=webreferral&utm_campaign=docs_driven_upgrade)
{: .restricted }
(The first line is always treated as a header, unless it's the only line)
The available classes are:
.important: Yellow
.warning: Red/orange
.restricted: Purple, used to indicate features that require paid plans
[no class]: Blue, the default
*/
@mixin notification($bg-color, $header-color, $body-text-color, $icon) {
background-color: $bg-color;
font-size: unset; // override bootstrap font-size for blockquotes
// The first child will generally be a header (e.g. "Note" or "This is an experimental feature"),
// but we have some notes that don't have headers; if there's only one child of the note,
// assume it's not a header
> p:first-child:not(:only-child) {
color: $header-color;
font-weight: 700;
margin-top: 0;
&::before {
font-family: FontAwesome;
content: "#{$icon} \00a0";
}
}
> p:only-child, > p:not(:first-child) {
color: $body-text-color;
}
}
blockquote {
body.night & {
// DARK THEME
&:not(.important):not(.warning):not(.restricted) {
@include notification(
$bg-color: change-color($marine-10, $alpha: 0.2),
$header-color: $marine-10,
$body-text-color: $marine-10,
$icon: "\f06a"
);
}
&.important {
@include notification(
$bg-color: change-color($orange-60, $alpha: 0.4),
$header-color: $orange-20,
$body-text-color: $orange-20,
$icon: "\f06a"
);
}
&.warning {
@include notification(
$bg-color: change-color($red-60, $alpha: 0.3),
$header-color: $red-10,
$body-text-color: $red-10,
$icon: "\f06a"
);
}
&.restricted {
@include notification(
$bg-color: change-color($purple-60, $alpha: 0.44),
$header-color: $purple-10,
$body-text-color: $purple-10,
$icon: "\f135"
);
}
}
body:not(.night) & {
// LIGHT THEME
&:not(.important):not(.warning):not(.restricted) {
@include notification(
$bg-color: #E8F4FD, // Hardcoding this variable temporary till we migrate to the new color pallette
$header-color: $blue-80,
$body-text-color: inherit,
$icon: "\f05a"
);
}
&.important {
@include notification(
$bg-color: $orange-10,
$header-color: $orange-100,
$body-text-color: inherit,
$icon: "\f06a"
);
}
&.warning {
@include notification(
$bg-color: #FEEFEF, // Hardcoding this variable temporary till we migrate to the new color pallette
$header-color: $red-50,
$body-text-color: inherit,
$icon: "\f06a"
);
}
&.restricted {
@include notification(
$bg-color: $purple-10,
$header-color: $purple-50,
$body-text-color: inherit,
$icon: "\f135"
);
}
}
}
/* For Bootstrap badges */
span {
&.badge {
border-radius: .25rem;
color: #fff;
display: inline-block;
font-size: 75%;
font-weight: bold;
line-height: 1;
padding: .25em .4em;
text-align: center;
vertical-align: baseline;
white-space: nowrap;
&.badge-info {
background-color: $note-color;
}
&.badge-danger {
background-color: $warning-color;
}
&.badge-warning {
background-color: $important-color;
}
}
}