#Style tag persistence

1 messages · Page 1 of 1 (latest)

foggy pine
#

So... I have some code:

        rsx!{
            document::Style {
                r#"
                    body:has(.project) {{
                        background-color: {bg.color};
                    }}
                "#
            }
        }

The problem is that this leads to a buildup of style tags when navigating around my page. This is probably not good, but the :has selector works for me as a band-aid fix. Is there a better fix out there?

cosmic bloom
#

@keen cairn Aren't we supposed to have deduplication with document::Style?

keen cairn
#

Only by href for external assets

#

Style { href: asset!() } shouldn't be duplicated a bunch, but inline styles will

foggy pine
#

Interesting....

#

Is there a way to dedup it