CSS Tip: Save different states of the same icon in the same file

Pro tip: when using CSS to change the state of an icon, whether a hover state or a disabled state, make sure to put all different states of the icon in the same file, then use CSS to determine what position of the file to use to display the background of the icon.

jQuery UI icons

The above doesn’t really cover what I mean, but it proves my point. The benefit of loading icons from the same file: no hiccup for when icons are loaded for different states of the icons.

Leave a Reply

Your email address will not be published. Required fields are marked *