Skip to content

Commit

Permalink
Merge pull request #261 from ember-learn/hide-on-mobile
Browse files Browse the repository at this point in the history
Hide on mobile css helper
  • Loading branch information
MelSumner authored Jan 9, 2020
2 parents 39bfd44 + ecd257f commit 135eded
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 14 deletions.
Empty file removed addon/styles/helpers.css
Empty file.
6 changes: 6 additions & 0 deletions addon/styles/helpers/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,9 @@
.max-width {
max-width: 100%;
}

@media (max-width: 1007px) {
.hide-on-mobile {
display: none;
}
}
38 changes: 24 additions & 14 deletions docs/css/helpers.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,15 @@ In order to apply the spacing scale on pages, a set of predefined helper classes
</tr>
</thead>
<tbody>
{{#each
{{#each
(array
(hash value='' name='all')
(hash value='x' name="horizontal")
(hash value='y' name="vertical")
(hash value='t' name="top")
(hash value='' name='all')
(hash value='x' name="horizontal")
(hash value='y' name="vertical")
(hash value='t' name="top")
(hash value='r' name="right")
(hash value='b' name="bottom")
(hash value='l' name="left")
(hash value='b' name="bottom")
(hash value='l' name="left")
) as |direction|
}}
{{#each (array '0' '1' '2' '3' '4' '5') as |size|}}
Expand Down Expand Up @@ -117,15 +117,15 @@ In order to apply the spacing scale on pages, a set of predefined helper classes
</tr>
</thead>
<tbody>
{{#each
{{#each
(array
(hash value='' name='all')
(hash value='x' name="horizontal")
(hash value='y' name="vertical")
(hash value='t' name="top")
(hash value='' name='all')
(hash value='x' name="horizontal")
(hash value='y' name="vertical")
(hash value='t' name="top")
(hash value='r' name="right")
(hash value='b' name="bottom")
(hash value='l' name="left")
(hash value='b' name="bottom")
(hash value='l' name="left")
) as |direction|
}}
{{#each (array '0' '1' '2' '3' '4' '5') as |size|}}
Expand Down Expand Up @@ -160,3 +160,13 @@ In order to apply the spacing scale on pages, a set of predefined helper classes
<!-- /code from YouTube -->
</div>
```

### Hide elements on mobile

If you would like to hide any element only on mobile screens you can use the `.hide-on-mobile` class helper.

```html
<h1 class="hide-on-mobile">A secret message for desktop users: ♥️</h1>

<p>If you can see the secret message above try resizing the window!</p>
```

0 comments on commit 135eded

Please sign in to comment.