-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42 from WorldSEnder/inline-spacing
Address spacing in combinators
- Loading branch information
Showing
4 changed files
with
60 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
packages/stylist/tests/macro_integrations/whitespace-workaround-pass.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
fn main() { | ||
let _ = env_logger::builder().is_test(true).try_init(); | ||
let style = stylist::style! { | ||
&.class-a.class-b { | ||
color: red; | ||
} | ||
// FIXME: this test case is currently documenting a quirk with the inline style. | ||
// Once it can be fixed (proc_macro_span, https://github.com/rust-lang/rust/issues/54725) | ||
// update this test case output and the documentation | ||
// v-- whitespace not detected | ||
&.class-a .class-b { | ||
color: black; | ||
} | ||
&.class-a *.class-b { | ||
color: white; | ||
} | ||
&.class-a #content { | ||
color: white; | ||
} | ||
} | ||
.unwrap(); | ||
let expected_result = format!( | ||
r#".{cls}.class-a.class-b {{ | ||
color: red; | ||
}} | ||
.{cls}.class-a.class-b {{ | ||
color: black; | ||
}} | ||
.{cls}.class-a *.class-b {{ | ||
color: white; | ||
}} | ||
.{cls}.class-a #content {{ | ||
color: white; | ||
}} | ||
"#, | ||
cls = style.get_class_name() | ||
); | ||
assert_eq!(expected_result, style.get_style_str()); | ||
} |