GithubHelp home page GithubHelp logo

Comments (4)

DonDebonair avatar DonDebonair commented on April 28, 2024

The problem does not lie with pelican-bootstrap3. The pygments.css file is explicitly included after bootstrap.min.css, so any rules present in both will be overridden by pygments.css. The problem I'm seeing, is that the CSS files generated by Pygments, don't include a directive for the background-color of the whole pre section. The only background-color I'm seeing is (with the Pygments theme I chose): .hll { background-color: #49483e }. So somehow, Bootstrap's pre rule takes precedence there.
Maybe it's a problem with the way Pelican calls pygmentize, and the way the HTML is generated for the codeblocks, or the problem is with the generated CSS files.

The only solution for now, is to include a rule .highlight pre in style.css.

from pelican-themes.

nikipore avatar nikipore commented on April 28, 2024

I was just wondering whether there is a generic way to clear bootstrap's pre directive. In a dynamic language one would call this "monkey-patching". If one cannot achieve this with CSS, HTML, or JavaScript, I'll stay with my current workaround to fix it by removing the pre upstream in the bootstrap LESS code.

BTW: depending on the Pygments style, there are more background-color rules. I haven't found any way yet either to call pygments in a way to work around the pre collision.

from pelican-themes.

bdrewery avatar bdrewery commented on April 28, 2024

Note that the hll is for highlighted lines, not all lines.

This works for me with bootstrap (my code is classed as 'codehilight'):

.codehilite pre {
  color: inherit;
  background: inherit;
  background-color: inherit;
  font-style: inherit;
  text-decoration: inherit;
  font-weight: inherit;
}

from pelican-themes.

DonDebonair avatar DonDebonair commented on April 28, 2024

That doesn't actually solve the aforementioned problem. Somehow, the CSS that Pygments outputs by default, isn't specific enough, so you'll end up with the background color as defined by your Bootswatch theme or Bootstrap.

from pelican-themes.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.