Commentary
Icon use is challenging . Icons generally are constrained by the social context that they are inserted into. Consider an icon that works in North America. Will this same icon mean the same thing in Europe? Will it be understood in a more graphic text script such as Arabic or Sanskrit? Will it stand out enough to be noticed in pictographic languages in Asia?
Consider the icon represented by a pictograph of a floppy disk. 2010 was the last year of production of the floppy disk after years of decline. Yet, this symbol is still in use today to represent data saving. Isn’t the human mind a curious thing?
Much research is has been done by user experience people on iconography that has become universal through long term exposure and repeated use. This is a small set of icons! When using icons, proper usability testing should be done to ensure that it will be understood and will do the job that is expected of it.
Finally, there is universal agreement by UX experts that icons should also have an associated text label. This scores the highest usability factor and transcends cultural contexts. In general, icons should be used lightly and deliberately with proper forethought. Less is better and provides better usability.
Goldilocks-CSS uses scalable vector graphics (SVG) icons in a CSS mask-image
to provide the icon as a
background and allow it to be colorized and sized when needed. Using this approach, the icons are in a cachable css file and will not be
seen by any assistive technology. Currently, 75 icons are available to cover most use cases.
Other icons from other sets can be added easily. Goldilocks-CSS primarily uses a subset of icons from Lineawesome Icons. A few icons from Feather Icons are also used. The CSS-SVG definition file is 62KB is size (not minified) for an average icon size of 827 bytes. The compressed CSS file is 14.1KB in size.
Usage
Classes: | |
---|---|
.icon-bg-* |
Provides the background svg based icon and settings for a span HTML tag.
Default settings are 1rem height and width.
The background is a "mask" that allows color settings to be applied.
The "*" is the name of the icon to be applied.
|
.icon |
Is a utility class that provides an icon area for SVG images. |
.icon-nav |
Provides a column stacked flexbox for an icon and a text label. |
.icon-nav-horz |
Provides a row direction flexbox for an icon and a text label. |
Size options: | .is-small , .is-medium , .is-large , .is-extra-large |
Text color: | Can use any text color settings. |
Dependencies: | |
---|---|
File: | icons.css |
Variables: | --size-1 sets large size, --size-2 sets medium size, --size-4 sets normal size, --size-6 sets small size. |
Examples
Background Icons
#icon-bell with sizes: .is-small, normal, .is-medium, .is-large
.is-small
.is-normal
.is-medium
.is-large
.is-extra-large
Sample HTML Code
<span class="icon-bg-bell is-small has-text-primary"></span>
<span class="icon-bg-bell"></span>
<span class="icon-bg-bell is-medium has-text-secondary"></span>
<span class="icon-bg-bell is-large has-text-tertiary"></span>
Background SVG Icon Set Based on Feather and Lineawesome Icons
Feather Source Website and Line Awesome Source Website
.icon-bg-alert-danger
.icon-bg-alert-info
.icon-bg-alert-success
.icon-bg-alert-warning
.icon-bg-archive
.icon-bg-bell
.icon-bg-bookmark
.icon-bg-book-open
.icon-bg-calendar
.icon-bg-circle-minus
.icon-bg-circle-plus
.icon-bg-circle-x
.icon-bg-clipboard-check
.icon-bg-clock
.icon-bg-cloud-download
.icon-bg-cloud-save
.icon-bg-code
.icon-bg-cog
.icon-bg-comment
.icon-bg-content
.icon-bg-credit-card
.icon-bg-crop
.icon-bg-day
.icon-bg-edit
.icon-bg-eye
.icon-bg-eye-off
.icon-bg-facebook
.icon-bg-file
.icon-bg-film
.icon-bg-filter
.icon-bg-folder
.icon-bg-github
.icon-bg-google
.icon-bg-grid
.icon-bg-group
.icon-bg-help
.icon-bg-home
.icon-bg-icons
.icon-bg-image
.icon-bg-key
.icon-bg-layout
.icon-bg-link
.icon-bg-linkedin
.icon-bg-list
.icon-bg-lock
.icon-bg-lock-open
.icon-bg-login
.icon-bg-logout
.icon-bg-logs
.icon-bg-mail
.icon-bg-map
.icon-bg-marker
.icon-bg-music
.icon-bg-newspaper
.icon-bg-night
.icon-bg-palette
.icon-bg-phone
.icon-bg-printer
.icon-bg-profile
.icon-bg-refresh
.icon-bg-save
.icon-bg-search
.icon-bg-send
.icon-bg-settings
.icon-bg-share
.icon-bg-shopping-cart
.icon-bg-slack
.icon-bg-sticky-note
.icon-bg-tag
.icon-bg-tasks
.icon-bg-trash
.icon-bg-twitter
.icon-bg-user
.icon-bg-user-plus
.icon-bg-users