From a4331c0a98d811f06564c8d9bd3dadd9dd9c8fcf Mon Sep 17 00:00:00 2001 From: rnentjes Date: Mon, 3 May 2021 16:37:26 +0200 Subject: [PATCH] Small fixes --- build.gradle.kts | 9 +++------ .../kotlin/nl/astraeus/css/style/Style.kt | 18 +++++------------- .../kotlin/nl/astraeus/css/TestCssBuilder.kt | 15 +++++++-------- 3 files changed, 15 insertions(+), 27 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 85a6100..d0bb1d5 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,10 +1,10 @@ plugins { - kotlin("multiplatform") version "1.4.31" + kotlin("multiplatform") version "1.4.32" `maven-publish` } group = "nl.astraeus" -version = "0.4.15" +version = "0.4.17" repositories { maven { setUrl("https://dl.bintray.com/kotlin/kotlin-eap") } @@ -26,9 +26,7 @@ kotlin { } sourceSets { - val commonMain by getting { - - } + val commonMain by getting {} val commonTest by getting { dependencies { implementation(kotlin("test-common")) @@ -83,4 +81,3 @@ publishing { } */ } - diff --git a/src/commonMain/kotlin/nl/astraeus/css/style/Style.kt b/src/commonMain/kotlin/nl/astraeus/css/style/Style.kt index 2a4c8ab..88d723e 100644 --- a/src/commonMain/kotlin/nl/astraeus/css/style/Style.kt +++ b/src/commonMain/kotlin/nl/astraeus/css/style/Style.kt @@ -236,7 +236,6 @@ fun attrEntriesContain(name: DescriptionProvider, value: String) : DescriptionPr fun attrEndsWith(name: DescriptionProvider, value: String) : DescriptionProvider = ValueDescriptionProvider("[${name.description()}$=$value]") fun attrStartsWith(name: DescriptionProvider, value: String) : DescriptionProvider = ValueDescriptionProvider("[${name.description()}^=$value]") - @CssTagMarker open class Style : CssGenerator() { var fontFace: FontFace? = null @@ -266,7 +265,7 @@ open class Style : CssGenerator() { } /** - * like the sccs & + * like the scss & * @param selector blabla */ 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 borderTopWidth(width: BorderWidth) { 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 boxDecorationBreak(brk: BoxDecorationBreak) { props["box-decoration-break"] = prp(brk) } 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 clipPath(path: ClipPath) { props["clip-path"] = prp(path) } 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 columnFill(fill: Fill) { props["column-fill"] = prp(fill) } 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 overflowY(overflow: Overflow) { props["overflow-y"] = prp(overflow) } fun padding(padding: Measurement) { props["padding"] = prp(padding) } - fun padding(topLeft: Measurement, bottomRight: Measurement) { - props["padding"] = prp(topLeft, bottomRight) + fun padding(vertical: Measurement, horizontal: Measurement) { + props["padding"] = prp(vertical, horizontal) } fun padding(top: Measurement, right: Measurement, bottom: Measurement, left: Measurement) { 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 zIndex(zIndex: Int) { props["z-index"] = prp(zIndex.toString()) } fun zIndex(zIndex: ZIndex) { props["z-index"] = prp(zIndex) } - } @CssTagMarker @@ -673,5 +666,4 @@ open class ConditionalStyle : Style() { fun supports(query: String, style: ConditionalCss) { supports[query] = style } - } diff --git a/src/commonTest/kotlin/nl/astraeus/css/TestCssBuilder.kt b/src/commonTest/kotlin/nl/astraeus/css/TestCssBuilder.kt index bbe20bf..774f50b 100644 --- a/src/commonTest/kotlin/nl/astraeus/css/TestCssBuilder.kt +++ b/src/commonTest/kotlin/nl/astraeus/css/TestCssBuilder.kt @@ -74,7 +74,6 @@ class TestCssBuilder { val css2 = style { select(id("my-label")) { color(Color.antiqueWhite) - color = Color.antiqueWhite } select(cls("my-label")) { @@ -88,16 +87,16 @@ class TestCssBuilder { } /* - nthChild(2) { + nthChild(2) { - } - - // not(bla) { - not("bla") { - - } + } */ + // not(bla) { + not(cls("bla")) { + color(Color.blue) + } + } // table .even {}