seed-icons 0.2.3

Get icons collections for Seed
docs.rs failed to build seed-icons-0.2.3
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: seed-icons-0.4.2

Icons Collections for Seed

Seed is an awesome framework to develop single page applications.

This package provides build.rs to generate icons to use with Seed. It does not provide you with icons themselves (you stil have to reference CSS / JS files from your index.html), but it gives you a module for each icon and it can help you with downloading resources.

Use Font-Awesome collection

Add to dependencies

In your Cargo.toml:

seed-icons = "0.2.3"

Define additional classes

That's completely optional, but if you want to change for example color of icon, in your .css file you could have something like this:

.green-icon {
    color: green;
}

Import icon

For example regular check-circle could be imported next way:

use seed_icons::fa::regular::check_circle;

Render icon

Just call icon function from imported module like that:

check_circle::icon(vec!["green-icon"])

You can pass any number of classes here, or not pass anything, that's up to you.

Add resources

You might want to download resources with icons by yourself, or you can use seed-icons-gen crate for that.

Add build dependency

In [build-dependencies] add following:

seed-icons-gen = "0.1.8"

Add build.rs

If you already have build.rs, you just need to modify it to do the same as the following one:

fn main() {
    seed_icons_gen::get_fa_resources("static");
}

When your crate would be built, that would download font-awesome folder inside of static folder.

You might want to add .gitignore file in static folder:

fontawesome-free

, because you'd probably will not want to keep all those resources in your VCS.

Link stylesheets

If you've downloaded resources as explained before, then you can link them in index.html like that:

    <link href="static/font-awesome/css/all.css" rel="stylesheet">