Skip to content
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

#24373 : Documentation/Utility/Display #24424

Merged
merged 5 commits into from
Oct 23, 2017
Merged

#24373 : Documentation/Utility/Display #24424

merged 5 commits into from
Oct 23, 2017

Conversation

aavmurphy
Copy link
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
@@ -6,20 +6,34 @@ group: utilities
toc: true
---

## Common `display` values
## How it Works
Copy link
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
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 ... :)


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
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
Contributor Author

Choose a reason for hiding this comment

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

nicely worded.

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
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
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.

* `flex`
* `inline-flex`

For example, `d-lg-none` sets `display:none` on screens larger than the lg breakpoint.
Copy link
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
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


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
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
Contributor Author

Choose a reason for hiding this comment

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

yes

@@ -70,13 +68,26 @@ To show an element only on a given interval of screen sizes you can combine one
| Visible only on lg | `d-none d-lg-block d-xl-none` |
| 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
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

The print and display classes can be combined.

{% example html %}
<div class="d-print-none">Screen Only (hide on print)</div>
Copy link
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


{% 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
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

{% 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
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
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
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