Validation changes, more properties, cleanup

This commit is contained in:
2020-02-26 19:55:10 +01:00
parent 083f234d82
commit b92b16f1b8
12 changed files with 200 additions and 89 deletions

View File

@@ -0,0 +1,36 @@
package nl.astraeus.css.properties
class Length(
value: String
): CssProperty(value) {
companion object {
fun px(nr: Int) = Length("${nr}px")
fun em(nr: Int) = Length("${nr}em")
fun em(nr: Double) = Length("${nr}em")
fun perc(nr: Int) = Length("${nr}%")
fun perc(nr: Double) = Length("${nr}%")
fun pc(nr: Int) = Length("${nr}pc")
fun pc(nr: Double) = Length("${nr}pc")
fun cm(nr: Int) = Length("${nr}cm")
fun cm(nr: Double) = Length("${nr}cm")
fun initial() = Length("initial")
fun inherit() = Length("inherit")
}
}
class ClipOrigin(
value: String
) : CssProperty(value) {
companion object {
fun borderBox() = ClipOrigin("border-box")
fun paddingBox() = ClipOrigin("padding-box")
fun contentBox() = ClipOrigin("content-box")
fun initial() = ClipOrigin("initial")
fun inherit() = ClipOrigin("inherit")
}
}