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

feat: Allow CSS units in viewerHeight option #140

Merged
merged 1 commit into from
Jun 14, 2024
Merged

Conversation

gadenbuie
Copy link
Contributor

Adds a utility function, asCssLengthUnit(), that promotes numbers to pixels or otherwise passes through a string value. This enables viewerHeight: 300300px as in the current behavior or viewerHeight: 300px (or any other CSS unit).

@wch wch merged commit c503453 into main Jun 14, 2024
2 checks passed
@wch wch deleted the feat/viewerheight-css branch June 14, 2024 18:12
Comment on lines +10 to +12
if (typeof value !== "number") {
return undefined;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

When would it get here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, it'd have to be a value that makes it past the type checker. Happy to take this out if its unnecessary.

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.

viewerHeight should take any CSS unit
2 participants