File tree Expand file tree Collapse file tree 4 files changed +18
-3
lines changed Expand file tree Collapse file tree 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;
6060pub ( crate ) static GLOBAL_ALERT : Option < GlobalAlert > = Some ( GlobalAlert {
6161 url : "https://blog.rust-lang.org/2019/09/18/upcoming-docsrs-changes.html" ,
6262 text : "Upcoming docs.rs breaking changes!" ,
63+ css_class : "error" ,
64+ fa_icon : "warning" ,
6365} ) ;
6466
6567
Original file line number Diff line number Diff line change @@ -10,13 +10,17 @@ use handlebars_iron::Template;
1010pub ( crate ) struct GlobalAlert {
1111 pub ( crate ) url : & ' static str ,
1212 pub ( crate ) text : & ' static str ,
13+ pub ( crate ) css_class : & ' static str ,
14+ pub ( crate ) fa_icon : & ' static str ,
1315}
1416
1517impl ToJson for GlobalAlert {
1618 fn to_json ( & self ) -> Json {
1719 let mut map = BTreeMap :: new ( ) ;
1820 map. insert ( "url" . to_string ( ) , self . url . to_json ( ) ) ;
1921 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 ( ) ) ;
2024 Json :: Object ( map)
2125 }
2226}
Original file line number Diff line number Diff line change 11{{ #if ../has_global_alert }}
22<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 >
55 {{ ../global_alert.text }}
6- <i class =" fa fa-fw fa-warning" ></i >
76 </a >
87</li >
98{{ /if }}
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ $color-lifetime-incode: #B76514; // orangish
1919$color-comment-in-code : #8E908C ; // light gray
2020$color-background-code : #F5F5F5 ; // lighter gray
2121$color-border : #ddd ; // gray
22+ $color-red : #d93d3d ; // red
2223$top-navbar-height : 32px ; // height of the floating top navbar
2324
2425
@@ -214,6 +215,15 @@ div.nav-container {
214215 color : darken ($color-type , 10% );
215216 }
216217
218+ // used for global alerts
219+ .error {
220+ color : $color-red ;
221+
222+ & :hover {
223+ color : darken ($color-red , 10% );
224+ }
225+ }
226+
217227 div .rustdoc-navigation {
218228 span .title {
219229 display : none ;
You can’t perform that action at this time.
0 commit comments