question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bootstrap 3 conflicts

See original GitHub issue

Hi,

Thanks for the project, very cool!

I used it in combination with Bootstrap 3, and had to add the following CSS rules to get it to show correctly:

pre, code {
    background: #f8f8ff;
    font-family: monospace;
}

The background color here is not really important (it’s the github theme), the thing is bootstrap applies a background to the <pre> and highlight.js to the <code>, so we can see a bit of the <pre> and its different background color.

I didn’t do a pull request because maybe that has already been discussed.

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
isagalaevcommented, Nov 23, 2013

Hi,

First, a thing to note: in a recent change we now apply the ‘hljs’ class to the container holding the code and all our stylesheets now refer to .hljs rather than pre code.

Anyway, since we try not to tie highlighting to any particular container markup, it is expected that you might need some “integration” styling to have code blocks look nice in your site’s stylesheet. From the point of view of a highlighting library we just can’t know which pre-existing rules to take into account.

Does that make sense? (My English feels awkward today 😃 )

0reactions
isagalaevcommented, Nov 24, 2013

maybe not styling the <pre> but just those two:

pre code, .hljs { background: ...; }

But this way we’re back to the problem that started the thread 😃

To sum this up, we’re aware of the problem that a site style setting a background to <pre> may not work beautifully out of the box with highlight.js. We don’t have an immediate solution for this without causing other regressions, so for now we consider writing a bit of glue code in CSS a recommended workaround.

Closing the issue until a better solution comes up.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Resolve the conflict between Bootstrap 3 and PrototypeJS
Opposite to the older Twitter Bootstrap 2, some of these components are incompatible with the Prototype Javascript framework.
Read more >
Application using bootstrap 3 and 4 together has conflicts
I have an App that uses bootstrap 3 and 4. Its a pretty massive application and built on combination of angular 1 and...
Read more >
Bootstrap 3 conflict! - concrete5
Hello, I'm using bootstrap 3 on my custom theme and everything is working fine, except whenever I'm in the edit mode, when I...
Read more >
Conflict with bootstrap 3 #742 - mleibman/SlickGrid - GitHub
With bootstrap.css, something on cell/header size calculating is wrong. So the cells of the same column of different rows are not aligned ...
Read more >
JavaScript - Bootstrap
No conflict​​ Sometimes it is necessary to use Bootstrap plugins with other UI frameworks. In these circumstances, namespace collisions can occasionally occur. ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found