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

Document importing Hopper's CSS on a layer #158

Open
alexasselin008 opened this issue Mar 1, 2024 · 2 comments
Open

Document importing Hopper's CSS on a layer #158

alexasselin008 opened this issue Mar 1, 2024 · 2 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@alexasselin008
Copy link
Member

A number of developers have encountered difficulties when trying to overwrite Hopper's CSS styling with their own. The standard practice of simply importing Hopper's CSS into the main stylesheet often leads to issues where Hopper's styles take precedence over custom styles due to CSS specificity and source order.

The solution to this problem is to use layers.
This allows developers to import Hopper's css into a specific layer, making it easier to manage styling precedence.

@import url("@hopper-ui/icons/index.css") layer(design-system)

we should document this standard pratices in our documentation

@alexasselin008 alexasselin008 added the documentation Improvements or additions to documentation label Mar 1, 2024
@fraincs
Copy link
Contributor

fraincs commented Mar 11, 2024

I would not say that it's standard practice, layers are pretty much new in the CSS environment. Documenting could be done, if it does not encourage the practice until we have more experience with this. It was not a huge success so far.

@alexasselin008
Copy link
Member Author

The way it was done in igloo was unorthodox, but importing css files on different layers is exactly the intended purpose of this feature.

@fraincs fraincs self-assigned this Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants