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

selected rounding of corners in arc #195

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

murtada58
Copy link

Allow rounding of individual corners by passing in an array instead of a number following CSS border radius conventions for which corners get rounded if array has less than 4 numbers and backwards compatible with old method of passing in a single number which will round all 4 corners

@murtada58 murtada58 changed the title feat: allow rounding of individual corners allow rounding of individual corners Mar 16, 2022
@murtada58 murtada58 changed the title allow rounding of individual corners selected rounding of corners in arc Mar 16, 2022
@Fil
Copy link
Member

Fil commented Mar 16, 2022

Nice! A detail: since the original code is coercing rc to a number, you my want to use Array.isArray to detect the new use case, and fall back to rc = +rc if not an array, so as not to introduce a breaking change for users who might be (inadvertently) calling cornerRadius("10").

This would also need documentation and an example.

@murtada58
Copy link
Author

I've updated the readme with an example now, let me know if there is anything else :)

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

Successfully merging this pull request may close these issues.

4 participants