leaflet icon indicating copy to clipboard operation
leaflet copied to clipboard

add a CSS fix for leaflet to avoid wider CSS to apply

Open cderv opened this issue 2 years ago • 1 comments

CSS conflict happened in Quarto context where a rule on .legend was applying to Leaflet own legend box

Context of the issue at

  • https://github.com/quarto-dev/quarto-cli/issues/7843

When adding figure caption for a leaflet in Quarto, this will add some CSS bootstrap rules to the document. One being:

.quarto-figure-center>figure>p, .quarto-figure-center>figure>div {
    text-align: center;
}

This rules has effect on text inside the leaflet object !

image

I believe there should be a fix in leaflet CSS so that a default alignment is made on the legend box.

This PR does that.

If this is ok fix with you, question: Should visual test be added ?

If you think this shouldn't be done in leaflet R package, this is also ok. We'll probably add a rule in Quarto to not apply the Figure CSS rules on content under div.html-widget objects

I just figured this could happen in other context without this CSS patch.

cderv avatar Dec 08 '23 16:12 cderv

we'll wait to see how the upstream issue is resolved first.

Agree with that. I did try a PR initially there too, but I suggested also in comment there a specific rule for mermaid (as it seems the rule was added for that)

cderv avatar Dec 11 '23 08:12 cderv