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

Modified Library - Background color, styling options etc. #147

Open
jmezz opened this issue Feb 24, 2023 · 0 comments
Open

Modified Library - Background color, styling options etc. #147

jmezz opened this issue Feb 24, 2023 · 0 comments

Comments

@jmezz
Copy link

jmezz commented Feb 24, 2023

Would there be any interest in a slightly modified version of this where you can provide padding/margin options to the span elements to enable you to set a background color and a border radius on the ends of your background color?

Unfortunately my math isn't good enough to figure out how to dynamically size the padding so it only works for fixed size circles as you need to manually set the padding for the circle size right now. I tried dynamic padding but couldn't get the formula right.

For the background color basically we add padding-right and overflow:hidden and then a negative left margin of half the padding value and it shifts all back to where it belongs but with your background color. padding, margins and border radius are all provided through .options() method.

I also added a default css class to the elements so you can style them and an optional argument to set your own classname, and an update method so you can change the text string on the fly with a bit of animation.

I am new to github/coding in general so I am not sure how best to submit but if anyone is interested in the "proof of concept" and wants to improve I'd be more than happy to share... just tell me how.

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

No branches or pull requests

1 participant