Skip to content
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

Closed
wants to merge 19 commits into from
Closed

CSS Unit Refactoring #761

wants to merge 19 commits into from

Conversation

Schahen
Copy link
Collaborator

@Schahen Schahen commented Jun 7, 2021

This is part one of what's needed to move forward with two (related but different) tasks:

  1. get rid of CSSOM polyfill - in particular no more polyfills for any CSSUnitValue-like types
  2. introduce proper airthmetic operations on css units.

@Schahen Schahen requested review from Skolotsky and eymar June 7, 2021 09:57
@@ -7,18 +7,18 @@ object AppCSSVariables : CSSVariables {
val wtColorGreyLight by variable<Color>()
val wtColorGreyDark by variable<Color>()

val wtOffsetTopUnit by variable<CSSSizeValue>()
Copy link
Member

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.

Copy link
Collaborator Author

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
Copy link
Member

@eymar eymar Jun 7, 2021

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>()

Copy link
Collaborator Author

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!

@Schahen Schahen requested a review from eymar June 7, 2021 11:28
@Schahen
Copy link
Collaborator Author

Schahen commented Jul 2, 2021

I promise, I promise, I will use the green button!

@Schahen Schahen closed this Jul 2, 2021
@olonho olonho deleted the CSS_UNIT_REFACTORING branch January 13, 2022 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants