Open tkr-sh opened 1 year ago
can you please push the sample code on github and share the link?
can you please push the sample code on github and share the link?
I have the same error, I can give code:
use leptos::*;
use leptos_meta::Stylesheet;
use stylers::style_sheet;
#[component]
fn App() -> impl IntoView {
let class_name = style_sheet!("./css/styles2.css");
view! {class = class_name,
<div id="pepe">
<h4>MainContainer</h4>
<div>
<h4>ContactsSidebar</h4>
</div>
<div>
<h4>ChatHeader</h4>
</div>
<div>
<h4>ChatContainer</h4>
<div>
<h5>Name</h5>
<p>Message</p>
<span>Date</span>
</div>
</div>
</div>
}
}
fn main() {
mount_to_body(|| {
view! {
<App />
}
})
}
error: Expected to read file
--> web-app\src\main.rs:6:22
|
6 | let class_name = style_sheet!("./css/styles2.css");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this error originates in the macro `style_sheet` (in Nightly builds, run with -Z macro-backtrace for more info)
More beautiful
I can't get
style_sheet!
macro to work. Step to reproduce:Create a file
src/test.css
with the content:And in
HomePage
add:The expected result is the text being red, but no style is applied no matter what.
If you can not reproduce, I can make a Dockerfile of it.