Small fixes

This commit is contained in:
2021-05-03 16:37:26 +02:00
parent 166f6d4a1c
commit a4331c0a98
3 changed files with 15 additions and 27 deletions

View File

@@ -1,10 +1,10 @@
plugins { plugins {
kotlin("multiplatform") version "1.4.31" kotlin("multiplatform") version "1.4.32"
`maven-publish` `maven-publish`
} }
group = "nl.astraeus" group = "nl.astraeus"
version = "0.4.15" version = "0.4.17"
repositories { repositories {
maven { setUrl("https://dl.bintray.com/kotlin/kotlin-eap") } maven { setUrl("https://dl.bintray.com/kotlin/kotlin-eap") }
@@ -26,9 +26,7 @@ kotlin {
} }
sourceSets { sourceSets {
val commonMain by getting { val commonMain by getting {}
}
val commonTest by getting { val commonTest by getting {
dependencies { dependencies {
implementation(kotlin("test-common")) implementation(kotlin("test-common"))
@@ -83,4 +81,3 @@ publishing {
} }
*/ */
} }

View File

@@ -236,7 +236,6 @@ fun attrEntriesContain(name: DescriptionProvider, value: String) : DescriptionPr
fun attrEndsWith(name: DescriptionProvider, value: String) : DescriptionProvider = ValueDescriptionProvider("[${name.description()}$=$value]") fun attrEndsWith(name: DescriptionProvider, value: String) : DescriptionProvider = ValueDescriptionProvider("[${name.description()}$=$value]")
fun attrStartsWith(name: DescriptionProvider, value: String) : DescriptionProvider = ValueDescriptionProvider("[${name.description()}^=$value]") fun attrStartsWith(name: DescriptionProvider, value: String) : DescriptionProvider = ValueDescriptionProvider("[${name.description()}^=$value]")
@CssTagMarker @CssTagMarker
open class Style : CssGenerator() { open class Style : CssGenerator() {
var fontFace: FontFace? = null var fontFace: FontFace? = null
@@ -266,7 +265,7 @@ open class Style : CssGenerator() {
} }
/** /**
* like the sccs & * like the scss &
* @param selector blabla * @param selector blabla
*/ */
fun and(selector: DescriptionProvider, style: Css) { fun and(selector: DescriptionProvider, style: Css) {
@@ -439,6 +438,8 @@ open class Style : CssGenerator() {
fun borderTopStyle(style: BorderStyle) { props["border-top-style"] = prp(style) } fun borderTopStyle(style: BorderStyle) { props["border-top-style"] = prp(style) }
fun borderTopWidth(width: BorderWidth) { props["border-top-width"] = prp(width) } fun borderTopWidth(width: BorderWidth) { props["border-top-width"] = prp(width) }
fun borderTopWidth(width: Measurement) { props["border-top-width"] = prp(width) } fun borderTopWidth(width: Measurement) { props["border-top-width"] = prp(width) }
fun borderWidth(width: Measurement) { props["border-width"] = prp(width) }
fun borderWidth(width: BorderWidth) { props["border-width"] = prp(width) }
fun bottom(measurement: Measurement) { props["bottom"] = prp(measurement) } fun bottom(measurement: Measurement) { props["bottom"] = prp(measurement) }
fun boxDecorationBreak(brk: BoxDecorationBreak) { props["box-decoration-break"] = prp(brk) } fun boxDecorationBreak(brk: BoxDecorationBreak) { props["box-decoration-break"] = prp(brk) }
fun boxShadow(shadow: BoxShadow) { props["box-shadow"] = prp(shadow) } fun boxShadow(shadow: BoxShadow) { props["box-shadow"] = prp(shadow) }
@@ -452,13 +453,6 @@ open class Style : CssGenerator() {
fun clip(clip: Clip) { props["clip"] = prp(clip) } fun clip(clip: Clip) { props["clip"] = prp(clip) }
fun clipPath(path: ClipPath) { props["clip-path"] = prp(path) } fun clipPath(path: ClipPath) { props["clip-path"] = prp(path) }
fun color(color: Color) { props["color"] = listOf(color) } fun color(color: Color) { props["color"] = listOf(color) }
var color: Color? = null
set(value) {
field = value
value?.let {
props["color"] = listOf(it)
}
}
fun columnCount(count: Count) { props["column-count"] = prp(count) } fun columnCount(count: Count) { props["column-count"] = prp(count) }
fun columnFill(fill: Fill) { props["column-fill"] = prp(fill) } fun columnFill(fill: Fill) { props["column-fill"] = prp(fill) }
fun columnGap(gap: Measurement) { props["column-gap"] = prp(gap) } fun columnGap(gap: Measurement) { props["column-gap"] = prp(gap) }
@@ -588,8 +582,8 @@ open class Style : CssGenerator() {
fun overflowX(overflow: Overflow) { props["overflow-x"] = prp(overflow) } fun overflowX(overflow: Overflow) { props["overflow-x"] = prp(overflow) }
fun overflowY(overflow: Overflow) { props["overflow-y"] = prp(overflow) } fun overflowY(overflow: Overflow) { props["overflow-y"] = prp(overflow) }
fun padding(padding: Measurement) { props["padding"] = prp(padding) } fun padding(padding: Measurement) { props["padding"] = prp(padding) }
fun padding(topLeft: Measurement, bottomRight: Measurement) { fun padding(vertical: Measurement, horizontal: Measurement) {
props["padding"] = prp(topLeft, bottomRight) props["padding"] = prp(vertical, horizontal)
} }
fun padding(top: Measurement, right: Measurement, bottom: Measurement, left: Measurement) { fun padding(top: Measurement, right: Measurement, bottom: Measurement, left: Measurement) {
props["padding"] = prp(top, right, bottom, left) props["padding"] = prp(top, right, bottom, left)
@@ -658,7 +652,6 @@ open class Style : CssGenerator() {
fun writingMode(writingMode: WritingMode) { props["writing-mode"] = prp(writingMode) } fun writingMode(writingMode: WritingMode) { props["writing-mode"] = prp(writingMode) }
fun zIndex(zIndex: Int) { props["z-index"] = prp(zIndex.toString()) } fun zIndex(zIndex: Int) { props["z-index"] = prp(zIndex.toString()) }
fun zIndex(zIndex: ZIndex) { props["z-index"] = prp(zIndex) } fun zIndex(zIndex: ZIndex) { props["z-index"] = prp(zIndex) }
} }
@CssTagMarker @CssTagMarker
@@ -673,5 +666,4 @@ open class ConditionalStyle : Style() {
fun supports(query: String, style: ConditionalCss) { fun supports(query: String, style: ConditionalCss) {
supports[query] = style supports[query] = style
} }
} }

View File

@@ -74,7 +74,6 @@ class TestCssBuilder {
val css2 = style { val css2 = style {
select(id("my-label")) { select(id("my-label")) {
color(Color.antiqueWhite) color(Color.antiqueWhite)
color = Color.antiqueWhite
} }
select(cls("my-label")) { select(cls("my-label")) {
@@ -91,12 +90,12 @@ class TestCssBuilder {
nthChild(2) { nthChild(2) {
} }
*/
// not(bla) { // not(bla) {
not("bla") { not(cls("bla")) {
color(Color.blue)
} }
*/
} }