-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Patch out bootstrap rule forcing black and white printing #3212
Conversation
The test failures on Travis appear to be genuine failures from nbval. I just released 0.8, which catches some discrepancies that earlier versions of nbval missed. CC @vidartf . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's been long standing enough. +1 for hackish solution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is ugly but it is a long standing issue and doing it less hacky way implies a lot of additional complexity.
+1 as well.
rmed = lines.pop(ix) | ||
print("Removed line", ix, "from bootstrap print.less:") | ||
print("-", rmed) | ||
print() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why this empty print
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It makes a blank line, so the text above is slightly easier to pick out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough 👍
lines = f.readlines() | ||
|
||
for ix, line in enumerate(lines): | ||
if 'Black prints faster' in line: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this is enough specific to patch the proper line, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be. The original file is not very long:
https://github.com/twbs/bootstrap/blob/v3.3.7/less/print.less
Thanks both ! |
@mpacer @takluyver, we need to update the css in the CDN so nbconvert can catch this change. |
A thoroughly ugly hack. Bootstrap forces all text to be black when printing, resulting in a long running issue (#840). I tried to override it with
color: inherit !important
, but that didn't produce the right results. I can't find any way to tell LESS to remove a rule or act as if it didn't exist. So the only thing I can think to do is to patch the source we get from bootstrap to get rid of the rule entirely.Frustratingly, it looks like bootstrap is fixing this (getting rid of the rule) for v4, but it's also moving from LESS to SCSS, so we can't easily switch to the new version.
Closes gh-840