This repository was archived by the owner on Nov 25, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed
Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change 77
88public struct Media : Rule {
99
10- public enum Query : String {
10+ public enum Screen : String {
1111 /// 0-599px
1212 case xs = " screen and (max-width: 599px) "
1313 /// 600-899px
@@ -20,7 +20,7 @@ public struct Media: Rule {
2020 case xl = " screen and (min-width: 1800px) "
2121 /// dark mode
2222 case dark = " screen and (prefers-color-scheme: dark) "
23- /// standalone app
23+ /// standalone app screen
2424 case standalone = " screen and (display-mode: standalone) "
2525 }
2626
@@ -32,8 +32,8 @@ public struct Media: Rule {
3232 self . selectors = builder ( )
3333 }
3434
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)
3737 }
3838
3939 public var css : String {
Original file line number Diff line number Diff line change @@ -116,17 +116,17 @@ final class SwiftCssTests: XCTestCase {
116116 Width ( " var(--size) " )
117117 }
118118 }
119- Media ( . xs) {
119+ Media ( screen : . xs) {
120120 Root {
121121 Variable ( " size " , " 200px " )
122122 }
123123 }
124- Media ( . dark) {
124+ Media ( screen : . dark) {
125125 Root {
126126 Variable ( " size " , " 500px " )
127127 }
128128 }
129- Media ( . standalone) {
129+ Media ( screen : . standalone) {
130130 Root {
131131 Variable ( " size " , " 460px " )
132132 }
@@ -145,17 +145,17 @@ final class SwiftCssTests: XCTestCase {
145145 Background ( . color( . red) )
146146 }
147147 }
148- Media ( . xs) {
148+ Media ( screen : . xs) {
149149 Root {
150150 Background ( . color( . blue) )
151151 }
152152 }
153- Media ( . dark) {
153+ Media ( screen : . dark) {
154154 Root {
155155 Background ( . color( . green) )
156156 }
157157 }
158- Media ( . standalone) {
158+ Media ( screen : . standalone) {
159159 Body {
160160 Background ( . color( . yellow) )
161161 }
You can’t perform that action at this time.
0 commit comments