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

Bootstrap not working in Polymer #3156

Closed
pvseshu opened this issue Dec 4, 2015 · 2 comments
Closed

Bootstrap not working in Polymer #3156

pvseshu opened this issue Dec 4, 2015 · 2 comments

Comments

@pvseshu
Copy link

pvseshu commented Dec 4, 2015

Currently I am working on polymer 1.0 and using bootstrap, all the styles are working as expected. But if I converted application as shadow DOM by using below code, any of bootstrap styles are not working. On very high level if I imported any css files, those are not working if I enable shadow DOM in polymer. Can you please suggest me any possible way to import css files.

        window.Polymer = window.Polymer || {};
        window.Polymer.dom = 'shadow';
@nazar-pc
Copy link
Contributor

nazar-pc commented Dec 4, 2015

It is expected, since regular styles do not penetrate into Shadow DOM. So naturally it should not work.
So yes, you can forget about Bootstrap and friends under Shadow DOM.
For using under Shadow DOM you have to use elements that are designed to work fine there. You can use elements from here at start: https://elements.polymer-project.org/
Also I have some set of own elements and you can find some other third party elements like Strand as well. But some part of them you'll need to develop yourself, no way to avoid this in long term (in short term you can use hack with /deep/, but it will break at some point anyway, so consider it as temporary solution only).

Eventually Shadow DOM is designed to get rid of Bootstrap and the likes in terms of global styling in favor of styling precisely things you need where you need them and have some degree of confidence that it wouldn't break.

@ebidel
Copy link
Contributor

ebidel commented Dec 4, 2015

See #514

@ebidel ebidel closed this as completed Dec 4, 2015
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

No branches or pull requests

3 participants