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

ComponentLab style overrides own styles #26

Open
manuelhuber opened this issue Oct 13, 2017 · 3 comments
Open

ComponentLab style overrides own styles #26

manuelhuber opened this issue Oct 13, 2017 · 3 comments

Comments

@manuelhuber
Copy link

My components look different inside the component lab compared to the actual app. That's because there're some styles inside the component lab that apply to my components.

Here's what it looks like in the component lab. The highlighted style entry on the right is from ComponentLab.
With component lab style

That's what it's supposed to look like (I deleted the component lab style entry in the header)
Without component lab style

@PatrickStephansen
Copy link

I'm having the same problem. The component lab styles completely remove any margins and padding that the browser usually defaults. They also stop lists and block quotes from rendering properly. Basically every element is reduced to behaving like a div.

Removing the component lab style tag only seems to slightly affect spacing in the generated navigation menu. These styles should be specific to component lab classes. They shouldn't second-guess the browser's default rendering in my opinion.

@PatrickStephansen
Copy link

Looking at the source, removing the encapsulation: ViewEncapsulation.None line from src/frontend/containers/app.ts should namespace the styles and solve the issue.

PatrickStephansen pushed a commit to PatrickStephansen/component-lab that referenced this issue Sep 11, 2018
…ts under test

This adds some extra padding in the menu for the test case I tried. The styles may need some tweaking.
@PatrickStephansen
Copy link

I've made a PR with a quick fix. It does have some side effects on the menu styling, but it's good enough for my purposes.

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

2 participants