You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the documentation there is no mention of the print classes having this behaviour, rather to the contrary in the example provided in the docs is the following markup:
<divclass="d-none d-lg-block d-print-block">Hide up to large on screen, but always show on print</div>
And as seen in the docs, the above div is not visible on large screens, despite what the d-lg-block class would make one assume.
Proposed resolutions
Remove the display: none !important style from the d-print-* classes.
Include a mention in the documentation that applying a d-print-* class will also hide the element on all except @print media. Also remove the div from above from the docs as it is confusing and infers that the element should be visible on large screens.
I would strongly argue in favor of the first proposed resolution. Since the d-none classes exists it would make sense to add that class to any element which should only be included when printing.
The text was updated successfully, but these errors were encountered:
jarvelov
changed the title
Unexpected display none in d-print-* classes applied to non print media
[v4 beta-3] Unexpected display none in d-print-* classes applied to non print media
Jan 6, 2018
Fixes#25221.
I agree with the referenced issue—this is unexpected and also causes a serious bug when mixed with other utility classes. I don't know why this wasn't an issue in v3—perhaps folks weren't using these as widely? I'm planning on leaving this for a v4.x or v4.0.x release to get some feedback.
* Prevent print utils from overriding all other display utils
Fixes#25221.
I agree with the referenced issue—this is unexpected and also causes a serious bug when mixed with other utility classes. This wasn't an issue in v3 given we had different utilities for hiding that weren't focused on display property.
* Add printing changes to migration docs
* unrelated heading sentence case change
* List out all .d-print- classes
Description
The
.d-print-*
classes unexpectedly added adisplay: none !important
when adding class to an element. As seen in the source of display.scssIn the documentation there is no mention of the print classes having this behaviour, rather to the contrary in the example provided in the docs is the following markup:
And as seen in the docs, the above
div
is not visible on large screens, despite what thed-lg-block
class would make one assume.Proposed resolutions
Remove the
display: none !important
style from thed-print-*
classes.Include a mention in the documentation that applying a
d-print-*
class will also hide the element on all except @print media. Also remove the div from above from the docs as it is confusing and infers that the element should be visible on large screens.I would strongly argue in favor of the first proposed resolution. Since the
d-none
classes exists it would make sense to add that class to any element which should only be included when printing.Demo
Fiddle: https://jsfiddle.net/b2zfLvpe/
As seen in the documentation: https://getbootstrap.com/docs/4.0/utilities/display/#display-in-print
The text was updated successfully, but these errors were encountered: