|
| 1 | +import kotlinx.css.Align |
| 2 | +import kotlinx.css.CSSBuilder |
| 3 | +import kotlinx.css.Color |
| 4 | +import kotlinx.css.Display |
| 5 | +import kotlinx.css.FlexDirection |
| 6 | +import kotlinx.css.FlexWrap |
| 7 | +import kotlinx.css.JustifyContent |
| 8 | +import kotlinx.css.ObjectFit |
| 9 | +import kotlinx.css.alignSelf |
| 10 | +import kotlinx.css.backgroundColor |
| 11 | +import kotlinx.css.body |
| 12 | +import kotlinx.css.borderRadius |
| 13 | +import kotlinx.css.borderTopLeftRadius |
| 14 | +import kotlinx.css.borderTopRightRadius |
| 15 | +import kotlinx.css.color |
| 16 | +import kotlinx.css.display |
| 17 | +import kotlinx.css.flexDirection |
| 18 | +import kotlinx.css.flexWrap |
| 19 | +import kotlinx.css.fontFamily |
| 20 | +import kotlinx.css.fontSize |
| 21 | +import kotlinx.css.height |
| 22 | +import kotlinx.css.justifyContent |
| 23 | +import kotlinx.css.lineHeight |
| 24 | +import kotlinx.css.margin |
| 25 | +import kotlinx.css.objectFit |
| 26 | +import kotlinx.css.padding |
| 27 | +import kotlinx.css.pct |
| 28 | +import kotlinx.css.properties.boxShadow |
| 29 | +import kotlinx.css.properties.lh |
| 30 | +import kotlinx.css.px |
| 31 | +import kotlinx.css.width |
| 32 | + |
| 33 | +object Styles { |
| 34 | + |
| 35 | + val global: CSSBuilder.() -> Unit = { |
| 36 | + body { |
| 37 | + margin(0.px) |
| 38 | + padding(0.px) |
| 39 | + } |
| 40 | + } |
| 41 | + |
| 42 | + val banner: CSSBuilder.() -> Unit = { |
| 43 | + width = 100.pct |
| 44 | + height = 120.px |
| 45 | + padding(vertical = 30.px) |
| 46 | + backgroundColor = Color("#4c49eb") |
| 47 | + } |
| 48 | + |
| 49 | + val appList: CSSBuilder.() -> Unit = { |
| 50 | + display = Display.flex |
| 51 | + flexWrap = FlexWrap.wrap |
| 52 | + justifyContent = JustifyContent.center |
| 53 | + } |
| 54 | + |
| 55 | + object Card { |
| 56 | + |
| 57 | + val root: CSSBuilder.() -> Unit = { |
| 58 | + width = 200.px |
| 59 | + borderRadius = 5.px |
| 60 | + margin(vertical = 16.px, horizontal = 16.px) |
| 61 | + boxShadow( |
| 62 | + Color("#0000000d"), |
| 63 | + 0.px, |
| 64 | + 4.px, |
| 65 | + 8.px, |
| 66 | + 0.px, |
| 67 | + ) |
| 68 | + } |
| 69 | + |
| 70 | + val header: CSSBuilder.() -> Unit = { |
| 71 | + display = Display.flex |
| 72 | + flexDirection = FlexDirection.column |
| 73 | + width = 100.pct |
| 74 | + height = 100.px |
| 75 | + borderTopLeftRadius = 5.px |
| 76 | + borderTopRightRadius = 5.px |
| 77 | + backgroundColor = Color("#eaeaea") |
| 78 | + } |
| 79 | + |
| 80 | + val headerImage: CSSBuilder.() -> Unit = { |
| 81 | + alignSelf = Align.center |
| 82 | + width = 80.pct |
| 83 | + height = 100.pct |
| 84 | + objectFit = ObjectFit.scaleDown |
| 85 | + } |
| 86 | + |
| 87 | + val content: CSSBuilder.() -> Unit = { |
| 88 | + padding(vertical = 2.px, horizontal = 16.px) |
| 89 | + } |
| 90 | + |
| 91 | + val contentTitle: CSSBuilder.() -> Unit = { |
| 92 | + fontFamily = "sans-serif" |
| 93 | + fontSize = 16.px |
| 94 | + color = Color("#000000") |
| 95 | + padding(vertical = 10.px) |
| 96 | + } |
| 97 | + |
| 98 | + val contentDescription: CSSBuilder.() -> Unit = { |
| 99 | + fontFamily = "sans-serif" |
| 100 | + fontSize = 14.px |
| 101 | + color = Color("#888") |
| 102 | + lineHeight = 18.px.lh |
| 103 | + } |
| 104 | + |
| 105 | + } |
| 106 | + |
| 107 | +} |
0 commit comments