@@ -51,8 +51,6 @@ module Css.Media
51
51
, maxMonochrome
52
52
, maxResolution
53
53
, maxWidth
54
- , media
55
- , mediaQuery
56
54
, minAspectRatio
57
55
, minColor
58
56
, minColorIndex
@@ -100,7 +98,7 @@ module Css.Media
100
98
101
99
# `@media` rule constructors
102
100
103
- @docs media, withMedia, mediaQuery , withMediaQuery
101
+ @docs withMedia, withMediaQuery
104
102
105
103
106
104
# Query constructors
@@ -147,8 +145,8 @@ module Css.Media
147
145
148
146
-}
149
147
150
- import Css
151
- import Css.Preprocess as Preprocess exposing (Style , unwrapSnippet )
148
+ import Css exposing ( Style )
149
+ import Css.Preprocess as Preprocess exposing (unwrapSnippet )
152
150
import Css.Structure as Structure exposing (..)
153
151
154
152
@@ -209,94 +207,6 @@ type alias Value compatible =
209
207
{- -Rule constructors--}
210
208
211
209
212
- {- | Combines media queries into a `@media` rule.
213
-
214
- (stylesheet << namespace "homepage")
215
- [ media [ only screen [ Media.minWidth (px 300) ] ]
216
- [ footer [ Css.maxWidth (px 300) ] ]
217
- ]
218
-
219
- The above code translates into the following CSS.
220
-
221
- ```css
222
- @media screen and (min-width: 300px) {
223
- footer {
224
- max-width: 300px;
225
- }
226
- }
227
- ```
228
-
229
- -}
230
- media :
231
- List MediaQuery
232
- -> List Css . Snippet
233
- -> Css . Snippet
234
- media queries snippets =
235
- let
236
- snippetDeclarations : List Preprocess . SnippetDeclaration
237
- snippetDeclarations =
238
- List . concatMap unwrapSnippet snippets
239
-
240
- extractStyleBlocks : List Preprocess . SnippetDeclaration -> List Preprocess . StyleBlock
241
- extractStyleBlocks declarations =
242
- case declarations of
243
- [] ->
244
- []
245
-
246
- ( Preprocess . StyleBlockDeclaration styleBlock) :: rest ->
247
- styleBlock :: extractStyleBlocks rest
248
-
249
- first :: rest ->
250
- extractStyleBlocks rest
251
-
252
- mediaRuleFromStyleBlocks : Preprocess . SnippetDeclaration
253
- mediaRuleFromStyleBlocks =
254
- Preprocess . MediaRule queries
255
- ( extractStyleBlocks snippetDeclarations)
256
-
257
- nestedMediaRules : List Preprocess . SnippetDeclaration -> List Preprocess . SnippetDeclaration
258
- nestedMediaRules declarations =
259
- case declarations of
260
- [] ->
261
- []
262
-
263
- ( Preprocess . StyleBlockDeclaration _) :: rest ->
264
- -- These will already have been handled previously, with appropriate
265
- -- bundling, so don't create duplicates here.
266
- nestedMediaRules rest
267
-
268
- ( Preprocess . MediaRule nestedMediaQueries styleBlocks) :: rest ->
269
- -- nest the media queries
270
- Preprocess . MediaRule ( List . append queries nestedMediaQueries) styleBlocks
271
- :: nestedMediaRules rest
272
-
273
- first :: rest ->
274
- first :: nestedMediaRules rest
275
- in
276
- Preprocess . Snippet ( mediaRuleFromStyleBlocks :: nestedMediaRules snippetDeclarations)
277
-
278
-
279
- {- | Manually specify a `@media` rule using a List of strings.
280
-
281
- mediaQuery [ "screen and (min-width: 320px)", "screen and (max-height: 400px)" ]
282
- [ body [ fontSize (px 14)] ]
283
-
284
- The above code translates into the following CSS.
285
-
286
- ```css
287
- @media screen and (min-width: 320px), screen and (max-height: 400px) {
288
- body {
289
- font-size: 14px;
290
- }
291
- }
292
- ```
293
-
294
- -}
295
- mediaQuery : List String -> List Css .Snippet -> Css .Snippet
296
- mediaQuery stringQueries snippets =
297
- media ( List . map Structure . CustomQuery stringQueries) snippets
298
-
299
-
300
210
{- | Combines media queries that are nested under selectors into a `@media` rule.
301
211
302
212
(stylesheet << namespace "homepage")
@@ -316,7 +226,7 @@ The above code translates into the following CSS.
316
226
```
317
227
318
228
-}
319
- withMedia : List MediaQuery -> List Css . Style -> Css . Style
229
+ withMedia : List MediaQuery -> List Style -> Style
320
230
withMedia queries =
321
231
Preprocess . WithMedia queries
322
232
@@ -340,7 +250,7 @@ The above code translates into the following CSS.
340
250
```
341
251
342
252
-}
343
- withMediaQuery : List String -> List Css . Style -> Css . Style
253
+ withMediaQuery : List String -> List Style -> Style
344
254
withMediaQuery queries =
345
255
queries
346
256
|> List . map Structure . CustomQuery
0 commit comments