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

[v10.1.x] Canvas: Avoid conflicting stylesheets when loading SVG icons #75032

Merged
merged 1 commit into from Sep 18, 2023

Conversation

grafana-delivery-bot[bot]
Copy link
Contributor

Backport 7171b35 from #74461


While investigating https://github.com/grafana/support-escalations/issues/7316 we noticed that the SVGs used had the same class names defined between the <style> tag, which was causing the SVGs to borrow styling from one to another. The issue doesn't happen for SVGs that don't have custom styling defined.
The solution was to add a unique ID to each SVG and use the ID when defining the classes.

Before

svgs_before.mov

After

svgs_after.mov

Fixes https://github.com/grafana/support-escalations/issues/7316

Special notes for your reviewer:
Cases covered:

  • add new ID to SVG when not defined
  • if ID is defined, use it/overwrite the existing one in <style>

Please check that:

  • It works as expected from a user's perspective.
  • If this is a pre-GA feature, it is behind a feature toggle.
  • The docs are updated, and if this is a notable improvement, it's added to our What's New doc.

@grafana-delivery-bot grafana-delivery-bot bot requested review from a team as code owners September 18, 2023 17:40
@grafana-delivery-bot grafana-delivery-bot bot requested review from joshhunt and L-M-K-B and removed request for a team September 18, 2023 17:40
@grafana-delivery-bot grafana-delivery-bot bot added this to the 10.1.x milestone Sep 18, 2023
@adela-almasan adela-almasan enabled auto-merge (squash) September 18, 2023 17:50
@adela-almasan adela-almasan merged commit 476771b into v10.1.x Sep 18, 2023
18 checks passed
@adela-almasan adela-almasan deleted the backport-74461-to-v10.1.x branch September 18, 2023 17:52
@zerok zerok modified the milestones: 10.1.x, 10.1.3 Sep 19, 2023
@zerok zerok modified the milestones: 10.1.3, 10.1.5 Oct 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants