File tree 4 files changed +18
-3
lines changed
4 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,8 @@ use web::page::GlobalAlert;
60
60
pub ( crate ) static GLOBAL_ALERT : Option < GlobalAlert > = Some ( GlobalAlert {
61
61
url : "https://blog.rust-lang.org/2019/09/18/upcoming-docsrs-changes.html" ,
62
62
text : "Upcoming docs.rs breaking changes!" ,
63
+ css_class : "error" ,
64
+ fa_icon : "warning" ,
63
65
} ) ;
64
66
65
67
Original file line number Diff line number Diff line change @@ -10,13 +10,17 @@ use handlebars_iron::Template;
10
10
pub ( crate ) struct GlobalAlert {
11
11
pub ( crate ) url : & ' static str ,
12
12
pub ( crate ) text : & ' static str ,
13
+ pub ( crate ) css_class : & ' static str ,
14
+ pub ( crate ) fa_icon : & ' static str ,
13
15
}
14
16
15
17
impl ToJson for GlobalAlert {
16
18
fn to_json ( & self ) -> Json {
17
19
let mut map = BTreeMap :: new ( ) ;
18
20
map. insert ( "url" . to_string ( ) , self . url . to_json ( ) ) ;
19
21
map. insert ( "text" . to_string ( ) , self . text . to_json ( ) ) ;
22
+ map. insert ( "css_class" . to_string ( ) , self . css_class . to_json ( ) ) ;
23
+ map. insert ( "fa_icon" . to_string ( ) , self . fa_icon . to_json ( ) ) ;
20
24
Json :: Object ( map)
21
25
}
22
26
}
Original file line number Diff line number Diff line change 1
1
{{ #if ../has_global_alert }}
2
2
<li class =" pure-menu-item" >
3
- <a href =" {{ ../global_alert.url }} " class =" pure-menu-link warn " >
4
- <i class =" fa fa-fw fa-warning " ></i >
3
+ <a href =" {{ ../global_alert.url }} " class =" pure-menu-link {{ ../global_alert.css_class }} " >
4
+ <i class =" fa fa-fw fa-{{ ../global_alert.fa_icon }} " ></i >
5
5
{{ ../global_alert.text }}
6
- <i class =" fa fa-fw fa-warning" ></i >
7
6
</a >
8
7
</li >
9
8
{{ /if }}
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ $color-lifetime-incode: #B76514; // orangish
19
19
$color-comment-in-code : #8E908C ; // light gray
20
20
$color-background-code : #F5F5F5 ; // lighter gray
21
21
$color-border : #ddd ; // gray
22
+ $color-red : #d93d3d ; // red
22
23
$top-navbar-height : 32px ; // height of the floating top navbar
23
24
24
25
@@ -214,6 +215,15 @@ div.nav-container {
214
215
color : darken ($color-type , 10% );
215
216
}
216
217
218
+ // used for global alerts
219
+ .error {
220
+ color : $color-red ;
221
+
222
+ & :hover {
223
+ color : darken ($color-red , 10% );
224
+ }
225
+ }
226
+
217
227
div .rustdoc-navigation {
218
228
span .title {
219
229
display : none ;
You can’t perform that action at this time.
0 commit comments