klippy icon indicating copy to clipboard operation
klippy copied to clipboard

Adding a `size` parameter to `klippy()`, solving #18 and #27

Open AlexisDerumigny opened this issue 2 years ago • 1 comments

@RLesur Thanks for this very nice package! It is very useful, but the klippy button is a bit small compared to my taste (as in #18, #27) .

This PR adds a new parameter size (in pixels) to the function klippy(), allowing the user to customize the size (by changing the width) of the button. By default, this size is set to NULL and the (existing) automatic default is used instead.

In the klippy.js file, there is a function autoSize that computes the size of the klippy icon based on the left- or right-padding of the parent. This commit adjusts automatically this padding and therefore the size of the icon, from a size parameter given by the user.

AlexisDerumigny avatar Oct 06 '22 13:10 AlexisDerumigny