Browse Source

CSSRuleBuilderImpl is no more

STYLEBUILDER_SIMPLIFICATION
Shagen Ogandzhanian 3 years ago
parent
commit
590a5b636b
  1. 2
      web/core/src/jsMain/kotlin/org/jetbrains/compose/web/css/CSSBuilder.kt
  2. 5
      web/core/src/jsMain/kotlin/org/jetbrains/compose/web/css/CSSRules.kt

2
web/core/src/jsMain/kotlin/org/jetbrains/compose/web/css/CSSBuilder.kt

@ -11,7 +11,7 @@ class CSSBuilderImpl(
override val root: CSSSelector,
override val self: CSSSelector,
rulesHolder: CSSRulesHolder
) : CSSRuleBuilderImpl(), CSSBuilder, CSSRulesHolder by rulesHolder {
) : StyleBuilderImpl(), CSSBuilder, CSSRulesHolder by rulesHolder {
override fun style(selector: CSSSelector, cssRule: CSSBuilder.() -> Unit) {
val (style, rules) = buildCSS(root, selector, cssRule)
rules.forEach { add(it) }

5
web/core/src/jsMain/kotlin/org/jetbrains/compose/web/css/CSSRules.kt

@ -2,9 +2,6 @@ package org.jetbrains.compose.web.css
import org.jetbrains.compose.web.css.selectors.CSSSelector
open class CSSRuleBuilderImpl : StyleBuilderImpl()
@Suppress("EqualsOrHashCode")
interface CSSRuleDeclaration {
val header: String
@ -32,7 +29,7 @@ typealias CSSRuleDeclarationList = List<CSSRuleDeclaration>
typealias MutableCSSRuleDeclarationList = MutableList<CSSRuleDeclaration>
fun buildCSSStyleRule(cssRule: StyleBuilder.() -> Unit): StyleHolder {
val builder = CSSRuleBuilderImpl()
val builder = StyleBuilderImpl()
builder.cssRule()
return builder
}

Loading…
Cancel
Save