sunbeam

Sunbeam is a typo-safe CSS class library
Sunbeam is a typo-safe CSS class library.
With sunbeam you write your CSS using the css! macro.
Later, at build time, you run sunbeam-build to parse these css! calls and then generate a CSS file that contains only
the CSS that your application is using.
Basic Usage
// src/main.rs
extern crate sunbeam;
// build.rs
use sunbeam_build;
Custom CSS
Sunbeam's default styles should cover most use cases, but some applications might need to introduce new classes for their own needs.
For certain kinds of CSS, sunbeam allows you to define additional classes that will also be type checked at compile time.
# Sunbeam.toml
screen-widths = [ 308, 999, ]
[colors]
brand-red = #ff0001
let classes = css!("mb36 ml98 p85 bg-col-brand-red mt5 mr10");
assert_eq!(classes, "mb36 ml98 p85 bg-col-brand-red mt5 mr10");
Invalid CSS
If you try to use a class or selector that is not defined by sunbeam or in your Sunbeam.toml, you will get a compile time error.
let _classes = css!("d-flex not-a-real-class");
# SHOW THE COMPILE TIME ERROR HERE
TODO
- Docs explain why Sunbeam does not come with color palettes. We want to encourage visual diversity.
To Test
To run the test suite.
# Clone the repository
# Run tests
License
sunbeam is licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)