Skip to content

Commit ed31e4d

Browse files
author
Richard Feldman
committed
Expand media query tests.
1 parent 1400cbe commit ed31e4d

File tree

1 file changed

+69
-4
lines changed

1 file changed

+69
-4
lines changed

tests/Media.elm

Lines changed: 69 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module Media exposing (..)
22

33
import Css exposing (..)
4-
import Css.Foreign exposing (Snippet, a, body, button, class, media, mediaQuery, p)
4+
import Css.Foreign exposing (Snippet, a, body, button, class, li, media, mediaQuery, p, ul)
55
import Css.Media as Media exposing (..)
66
import Css.Preprocess exposing (stylesheet)
77
import Expect
@@ -259,9 +259,25 @@ testWithMedia =
259259
[ Css.color (hex "333333")
260260
, withMedia [ only print [], Media.all [ monochrome ] ] [ Css.color (hex "000000") ]
261261
]
262+
, p
263+
[ withMedia [ only screen [] ] [ textDecoration underline ]
264+
, Css.color (hex "AA0000")
265+
]
262266
, a
263-
[ Css.color (hex "FF0000")
267+
[ withMedia [ only print [] ] [ textDecoration none ]
268+
, withMedia [ only screen [] ] [ textDecoration underline ]
269+
, Css.color (hex "BB0000")
270+
]
271+
, ul
272+
[ Css.color (hex "CC0000")
264273
, withMedia [ only print [] ] [ textDecoration none ]
274+
, withMedia [ only screen [] ] [ textDecoration underline ]
275+
]
276+
, li
277+
[ Css.color (hex "DD0000")
278+
, withMedia [ only print [] ] [ textDecoration none ]
279+
, withMedia [ only screen [] ] [ textDecoration underline ]
280+
, Css.backgroundColor (hex "EE0000")
265281
]
266282
, class Container
267283
[ Css.maxWidth (px 800)
@@ -285,10 +301,26 @@ testWithMedia =
285301
body {
286302
color:#000000;
287303
}
288-
}
304+
}
305+
306+
p {
307+
color:#AA0000;
308+
}
309+
310+
@media only screen {
311+
p {
312+
text-decoration:underline;
313+
}
314+
}
289315
290316
a {
291-
color:#FF0000;
317+
color:#BB0000;
318+
}
319+
320+
@media only screen {
321+
a {
322+
text-decoration:underline;
323+
}
292324
}
293325
294326
@media only print {
@@ -297,6 +329,39 @@ testWithMedia =
297329
}
298330
}
299331
332+
ul {
333+
color:#CC0000;
334+
}
335+
336+
@media only screen {
337+
ul {
338+
text-decoration:underline;
339+
}
340+
}
341+
342+
@media only print {
343+
ul {
344+
text-decoration:none;
345+
}
346+
}
347+
348+
li {
349+
color:#DD0000;
350+
background-color:#EE0000;
351+
}
352+
353+
@media only screen {
354+
li {
355+
text-decoration:underline;
356+
}
357+
}
358+
359+
@media only print {
360+
li {
361+
text-decoration:none;
362+
}
363+
}
364+
300365
.Container {
301366
max-width:800px;
302367
}

0 commit comments

Comments
 (0)