feat: relative style paths & component crate example
This commit is contained in:
parent
28b7c4687d
commit
17fa4ab197
4 changed files with 376 additions and 89 deletions
1
examples/use-styles/Cargo.lock
generated
1
examples/use-styles/Cargo.lock
generated
|
|
@ -1016,6 +1016,7 @@ dependencies = [
|
|||
name = "sabry_procmacro"
|
||||
version = "0.0.1"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"sabry_procmacro_impl",
|
||||
]
|
||||
|
||||
|
|
|
|||
|
|
@ -6,10 +6,10 @@ rust-version = "1.82"
|
|||
publish = false
|
||||
|
||||
[dependencies]
|
||||
sabry = {path = "../../"}
|
||||
sabry = {path = "../../", features = ["nightly"]}
|
||||
|
||||
[build-dependencies]
|
||||
sabry = {path = "../../", features = ["build"]}
|
||||
sabry = {path = "../../", features = ["build", "nightly"]}
|
||||
define-styles = {path = "../define-styles"}
|
||||
|
||||
[package.metadata.sabry]
|
||||
|
|
|
|||
|
|
@ -9,14 +9,8 @@ scssy!(utils {"
|
|||
}
|
||||
"});
|
||||
|
||||
fn main(){
|
||||
fn main() {
|
||||
/* Declare modules to use with sabry */
|
||||
sabry::buildy(
|
||||
usey!(
|
||||
theme!(),
|
||||
tokens!(),
|
||||
utils_dup!(),
|
||||
utils!()
|
||||
)
|
||||
).expect("Failed to build sabry styles");
|
||||
sabry::buildy(usey!(theme!(), tokens!(), utils_dup!(), utils!()))
|
||||
.expect("Failed to build sabry styles");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,9 @@ styly!(pub const bundlemod {"
|
|||
}
|
||||
"});
|
||||
|
||||
styly!(pub filemod:sass "src/main.sass");
|
||||
// relative path is available because 'nightly' feature flag is set.
|
||||
// If you don't - this will be "src/main.sass"
|
||||
styly!(pub const filemod:sass "./main.sass");
|
||||
|
||||
fn main() {
|
||||
println!("someth class codemod styles: {}", bundlemod::someth);
|
||||
|
|
@ -28,5 +30,6 @@ fn main() {
|
|||
);
|
||||
println!("#fox id will be: {}", bundlemod::thefox);
|
||||
println!("Bundles const CSS will be: {}", BUNDLEMOD_CSS);
|
||||
println!("Bundles const CSS from file will be: {}", FILEMOD_CSS); // false-positive from relative file.
|
||||
println!("Thats how we used the styles! Good luck!!");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue