scoped_css
Tools for generating scoped css.
How to use
// or the following, which generated a static variable named css
static_css!
Supported CSS features
Classes, ids, tags and attributes are supported. Selectors like > are not.
In addition, nested selectors are supported.
scoped_css::static_css!(
body.my_app #some_id[some-attr="hello"] {
.nested_stuff_is_supported_too {
color: blue;
}
}
)
TODO and drawbacks
This is pretty alpha, and is only being published for a demo :)
- There is no support for selectors that define the relationship between elements, e.g.
> - There is no support for pseudo-selectors
- There is no support for classes that aren't valid property names. For example, classes with dashes are not supported.
- The
to_css_stringfunction should be a trait, so that CSS can be passed around. - There are no tests.
- There is no ability to change the name of the static css variable, or of its type.