Skip to content

Commit

Permalink
Merge pull request #509 from sergeylukin/hide-for-large
Browse files Browse the repository at this point in the history
Fix hide-for-large in Gmail, Yahoo and Outlook 2016. Just wrap your element that you'd like to hide in a `<div>` with the `.hide-for-large` class
  • Loading branch information
tdhartwick committed Sep 14, 2016
2 parents 29acab5 + 37e5cb5 commit cf7d15a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
16 changes: 9 additions & 7 deletions docs/pages/visibility.md
Expand Up @@ -10,24 +10,26 @@ Visibility classes allow you to control what content appears on what screen size

Foundation for Emails has two breakpoints: *small*, which is any email client under 596 pixels wide, and *large*, any client over 596 pixels. This means small generally correlates to mobile clients, and large correlates to desktop clients.

Due to Outlook's lack of support for certain CSS properties, the Foundation for Emails visibility classes should be used in conjunction with conditional comments to ensure that the content is properly hidden (or shown) in Outlook 2007, 2010 and 2013.
Due to Outlook's lack of support for certain CSS properties, the Foundation for Emails visibility classes should be used in conjunction with conditional comments to ensure that the content is properly hidden (or shown) in Outlook 2007, 2010, 2013 and 2016. For instance, in order to hide an element in MS Outlook as well as in e-mail forwarded from MS Outlook, make sure to wrap that element with `<!--[if !mso]><!-->` and `<!--<![endif]-->` conditional formatting.

<div class="primary callout">
<p>If you're using a visibility class on an image, be sure to apply it to the parent element, not to the image itself.</p>
</div>

**To show content only on mobile clients,** add the class `.hide-for-large` to the element.
**To show content only on mobile clients,** add the class `.hide-for-large` to a div wrapping the element that needs to be hidden.

**To show content only on desktop clients,** add the class `.show-for-large` to the element.

```inky_example
<callout class="hide-for-large primary">
<p>This callout will only appear on small screens.</p>
</callout>
<!--[if !mso]><!-->
<div class="hide-for-large">
<callout class="primary">
<p>This callout will only appear on small screens.</p>
</callout>
</div>
<!--<![endif]-->
<callout class="show-for-large alert">
<p>This callout will only appear on large screens.</p>
</callout>
```

*note - `.hide-for-large` is not supported on Gmail and Yahoo email clients.*
2 changes: 1 addition & 1 deletion scss/components/_visibility.scss
Expand Up @@ -7,7 +7,7 @@
////

.hide-for-large {
display: none !important;
display: none;
mso-hide: all; // hide selected elements in Outlook 2007-2013
overflow: hidden;
max-height: 0;
Expand Down

0 comments on commit cf7d15a

Please sign in to comment.