.i-button-nobackground {
background: transparent;
border: none;
}
Notice the “background: transparent” there. The “none” value will probably work too, but it’s not valid CSS (if you care for such a thing).
I’ve been using quite a lot of picture-only buttons in my application.
The easiest way I’ve found of doing that is just what Marc suggested: using a Button with an icon, and setting styleName to STYLE_LINK.
The tricky part begin when you want, say, having an :hover effect on your button, or having different style depending on the state of the button (desactivated, active, …).
But, eh ! It’s doable, using a bit of CSS magic
What I’m doing is
a) setting the button.img CSS style to visible: hidden;
b) defining a background image for the button, still in CSS
c) using background-position to show different part of the image depending on the state of the button.
It’s quite complicated (and it feel like using a sledgehammer for killing an ant), but, eh, it’s the only way I’ve found to have those kind of buttons
If anyone is interested, I can post code example & usage of the code I use for that - and if anyone have a better solution, I definitely want to hear about it
[quote=QuentinAstegiano]
– and if anyone have a better solution, I definitely want to hear about it
[/quote]A better/more versatile button component for Toolkit could be a the solution
I’m not sure if there’s any ticket so far for something like this, but someone ought to do one. We need a simpler way to make icon-only-buttons with various states.
I know this is an old post but I second Jouni’s idea
Is there any current plan to add this functionality to button (and maybe other components) without having to mess around in CSS? This would be a very nice feature to have