Does the jQuery UI Icon system have an "empty" icon - one with no image?
Asked Answered
S

4

11

Sounds like a bit of a silly question but it'd be a nice feature.

Does the jQuery UI Icon system have an "empty" icon - one with no image?

Am I forced to do some custom styling on a ui-icon-empty and move the background to an area of the sprite that is off the chart?

Sike answered 24/5, 2010 at 21:13 Comment(3)
Just a thought, why don't you make it background:none?Arbe
i think no but you can check here: jqueryui.com/themerollerAngelangela
@Kerry - I created a ui-icon-empty class that does just that, but I was thinking it'd be nice if it came by default. This is because the Button tool in 1.8 has a bug where if you null out the icon, it still has the spacing. I'd like to have it stuck at the same width to avoid that problem which is why I needed the ui-icon-empty.Sike
C
5

if you look in the css file provided by jquery ui theme you will find a class named :

ui-icon-blank

you can use the same to have blank icons.

Thanks ...

TC

Chiarra answered 11/9, 2013 at 13:36 Comment(0)
S
6

I just ended up creating a .ui-icon-empty { background:none } and calling that via the button tool:

$(selector).button({icons:{primary: 'ui-icon-empty'}})

It worked, but seems wonky. It'd be great if there was a ui-icon-empty in ui.base

Sike answered 27/5, 2010 at 16:3 Comment(1)
I needed to do this to override the .ui-icon default: .ui-icon-none.ui-icon { background-image: none; } (exactly like that, no spacing)Microfarad
C
5

if you look in the css file provided by jquery ui theme you will find a class named :

ui-icon-blank

you can use the same to have blank icons.

Thanks ...

TC

Chiarra answered 11/9, 2013 at 13:36 Comment(0)
I
1

If you are using an anchor in a list and want to remove the icon add "data-icon='false'" to your list tag to remove the icon.

<li data-icon="false">
    <a href="#">Label</a>
</li>
Independence answered 29/5, 2014 at 19:49 Comment(0)
B
0

Just use "ui-icon-blank" which is an empty icon.

Blade answered 15/5, 2024 at 17:29 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.