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

experimental: add backface-visibility property for transforms #3802

Merged
merged 9 commits into from
Aug 8, 2024

Conversation

JayaKrishnaNamburu
Copy link
Contributor

Description

Allow to add backface-visibility property in the transforms section. hidden is not possible on the backface-visibility property. Because it takes only visible or hidden as value. The other way to simulate hidden is to reset the value to visible because that's the default value for property. But i don't think it's really needed to manage this.

Steps for reproduction

  1. Click on the + icon on the transforms section.
  2. Select Backface Visibility
  3. This will add the property and show the value in the transform layer list.
  4. Click on the layer list item and you can change the property value.

Code Review

  • hi @kof, I need you to do
    • conceptual review (architecture, feature-correctness)
    • detailed review (read every line)
    • test it on preview

Before requesting a review

  • made a self-review
  • added inline comments where things may be not obvious (the "why", not "what")

Before merging

  • tested locally and on preview environment (preview dev login: 5de6)

@JayaKrishnaNamburu JayaKrishnaNamburu requested a review from kof July 27, 2024 10:35
@JayaKrishnaNamburu JayaKrishnaNamburu self-assigned this Jul 27, 2024
Copy link
Member

@kof kof left a comment

Choose a reason for hiding this comment

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

We need to think more about this

  • its a bit weird having so much custom logic for backface visibility
  • is hiding using a "hidden" as a value in all other cases? why not here as well? Or is it that the property gets removed while its hidden? in that case same question, why not here as well?
  • since we take space for select control, why not use combobox and support other values as well like we do in such cases? I think when we designed it we weren't thinking about it
  • scale shouldn't be released without the lock
  • all properties miss descriptions in tooltips
  • please hide the transforms behind a feature flag because its not ready

@kof kof changed the title feat: add backface-visibility property for transforms experimental: add backface-visibility property for transforms Jul 30, 2024
@JayaKrishnaNamburu
Copy link
Contributor Author

since we take space for select control, why not use combobox and support other values as well like we do in such cases? I think when we designed it we weren't thinking about it

backface-visibility takes only ether visible or hidden. So not sure if combobox will be a good idea to use.
https://developer.mozilla.org/en-US/docs/Web/CSS/backface-visibility#syntax
Any other value other than these two is invalid as value.

is hiding using a "hidden" as a value in all other cases? why not here as well? Or is it that the property gets removed while its hidden? in that case same question, why not here as well?

For all other cases when it is hidden like tuple or layers the toValue just don't render the property
https://github.com/webstudio-is/webstudio/blob/main/packages/css-engine/src/core/to-value.ts#L97-L110
for keyword there is no such thing yet
https://github.com/webstudio-is/webstudio/blob/main/packages/css-engine/src/core/to-value.ts#L58-L60

But some properties still set to none for hidden. But none is invalid value for the property. So, we can add hidden to keyword values too. And just don't render in that case. But, need to test so, there might be side-effects.

its a bit weird having so much custom logic for backface visibility

The actual backface-visibility is only just one file. The changes are related to showing it in the same layer stye as transforms.

@kof
Copy link
Member

kof commented Jul 31, 2024

@JayaKrishnaNamburu don't we want to support global values when possible?

@JayaKrishnaNamburu
Copy link
Contributor Author

@JayaKrishnaNamburu don't we want to support global values when possible?

Yeah true, missed it here with select 👍

JayaKrishnaNamburu added a commit that referenced this pull request Aug 5, 2024
## Description

This PR helps in returning empty strings for keyword values which are
hidden from the UI. This support is needed in #3802 backface-visibility
in transforms

## Code Review

- [ ] hi @kof, I need you to do
  - conceptual review (architecture, feature-correctness)
  - detailed review (read every line)
  - test it on preview

## Before requesting a review

- [x] made a self-review
- [x] added inline comments where things may be not obvious (the "why",
not "what")
@JayaKrishnaNamburu
Copy link
Contributor Author

backface-visibility

Copy link
Member

@kof kof left a comment

Choose a reason for hiding this comment

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

works nicely

@JayaKrishnaNamburu JayaKrishnaNamburu merged commit 62c9f9b into main Aug 8, 2024
14 checks passed
@JayaKrishnaNamburu JayaKrishnaNamburu deleted the add-backface-visibility branch August 8, 2024 06:05
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