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

crates/csslsrs/src/features/hover.rs: HTML selectors preview #19

Open
goulvenclech opened this issue Dec 19, 2024 · 0 comments
Open

crates/csslsrs/src/features/hover.rs: HTML selectors preview #19

goulvenclech opened this issue Dec 19, 2024 · 0 comments
Assignees
Labels
crt:csslsrs Changes in the CSSlsrs crate. enhancement New feature ahead P3 - normal New features, bugs with workarounds, bugs affecting very specific usage...

Comments

@goulvenclech
Copy link
Member

format_css_selector_entry uses a placeholder for selectors :

/// Formats the CSS selector entry into a hover content string.
fn format_css_selector_entry(name: &str, specificity: Option<(u32, u32, u32)>) -> String {
    let mut content = String::new();
    // TODO: this is a placeholder, we should render an HTML preview of the selector
    writeln!(content, "**{}**\n", escape_markdown(name)).unwrap();
    // Add specificity if available
    if let Some((ids, classes, elements)) = specificity {
        writeln!(content,
            "[Selector Specificity](https://developer.mozilla.org/docs/Web/CSS/Specificity): ({}, {}, {})\n",
            ids, classes, elements
        ).unwrap();
    }
    content
}

An HTML preview should replace it:
image

@goulvenclech goulvenclech added enhancement New feature ahead P2 - high Bugs that violates the documented behavior. crt:csslsrs Changes in the CSSlsrs crate. labels Dec 19, 2024
@goulvenclech goulvenclech self-assigned this Dec 19, 2024
@goulvenclech goulvenclech added P3 - normal New features, bugs with workarounds, bugs affecting very specific usage... and removed P2 - high Bugs that violates the documented behavior. labels Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crt:csslsrs Changes in the CSSlsrs crate. enhancement New feature ahead P3 - normal New features, bugs with workarounds, bugs affecting very specific usage...
Projects
None yet
Development

No branches or pull requests

1 participant