Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Css style is included after I remove the instruction to include it #14

Closed
rambip opened this issue Apr 2, 2024 · 2 comments
Closed
Labels
bug Something isn't working

Comments

@rambip
Copy link
Contributor

rambip commented Apr 2, 2024

Problem

When I include a stylesheet via manganis and I remove the import, the stylesheet is still used on the page.

Steps To Reproduce

Steps to reproduce the behavior:

  1. create a file test.css with this content: div {background-color: red;}
  2. create an empty dioxus project with this content:
#![allow(non_snake_case)]

use dioxus::prelude::*;
use manganis::*;

static _STYLE_SHEET: &str = mg!(file("test.css"));

fn App() -> Element {
    rsx!{
        div {
            "hello"
        }
    }
}

fn main() {
    launch(App)
}
  1. launch with dx serve

The div is colored in red

  1. comment the line static _STYLE_SHEET: &str = mg!(file("test.css"));

  2. dx serve again

Now the div ist still red

Expected behavior

The div should return to default style when the line si commented out.

Environment:

  • Manganis version: v0.2.2
  • Rust version: 1.75.0
  • OS info: fedora
  • App platform: web

Questionnaire

  • [ x] I'm interested in fixing this myself but don't know where to start
@jmmk
Copy link

jmmk commented May 24, 2024

At the very least, I would expect dx clean to remedy the situation, but it does not seem to. I was able to fix it only after finding DioxusLabs/dioxus#2192 and cleaning up the files in ~/.cargo

@ealmloff
Copy link
Member

ealmloff commented Jul 3, 2024

This was fixed in #30

@ealmloff ealmloff closed this as completed Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants