Skip to content
GitLab
    • Explore Projects Groups Snippets
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bootstrap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 263
    • Issues 263
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 114
    • Merge requests 114
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Bootstrap
  • bootstrap
  • Merge requests
  • !25269

Prevent print utils from overriding all other display utils

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Mark Otto requested to merge print-display into v4-dev 7 years ago
  • Overview 0
  • Commits 7
  • Pipelines 0
  • Changes 3

Fixes #25221 (closed).

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 the display property or a single direction for hiding content (mobile up).

This also adds support for all additional display values we have for the normal .d-* utilities.

  • Update documentation to mention all utilities
  • Entry to migration guide if needed
Compare
  • v4-dev (base)

and
  • latest version
    1babf869
    7 commits, 2 years ago

3 files
+ 33
- 37

    Preferences

    File browser
    Compare changes
docs‎/4.0‎
util‎ities‎
displ‎ay.md‎ +12 -9
migrat‎ion.md‎ +11 -0
scss/ut‎ilities‎
_displ‎ay.scss‎ +10 -28
docs/4.0/utilities/display.md
+ 12
- 9
  • View file @ 1babf869

  • Edit in single-file editor

  • Open in Web IDE


@@ -45,7 +45,7 @@ The media queries effect screen widths with the given breakpoint *or larger*. Fo
<span class="d-block p-2 bg-dark text-white">d-block</span>
{% endexample %}
## Hiding Elements
## Hiding elements
For faster mobile-friendly development, use responsive display classes for showing and hiding elements by device. Avoid creating entirely different versions of the same site, instead hide element responsively for each screen size.
@@ -75,14 +75,17 @@ To show an element only on a given interval of screen sizes you can combine one
## Display in print
Change the `display` value of elements when printing with our print display utility classes.
| Class | Print style |
| --- | --- |
| `.d-print-block` | Applies `display: block;` to the element when printing |
| `.d-print-inline` | Applies `display: inline;` to the element when printing |
| `.d-print-inline-block` | Applies `display: inline-block;` to the element when printing |
| `.d-print-none` | Applies `display: none;` to the element when printing |
Change the `display` value of elements when printing with our print display utility classes. Includes support for the same `display` values as our responsive `.d-*` utilities.
- `.d-print-none`
- `.d-print-inline`
- `.d-print-inline-block`
- `.d-print-block`
- `.d-print-table`
- `.d-print-table-row`
- `.d-print-table-cell`
- `.d-print-flex`
- `.d-print-inline-flex`
The print and display classes can be combined.
docs/4.0/migration.md
+ 11
- 0
  • View file @ 1babf869

  • Edit in single-file editor

  • Open in Web IDE


@@ -6,6 +6,17 @@ group: migration
toc: true
---
## Stable changes
Moving from Beta 3 to our stable v4.0 release, there are no breaking changes, but there are some notable changes.
### Printing
- Fixed broken print utilities. Previously, using a `.d-print-*` class would unexpectedly overrule any other `.d-*` class. Now, they match our other display utilities and only apply to that media (`@media print`).
- Expanded available print display utilities to match other utilities. Beta 3 and older only had `block`, `inline-block`, `inline`, and `none`. Stable v4 added `flex`, `inline-flex`, `table`, `table-row`, and `table-cell`.
- Fixed print preview rendering across browsers with new print styles that specify `@page` `size`.
## Beta 3 changes
While Beta 2 saw the bulk of our breaking changes during the beta phase, but we still have a few that needed to be addressed in the Beta 3 release. These changes apply if you're updating to Beta 3 from Beta 2 or any older version of Bootstrap.
scss/utilities/_display.scss
+ 10
- 28
  • View file @ 1babf869

  • Edit in single-file editor

  • Open in Web IDE


@@ -25,32 +25,14 @@
// Utilities for toggling `display` in print
//
.d-print-block {
display: none !important;
@media print {
display: block !important;
}
}
.d-print-inline {
display: none !important;
@media print {
display: inline !important;
}
}
.d-print-inline-block {
display: none !important;
@media print {
display: inline-block !important;
}
}
.d-print-none {
@media print {
display: none !important;
}
@media print {
.d-print-none { display: none !important; }
.d-print-inline { display: inline !important; }
.d-print-inline-block { display: inline-block !important; }
.d-print-block { display: block !important; }
.d-print-table { display: table !important; }
.d-print-table-row { display: table-row !important; }
.d-print-table-cell { display: table-cell !important; }
.d-print-flex { display: flex !important; }
.d-print-inline-flex { display: inline-flex !important; }
}
0 Assignees
None
Assign to
0 Reviewers
None
Request review from
Labels
0
None
0
None
    Assign labels
  • Manage project labels

Milestone
No milestone
None
None
Time tracking
No estimate or time spent
Lock merge request
Unlocked
0
0 participants
Reference: firstcontributions/first-contributions!65096
Source branch: print-display

Menu

Explore Projects Groups Snippets