Conversation
This reverts commit cb9c85b.
Co-authored-by: Vidhan Bhatt <me@vidhan.io>
# Conflicts: # crates/hypertext-macros/src/html/syntaxes/rsx.rs # crates/hypertext/tests/alloc.rs # crates/hypertext/tests/builder.rs
|
@Brocktho @philocalyst, please give this a test if interested and let me know if you hit any snags! :) |
|
I don't want to be a bummer, but aren't at least Actually, those attribs seem to be missing:
|
|
@howesteve They are described in the attribute trait for SVGs which defines base attributes for all SVG elements, do you have an example of some code that isn't working as expected? |
Sure. Sorry for the delay in answering this - crazy days here. use hypertext::prelude::*;
fn main() {
// test case 1: SVG with fill attribute
let svg_with_fill = rsx!(
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
<path d="M13 10V3L4 14h7v7l9-11h-7z" />
</svg>
);
// rest case 2: SVG with stroke attribute
let svg_with_stroke = rsx!(
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path d="M13 10V3L4 14h7v7l9-11h-7z" />
</svg>
);
// test case 3: SVG with stroke-width attribute
let svg_with_stroke_width = rsx!(
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
<path d="M13 10V3L4 14h7v7l9-11h-7z" />
</svg>
);
// Test case 4: SVG with stroke-linecap and stroke-linejoin
let svg_with_stroke_attrs = rsx!(
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M13 10V3L4 14h7v7l9-11h-7z" />
</svg>
);
}Cargo.toml - I'm using rev 9773200 here, latest I see after svg support.
|
closes #2