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

Add scaleEffect modifier #424

Merged
merged 5 commits into from
Jul 13, 2021
Merged

Add scaleEffect modifier #424

merged 5 commits into from
Jul 13, 2021

Conversation

carson-katri
Copy link
Member

This uses the scale() CSS transform in the HTML/DOM renderers.

@carson-katri carson-katri added SwiftUI compatibility Tokamak API differences with SwiftUI DOM/HTML renderer Tokamak in the browser labels Jul 9, 2021
@carson-katri carson-katri changed the base branch from main to aspect-ratio July 9, 2021 15:41
@carson-katri carson-katri force-pushed the aspect-ratio branch 3 times, most recently from 1f0c8f6 to 3e5568e Compare July 12, 2021 16:37
@carson-katri carson-katri requested a review from a team July 12, 2021 16:54

extension _ScaleEffect: DOMViewModifier {
public var attributes: [HTMLAttribute: String] {
["style": "transform: scale(\(scale.width), \(scale.height));"]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean that anchor property has no effect in the HTML renderer?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, yes. I'll add the transform-origin property.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed the rotationEffect modifier as well.

Base automatically changed from aspect-ratio to main July 12, 2021 20:59
@carson-katri carson-katri requested a review from a team July 12, 2021 22:12
Copy link
Collaborator

@MaxDesiatov MaxDesiatov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thank you!

@carson-katri carson-katri merged commit a064956 into main Jul 13, 2021
@carson-katri carson-katri deleted the scale-effect branch July 13, 2021 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DOM/HTML renderer Tokamak in the browser SwiftUI compatibility Tokamak API differences with SwiftUI
Development

Successfully merging this pull request may close these issues.

2 participants