Browse Source

Fix media type assignment (was uppercased)

FIX_MQ_INTEGRATION_TEST
Shagen Ogandzhanian 3 years ago
parent
commit
c0b382cc46
  1. 2
      web/core/src/jsMain/kotlin/androidx/compose/web/css/CSSMediaRule.kt
  2. 9
      web/core/src/jsTest/kotlin/MediaQueryTests.kt

2
web/core/src/jsMain/kotlin/androidx/compose/web/css/CSSMediaRule.kt

@ -11,7 +11,7 @@ interface CSSMediaQuery {
}
data class MediaType(val type: Enum) : Atomic {
enum class Enum {
All, Print, Screen, Speech
all, print, screen, speech
}
override fun toString() = type.name

9
web/core/src/jsTest/kotlin/MediaQueryTests.kt

@ -27,6 +27,9 @@ class MediaQueryTests {
media(minWidth(300.px), maxWidth(500.px)) {
}
media(CSSMediaQuery.MediaType(CSSMediaQuery.MediaType.Enum.screen).and(minWidth(300.px))) {
}
}
}
@ -74,6 +77,12 @@ class MediaQueryTests {
"@media (min-width: 300px), (max-width: 500px)",
(CombinedMediaQueries.cssRules[2] as CSSMediaRuleDeclaration).header
)
assertEquals(
"@media screen and (min-width: 300px)",
(CombinedMediaQueries.cssRules[3] as CSSMediaRuleDeclaration).header
)
}
}
Loading…
Cancel
Save