More properties, cleanup
This commit is contained in:
@@ -72,3 +72,37 @@ class BorderCollapse(
|
||||
fun collapse() = BorderWidth("collapse")
|
||||
}
|
||||
}
|
||||
|
||||
class BorderImageWidth (
|
||||
value: String
|
||||
): CssProperty(value) {
|
||||
|
||||
companion object {
|
||||
fun px(nr: Int) = BorderRadius("${nr}px")
|
||||
fun nr(nr: Int) = Image("$nr")
|
||||
fun perc(nr: Int) = BorderRadius("${nr}%")
|
||||
fun perc(nr: Double) = BorderRadius("${nr}%")
|
||||
fun auto() = BorderWidth("auto")
|
||||
fun initial() = BorderWidth("initial")
|
||||
fun inherit() = BorderWidth("inherit")
|
||||
}
|
||||
}
|
||||
|
||||
class BorderSpacing(
|
||||
value: String
|
||||
): CssProperty(value) {
|
||||
|
||||
companion object {
|
||||
fun px(nr: Int) = BorderRadius("${nr}px")
|
||||
fun em(nr: Int) = BorderRadius("${nr}em")
|
||||
fun em(nr: Double) = BorderRadius("${nr}em")
|
||||
fun perc(nr: Int) = BorderRadius("${nr}%")
|
||||
fun perc(nr: Double) = BorderRadius("${nr}%")
|
||||
fun pc(nr: Int) = BorderRadius("${nr}pc")
|
||||
fun pc(nr: Double) = BorderRadius("${nr}pc")
|
||||
fun cm(nr: Int) = BorderRadius("${nr}cm")
|
||||
fun cm(nr: Double) = BorderRadius("${nr}cm")
|
||||
fun initial() = BorderRadius("initial")
|
||||
fun inherit() = BorderRadius("inherit")
|
||||
}
|
||||
}
|
||||
|
||||
39
src/commonMain/kotlin/nl/astraeus/css/properties/Box.kt
Normal file
39
src/commonMain/kotlin/nl/astraeus/css/properties/Box.kt
Normal file
@@ -0,0 +1,39 @@
|
||||
package nl.astraeus.css.properties
|
||||
|
||||
class BoxDecorationBreak(
|
||||
value: String
|
||||
): CssProperty(value) {
|
||||
|
||||
companion object {
|
||||
fun slice() = BorderWidth("slice")
|
||||
fun clone() = BorderWidth("clone")
|
||||
fun initial() = BorderWidth("initial")
|
||||
fun inherit() = BorderWidth("inherit")
|
||||
fun unset() = BorderWidth("unset")
|
||||
}
|
||||
}
|
||||
|
||||
class BoxShadow(
|
||||
value: String
|
||||
): CssProperty(value) {
|
||||
|
||||
companion object {
|
||||
fun none() = BoxShadow("none")
|
||||
fun text(txt: String) = BoxShadow(txt)
|
||||
fun inset() = BoxShadow("inset")
|
||||
fun initial() = BoxShadow("initial")
|
||||
fun inherit() = BoxShadow("inherit")
|
||||
}
|
||||
}
|
||||
|
||||
class BoxSizing(
|
||||
value: String
|
||||
): CssProperty(value) {
|
||||
|
||||
companion object {
|
||||
fun contextBox() = BoxSizing("content-box")
|
||||
fun borderBox() = BoxSizing("border-box")
|
||||
fun initial() = BoxShadow("initial")
|
||||
fun inherit() = BoxShadow("inherit")
|
||||
}
|
||||
}
|
||||
27
src/commonMain/kotlin/nl/astraeus/css/properties/Break.kt
Normal file
27
src/commonMain/kotlin/nl/astraeus/css/properties/Break.kt
Normal file
@@ -0,0 +1,27 @@
|
||||
package nl.astraeus.css.properties
|
||||
|
||||
|
||||
class Break(
|
||||
value: String
|
||||
): CssProperty(value) {
|
||||
|
||||
companion object {
|
||||
fun auto() = Break("auto")
|
||||
fun all() = Break("all")
|
||||
fun always() = Break("always")
|
||||
fun avoid() = Break("avoid")
|
||||
fun avoidColumn() = Break("avoid-column")
|
||||
fun avoidPage() = Break("avoid-page")
|
||||
fun avoidRegion() = Break("avoid-region")
|
||||
fun column() = Break("column")
|
||||
fun left() = Break("left")
|
||||
fun page() = Break("page")
|
||||
fun recto() = Break("recto")
|
||||
fun region() = Break("region")
|
||||
fun right() = Break("right")
|
||||
fun verso() = Break("verso")
|
||||
fun initial() = Break("initial")
|
||||
fun inherit() = Break("inherit")
|
||||
}
|
||||
|
||||
}
|
||||
14
src/commonMain/kotlin/nl/astraeus/css/properties/Caption.kt
Normal file
14
src/commonMain/kotlin/nl/astraeus/css/properties/Caption.kt
Normal file
@@ -0,0 +1,14 @@
|
||||
package nl.astraeus.css.properties
|
||||
|
||||
class CaptionSide(
|
||||
value: String
|
||||
): CssProperty(value) {
|
||||
|
||||
companion object {
|
||||
fun top() = BoxSizing("top")
|
||||
fun bottom() = BoxSizing("bottom")
|
||||
fun initial() = BoxShadow("initial")
|
||||
fun inherit() = BoxShadow("inherit")
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,6 +5,7 @@ class Color(
|
||||
) : CssProperty(value) {
|
||||
|
||||
companion object {
|
||||
fun auto() = Color("auto")
|
||||
fun transparant() = Color("transparant")
|
||||
fun initial() = Color("initial")
|
||||
fun inherit() = Color("inherit")
|
||||
|
||||
@@ -11,3 +11,48 @@ class Image(
|
||||
fun inherit() = Image("inherit")
|
||||
}
|
||||
}
|
||||
|
||||
class ImageRepeat(
|
||||
value: String
|
||||
) : CssProperty(value) {
|
||||
|
||||
companion object {
|
||||
fun stretch(url: String) = Image("stretch")
|
||||
fun repeat() = Image("repeat")
|
||||
fun round() = Image("round")
|
||||
fun initial() = Image("initial")
|
||||
fun inherit() = Image("inherit")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class ImageSlice(
|
||||
value: String
|
||||
) : CssProperty(value) {
|
||||
|
||||
companion object {
|
||||
fun nr(nr: Int) = Image("$nr")
|
||||
fun perc(perc: Int) = Image("$perc%")
|
||||
fun perc(perc: Double) = Image("$perc%")
|
||||
fun stretch(url: String) = Image("stretch")
|
||||
fun repeat() = Image("repeat")
|
||||
fun fill() = Image("fill")
|
||||
fun initial() = Image("initial")
|
||||
fun inherit() = Image("inherit")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class ImageSource(
|
||||
value: String
|
||||
) : CssProperty(value) {
|
||||
|
||||
companion object {
|
||||
fun none() = ImageSource("none")
|
||||
fun text(txt: String) = ImageSource(txt)
|
||||
fun image(url: String) = ImageSource("'$url'")
|
||||
fun initial() = ImageSource("initial")
|
||||
fun inherit() = ImageSource("inherit")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user