Crates.io | css-rel-preload |
lib.rs | css-rel-preload |
version | 0.1.0 |
source | src |
created_at | 2018-10-13 06:00:44.450733 |
updated_at | 2018-10-13 06:00:44.450733 |
description | LoadCSS's cssrelpreload.js file |
homepage | |
repository | https://github.com/yoshuawuyts/css-rel-preload |
max_upload_size | |
id | 89538 |
size | 29,459 |
LoadCSS's cssrelpreload.js
file.
If you want to use rel=preload
tags to asynchronously load CSS in browsers, we
need to include a polyfill for backwards compatibility. This crate provides a
wrapper around loadCSS's
rel-preload.js
file, providing that fallback. It's best included as an inline
string, or sent as part of every initial request using HTTP/2 PUSH.
use css_rel_preload;
use html_index;
let res = html_index::Builder::new()
.raw_body("<body>hello world</body>")
.inline_script(css_rel_preload::CSS_REL_PRELOAD)
.style("/bundle.css")
.build();
println!("{}", res);
$ cargo add css-rel-preload
This crate uses #![deny(unsafe_code)]
to ensure everything is implemented in
100% Safe Rust.
Want to join us? Check out our "Contributing" guide and take a look at some of these issues:
None.
MIT OR Apache-2.0