Skip to content

Conversation

mohitfrontenddev
Copy link

Description

Reduce the amount of range units in animation ui #5253
image

This PR reduces the allowed CSS units in RANGE_UNITS to only ["px", "em", "rem", "vw", "vh"] to simplify the UI and improve UX.

Steps for reproduction

  1. Go to the animation panel.
  2. Try selecting units in range fields.
  3. Only %, px, em, rem, vw, vh should appear.

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: 0000)
  • updated test cases document
  • added tests
  • if any new env variables are added, added them to .env file

// consider % as unit
percentage: ["%"],
...data.units,
length: ["%", "px", "em", "rem", "vw", "vh"],
Copy link
Member

Choose a reason for hiding this comment

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

The issue is specifically about range units. This change will prevent using modern units in all style properties.

"lvmax",
"dvmax",
] as const;
export const RANGE_UNITS = ["%", "px", "em", "rem", "vw", "vh"] as const;
Copy link
Member

Choose a reason for hiding this comment

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

Maybe leave only % and px

Copy link
Author

Choose a reason for hiding this comment

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

I have updated the branch as per your feedback (limited RANGE_UNITS to % and px). Please review.

@mohitfrontenddev mohitfrontenddev changed the title Reduce range units fix: Reduce range units Jun 27, 2025
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