-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Don't display the Symfony debug toolbar when printing the page #23460
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
Conversation
Q | A |
---|---|
Branch? | 2.8 |
Bug fix? | yes |
New feature? | no |
BC breaks? | no |
Deprecations? | no |
Tests pass? | yes |
Fixed tickets | #23303 |
License | MIT |
Doc PR | - |
@media print { | ||
.sf-toolbar, .sf-error-toolbar { | ||
display: none; | ||
visibility: hidden; |
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.
what's the reason for this if there is already display: none
?
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 was in the original CSS rule ... but you are right and this is no longer needed (Bootstrap v4 doesn't use that either. See https://github.com/twbs/bootstrap/blob/v4-dev/scss/_print.scss)
Actually, the issue is that the media query hiding the whole toolbar (error one or normal one) is missing now. /***** Media query print: Do not print the Toolbar. *****/
@media print {
.sf-toolbar {
display: none;
visibility: hidden;
}
} But the 2.8 branch does not seem to have it anymore. I suspect a bad conflict resolution when merging branches |
|
||
/***** Media query print: Do not print the Toolbar. *****/ | ||
@media print { | ||
.sf-toolbar, .sf-error-toolbar { |
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.
.sf-error-toolbar
is useless here, as the error toolbar also has the sf-toolbar
class
Thank you @javiereguiluz. |
This PR was merged into the 3.4 branch. Discussion ---------- [WebProfilerBundle] Hide debug toolbar in print view | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | License | MIT The debug toolbar is intended to be hidden when printed. This was accomplished in 2.8 with [this PR](#23460). Since then, additional JavaScript code was added which results in `display: block` being applied directly to the toolbar element. This overrides the print style, which causes the toolbar to show up in the print view. I fixed this by adding `!important` to the print CSS display rule. A few notes: 1. I hesitated to solve this with `!important` but couldn't come up with another way to make this work with the existing JavaScript code. Also, `profiler.css.twig` already has some `!important` styles, so I figured this was acceptable. 2. I wasn't sure how to write a test for this, but I am open to ideas. Commits ------- fb30516 [WebProfilerBundle] Hide debug toolbar in print view