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

built-in Badge component styles prevent using bootstrap badge styles #653

Closed
rileytaylor opened this issue Jul 15, 2018 · 1 comment · Fixed by #657
Closed

built-in Badge component styles prevent using bootstrap badge styles #653

rileytaylor opened this issue Jul 15, 2018 · 1 comment · Fixed by #657
Labels
contribution welcome Contributions welcome has PR Has a related PR type: enhancement Request to enhance an existing feature

Comments

@rileytaylor
Copy link

Bug report

The built-in badge component causes issues if you use a .badge css class anywhere else in your application. In my current use case, I'm building a documentation site for our shops custom bootstrap theme. Because bootstrap has a built in .badge css class, suddenly all badges are the Vue green color (Which, you know, is a great color but definitely not what I want for demonstration examples).

Version

0.12

Steps to reproduce

Import bootstrap and try to use a badge component.

<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.2/css/bootstrap.min.css" integrity="sha384-Smlep5jCw/wG7hdkwQ/Z5nLIefveQRIY9nfy6xoR1uRYBtpZgI6339F5dgvm/e9B" crossorigin="anonymous">
<span class="badge badge-secondary">Bootstrap Badge</span>

Bootstrap Badge Documentation for anyone unfamiliar

What happens:

image

What should happen:

image

What is expected?

I should be able to use the <Badge/> component without impeding upon using the bootstrap classes. Regardless of it being "just a bootstrap issue", .badge seems like a common enough css class to either avoid using or protect from disrupting things.

What is actually happening?

From a quick look, it seems that the <Badge/> component uses non-scoped styles, which is why it is affecting other .badge classes throughout the VuePress application. A potential solution would be to scope the styles to the component. Whether the styles are unscoped on purpose or not, I am unsure, nor could it be the best solution. Alternatively, a way to disable some of the built-in components would also be a solution. The Badge component is cool, but rolling my own or not using it would be more preferable in this instance than not being able to effectively document our bootstrap color scheme.

Other relevant information

  • Your OS: macOS 10.13 High Sierra
  • Node.js version: 8.9.4
  • Browser version: Firefox 61
  • Is this a global or local install? local
  • Which package manager did you use for the install? npm (v5.6.0)
@ulivz ulivz added the type: enhancement Request to enhance an existing feature label Jul 17, 2018
@ulivz
Copy link
Member

ulivz commented Jul 17, 2018

Thanks for your reporting, for this issue, we indeed should make style of Badge scoped, and we don't prefer to add extra config for disabling built-in components (We don't want to be webpack, lol~), so just make the styles scoped, contribution welcome!

@ulivz ulivz added the contribution welcome Contributions welcome label Jul 17, 2018
@jordonbaade jordonbaade mentioned this issue Jul 17, 2018
18 tasks
@ulivz ulivz added the has PR Has a related PR label Jul 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution welcome Contributions welcome has PR Has a related PR type: enhancement Request to enhance an existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants