Skip to content

#24373 : Documentation/Utility/Display#24424

Merged
mdo merged 5 commits intotwbs:v4-devfrom
aavmurphy:v4-dev
Oct 23, 2017
Merged

#24373 : Documentation/Utility/Display#24424
mdo merged 5 commits intotwbs:v4-devfrom
aavmurphy:v4-dev

Conversation

@aavmurphy
Copy link
Copy Markdown
Contributor

Use the template from utility=spacing
The most important change is to say the various .d-lg-inline classes work "for the named breakpoint ( sm, md, lg, xl) and above".
The existing "hiding elements para" (not yet live) is exactly what's needed.
Keep simple for "english as a second language" people (e.g. hide not hidden)
Printing: Add print-only and screen-only example

The most important change is to say "for the named breakpoint ( `sm`, `md`, `lg`, `xl`) and above".
The existing "hiding elements para" (not yet live) is exactly what's needed.
Keep simple for "english as a second language" people (e.g. hide not hidden)
@aavmurphy aavmurphy changed the title Documentation/Utility/Display #24373 : Documentation/Utility/Display Oct 18, 2017
Comment thread docs/4.0/utilities/display.md Outdated
---

## Common `display` values
## How it Works
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We sentence case headings—## How it works.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'll get the hang of it ... :)

Comment thread docs/4.0/utilities/display.md Outdated
## How it Works

The [`display` property](https://developer.mozilla.org/en-US/docs/Web/CSS/display) accepts a handful of values and we support many of them with utility classes. We purposefully don't provide every value as a utility, so here's what we support:
Change the `display` value of elements with our responsive-friendly display utility classes.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sentence, the following paragraph, and the last paragraph under notation should be combined.

Change the value of the display property with our responsive display utility classes. We purposely support only a subset of all possible values for display. Classes can be combined for various effects as you need.

Markdown for copy-pasting:

Change the value of the [`display` property](https://developer.mozilla.org/en-US/docs/Web/CSS/display) with our responsive display utility classes. We purposely support only a subset of all possible values for `display`. Classes can be combined for various effects as you need.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nicely worded.

Comment thread docs/4.0/utilities/display.md Outdated
Put them to use by applying any of the classes to an element of your choice. For example, here's how you could use the inline, block, or inline-block utilities (the same applies to the other classes).
## Notation

The classes are named using the format
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use the same approach from the Spacing docs. Also, always include a line between paragraphs and always use punctuation.

Display utility classes that apply to all breakpoints, from xs to xl, have no breakpoint abbreviation in them. This is because those classes are applied from min-width: 0 and up, and thus are not bound by a media query. The remaining breakpoints, however, do include a breakpoint abbreviation.

As such, the classes are named using the format .d-{value} for xs and .d-{breakpoint}-{value} for sm, md, lg, and xl.

Markdown for copy-pasting:

Display utility classes that apply to all breakpoints, from `xs` to `xl`, have no breakpoint abbreviation in them. This is because those classes are applied from `min-width: 0` and up, and thus are not bound by a media query. The remaining breakpoints, however, do include a breakpoint abbreviation.

As such, the classes are named using the format `.d-{value}` for `xs` and `.d-{breakpoint}-{value}`  for `sm`, `md`, `lg`, and `xl`.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still like mine, but compromised with bullet points to make it stand out for newbies.

Comment thread docs/4.0/utilities/display.md Outdated
* `flex`
* `inline-flex`

For example, `d-lg-none` sets `display:none` on screens larger than the lg breakpoint.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • When writing classes, use the . in the beginning.
  • When writing property: value;, use a space and trailing ;.
  • When using the breakpoint shorthand (e.g., "lg"), write it with backticks to render it as code: lg.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got you. moved the (this breakpoint or wider) emphasis to here

its what confused me at first, the layout/overview/#breakpoints page only mentions xs in a comment, so i hadn't noticed it

Comment thread docs/4.0/utilities/display.md Outdated

For example, `d-lg-none` sets `display:none` on screens larger than the lg breakpoint.

Combine these classes to get the effect you need.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merge into first paragraph.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

| Visible only on xl | `d-none d-xl-block` |

{% example html %}
<div class="d-lg-none">hide on screens wider than lg</div>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capitalize h in hide on these two lines

Comment thread docs/4.0/utilities/display.md Outdated
The print and display classes can be combined.

{% example html %}
<div class="d-print-none">Screen Only (hide on print)</div>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change text to Hide on print only

Comment thread docs/4.0/utilities/display.md Outdated

{% example html %}
<div class="d-print-none">Screen Only (hide on print)</div>
<div class="d-none d-print-block">Print Only (hide on screen)</div>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change text to Show on print only

Comment thread docs/4.0/utilities/display.md Outdated
{% example html %}
<div class="d-print-none">Screen Only (hide on print)</div>
<div class="d-none d-print-block">Print Only (hide on screen)</div>
<div class="d-none d-lg-block d-print-block">(lg or wider) screen and print only. Hide on smaller than lg screen.</div>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change text to Hide up to large on screen, but always show on print

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@aavmurphy
Copy link
Copy Markdown
Contributor Author

@mdo
Appreciate the detailed comments!
There were a few more ".class" and "property: value;" changes.
Please check the breakpoints URL, (line 10 - I couldn't test it)
Thanks

@mdo mdo mentioned this pull request Oct 23, 2017
@mdo mdo merged commit c600176 into twbs:v4-dev Oct 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants