Skip to content

[upstream #16486] Validate the switch width and height as a pair #201

Description

@berry-13

switchWidth and switchHeight (LibreChat-AI#16486) are each validated with isLength on their own, so a definition can set a width of 0, a height at or under the track's 4px of border, or a width smaller than the height. The preset then derives a zero or negative knob (height - 4px) and a negative checked travel (width - height), and the switch stops reading as a switch.

Validate the pair in packages/data-provider/src/theme.ts (reject, or warn and drop both, when the height is not above 4px or the width is below the height), and clamp the two derived utilities in tailwind.preset.cjs with max(0px, ...) so a value that slips through cannot go negative.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: packagesreviewctl followups stateenhancementNew feature or requestreadyreviewctl followups state

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions