Skip to content

Commit 135eded

Browse files
authored
Merge pull request #261 from ember-learn/hide-on-mobile
Hide on mobile css helper
2 parents 39bfd44 + ecd257f commit 135eded

File tree

3 files changed

+30
-14
lines changed

3 files changed

+30
-14
lines changed

addon/styles/helpers.css

Whitespace-only changes.

addon/styles/helpers/index.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,9 @@
1212
.max-width {
1313
max-width: 100%;
1414
}
15+
16+
@media (max-width: 1007px) {
17+
.hide-on-mobile {
18+
display: none;
19+
}
20+
}

docs/css/helpers.md

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,15 @@ In order to apply the spacing scale on pages, a set of predefined helper classes
7878
</tr>
7979
</thead>
8080
<tbody>
81-
{{#each
81+
{{#each
8282
(array
83-
(hash value='' name='all')
84-
(hash value='x' name="horizontal")
85-
(hash value='y' name="vertical")
86-
(hash value='t' name="top")
83+
(hash value='' name='all')
84+
(hash value='x' name="horizontal")
85+
(hash value='y' name="vertical")
86+
(hash value='t' name="top")
8787
(hash value='r' name="right")
88-
(hash value='b' name="bottom")
89-
(hash value='l' name="left")
88+
(hash value='b' name="bottom")
89+
(hash value='l' name="left")
9090
) as |direction|
9191
}}
9292
{{#each (array '0' '1' '2' '3' '4' '5') as |size|}}
@@ -117,15 +117,15 @@ In order to apply the spacing scale on pages, a set of predefined helper classes
117117
</tr>
118118
</thead>
119119
<tbody>
120-
{{#each
120+
{{#each
121121
(array
122-
(hash value='' name='all')
123-
(hash value='x' name="horizontal")
124-
(hash value='y' name="vertical")
125-
(hash value='t' name="top")
122+
(hash value='' name='all')
123+
(hash value='x' name="horizontal")
124+
(hash value='y' name="vertical")
125+
(hash value='t' name="top")
126126
(hash value='r' name="right")
127-
(hash value='b' name="bottom")
128-
(hash value='l' name="left")
127+
(hash value='b' name="bottom")
128+
(hash value='l' name="left")
129129
) as |direction|
130130
}}
131131
{{#each (array '0' '1' '2' '3' '4' '5') as |size|}}
@@ -160,3 +160,13 @@ In order to apply the spacing scale on pages, a set of predefined helper classes
160160
<!-- /code from YouTube -->
161161
</div>
162162
```
163+
164+
### Hide elements on mobile
165+
166+
If you would like to hide any element only on mobile screens you can use the `.hide-on-mobile` class helper.
167+
168+
```html
169+
<h1 class="hide-on-mobile">A secret message for desktop users: ♥️</h1>
170+
171+
<p>If you can see the secret message above try resizing the window!</p>
172+
```

0 commit comments

Comments
 (0)