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

antd.css is overriding existing css in entire application #4546

Closed
prashantvithani opened this issue Jan 10, 2017 · 6 comments
Closed

antd.css is overriding existing css in entire application #4546

prashantvithani opened this issue Jan 10, 2017 · 6 comments

Comments

@prashantvithani
Copy link

prashantvithani commented Jan 10, 2017

Environment(required)

  • antd version: 2.6.1

What did you do? Please provide steps to re-produce your problem.

I Included the antd.css file at application level along with other css files. After reloading the browser, I see that all rules I have written before are overridden by the rules in antd.css

What do you expected?

I want the antd.css to be applied only for specific component which is used. Don't want existing style to be altered.

@benjycui
Copy link
Contributor

Yep, it's recommended to use antd in new project, or make your old project follow Ant Design Specification

@afc163
Copy link
Member

afc163 commented Jan 10, 2017

#4331 (comment)

@edmulraney
Copy link

Is it on your road map? I've partially worked around this issue by including antd css first then my own css so that antd gets overwritten by mine, obviously this isn't ideal.

@prashantvithani
Copy link
Author

I've found a work around by removing all the CSS rules based on Tags like html, body, a, h1 etc... Only kept CSS rules based on classes. It's helping for now.

@bchenSyd
Copy link
Contributor

I also thought of copying the css out and remove those global rules. but this is a hacky approach and will make my code out of sync with the latest code base -- it could be broken anytime after a npm upgrade

@lock
Copy link

lock bot commented May 12, 2018

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

@lock lock bot locked as resolved and limited conversation to collaborators May 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants