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

[fix] Remove global CSS rules to avoid conflicts #303 Refactored CSS to prevent global styling conflicts with downstream projects. Fixes #303 #317

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

Unnati-Gupta24
Copy link
Contributor

Checklist

  • I have read the OpenWISP Contributing Guidelines.
  • I have manually tested the changes proposed in this pull request.
  • I have written new test cases for new code and/or updated existing tests for changes to existing code.
  • I have updated the documentation.

Reference to Existing Issue

Closes #303 .

Description of Changes

The initial issue was that CSS styles were being applied globally using the * selector, which can cause conflicts in larger projects. Here's how I fixed it:

Created a scoped container structure:

  • Added .netjsongraph-container as main wrapper

  • Added #graphChartContainer for the graph content

  • This contains styles to just these elements instead of affecting entire page

  • Fixed height/positioning issue:

  • Set proper html/body height to 100%

  • Made container absolute positioned with full dimensions
    This ensures graph fills available space correctly

Updated JavaScript:

  • Changed graph initialization to target specific container
  • This connects the new DOM structure to the graph rendering

This approach prevents style leaks while maintaining the original functionality.

@pandafy please review this pull request.
I have made appropriate changes to fix the issue.

@Unnati-Gupta24 Unnati-Gupta24 changed the title Fixing global css issue [fix] Refactor CSS to avoid global style declarations #303 Dec 23, 2024
@Unnati-Gupta24 Unnati-Gupta24 changed the title [fix] Refactor CSS to avoid global style declarations #303 [fix] Remove global CSS rules to avoid conflicts #303 Refactored CSS to prevent global styling conflicts with downstream projects. Fixes #303 Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bug] Avoid setting CSS rules globally
1 participant