Replies: 2 comments
-
@jetwiwo <sl-copy-button class='copy' data-text='some text' value='this text will be copied' /> .copy {
height: 3em;
width: 100%;
position: relative;
&:before {
content: attr(data-text);
position: absolute;
left: 50%;
top: 50%;
translate: -50% -50%;
}
&::part(button) {
position: absolute;
inset: 0;
}
} Edit: Alternative to explicitly settings width / height is to use the display to inline-grid or set min-width/height style attributes as needed. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the suggestion. It will be trivial to disable the tooltip, e.g. we could add a |
Beta Was this translation helpful? Give feedback.
-
My site has a number of copy buttons to copy different things next to each other. An icon is not sufficient to communicate the purpose of the button. I'd like to see a text slot added which is displayed alongside the icon.
My site also doesn't use tooltips so I'd like the option to disable it on this particular button.
Beta Was this translation helpful? Give feedback.
All reactions