File tree 2 files changed +10
-10
lines changed
2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change 7
7
8
8
public struct Media : Rule {
9
9
10
- public enum Query : String {
10
+ public enum Screen : String {
11
11
/// 0-599px
12
12
case xs = " screen and (max-width: 599px) "
13
13
/// 600-899px
@@ -20,7 +20,7 @@ public struct Media: Rule {
20
20
case xl = " screen and (min-width: 1800px) "
21
21
/// dark mode
22
22
case dark = " screen and (prefers-color-scheme: dark) "
23
- /// standalone app
23
+ /// standalone app screen
24
24
case standalone = " screen and (display-mode: standalone) "
25
25
}
26
26
@@ -32,8 +32,8 @@ public struct Media: Rule {
32
32
self . selectors = builder ( )
33
33
}
34
34
35
- public init ( _ query : Query , @SelectorBuilder _ builder: ( ) -> [ Selector ] ) {
36
- self . init ( query . rawValue, builder)
35
+ public init ( screen : Screen , @SelectorBuilder _ builder: ( ) -> [ Selector ] ) {
36
+ self . init ( screen . rawValue, builder)
37
37
}
38
38
39
39
public var css : String {
Original file line number Diff line number Diff line change @@ -116,17 +116,17 @@ final class SwiftCssTests: XCTestCase {
116
116
Width ( " var(--size) " )
117
117
}
118
118
}
119
- Media ( . xs) {
119
+ Media ( screen : . xs) {
120
120
Root {
121
121
Variable ( " size " , " 200px " )
122
122
}
123
123
}
124
- Media ( . dark) {
124
+ Media ( screen : . dark) {
125
125
Root {
126
126
Variable ( " size " , " 500px " )
127
127
}
128
128
}
129
- Media ( . standalone) {
129
+ Media ( screen : . standalone) {
130
130
Root {
131
131
Variable ( " size " , " 460px " )
132
132
}
@@ -145,17 +145,17 @@ final class SwiftCssTests: XCTestCase {
145
145
Background ( . color( . red) )
146
146
}
147
147
}
148
- Media ( . xs) {
148
+ Media ( screen : . xs) {
149
149
Root {
150
150
Background ( . color( . blue) )
151
151
}
152
152
}
153
- Media ( . dark) {
153
+ Media ( screen : . dark) {
154
154
Root {
155
155
Background ( . color( . green) )
156
156
}
157
157
}
158
- Media ( . standalone) {
158
+ Media ( screen : . standalone) {
159
159
Body {
160
160
Background ( . color( . yellow) )
161
161
}
You can’t perform that action at this time.
0 commit comments