-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CSS Unit Refactoring #761
CSS Unit Refactoring #761
Conversation
…lue, CSSResolutionValue, CSSFlexValue are marker interfaces
I'm not sure we need them though at all
@@ -7,18 +7,18 @@ object AppCSSVariables : CSSVariables { | |||
val wtColorGreyLight by variable<Color>() | |||
val wtColorGreyDark by variable<Color>() | |||
|
|||
val wtOffsetTopUnit by variable<CSSSizeValue>() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change leads to breaking the web_landing example if it's built using published artifact, doesn't it?
I don't think it's critical. Anyway it will need to get updated very soon after release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's safe enough to swap names for CSSUnit and CSSSize -> in that case anything won't change in that aspect.
Will try after all comments on this PR will be collected )
@@ -87,7 +87,7 @@ interface CSSNumberish { | |||
} | |||
|
|||
fun CSSNumberish.asNumber() = this.asDynamic() as? Number | |||
fun CSSNumberish.asCSSNumericValue(): CSSNumericValue? = this.asDynamic() as? CSSNumericValueJS | |||
fun CSSNumberish.asCSSNumericValue(): CSSNumericValue? = this.asDynamic() as? CSSNumericValue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm asking this without having a broader context in mind, but I'm just curious if it can be not nullable?
fun CSSNumberish.asCSSNumericValue(): CSSNumericValue = this.asDynamic() as CSSNumericValue
or
fun CSSNumberish.asCSSNumericValue(): CSSNumericValue = this.asDynamic().unsafeCast<CSSNumericValue>()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really see no reason why it can not so let me check!
web/core/src/jsMain/kotlin/androidx/compose/web/css/CSSUnits.kt
Outdated
Show resolved
Hide resolved
I promise, I promise, I will use the green button! |
This is part one of what's needed to move forward with two (related but different) tasks: