explaingit

erikflowers/weather-icons

7,123CSSAudience · developerComplexity · 1/5LicenseSetup · easy

TLDR

Weather Icons is a set of 222 scalable weather-themed icons packaged as a CSS icon font, with ready-made mappings for popular weather APIs like Open Weather Map and Forecast.io so you can show the right icon without writing mapping code.

Mindmap

mindmap
  root((Weather Icons))
    What it does
      222 weather icons
      Icon font format
      Scales without loss
    Tech Stack
      CSS
      Less
      Icon Font
    Use Cases
      Weather apps
      Wind direction
      API icon mapping
    API Support
      Open Weather Map
      Forecast.io
      Yahoo Weather
      WMO codes
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Add weather condition icons to a web app by including one CSS file and using class names like wi-day-sunny or wi-rain.

USE CASE 2

Display wind direction indicators on a weather dashboard by passing a degree value to the wind icon classes.

USE CASE 3

Show weather icons directly from Open Weather Map or Forecast.io API condition codes using the bundled companion CSS mapping files.

USE CASE 4

Build a weather widget without writing any icon-to-condition mapping logic by using the pre-built API companion files.

Tech stack

CSSLessHTML

Getting it running

Difficulty · easy Time to first run · 5min

Copy five font files and one minified CSS file into your project, no build step required.

Icons are under the SIL Open Font License (use freely including in commercial projects), CSS code is MIT licensed (use and modify freely for any purpose).

In plain English

Weather Icons is a collection of 222 weather-related icons packaged as an icon font with accompanying CSS files. An icon font works like a regular text font but instead of letters, each character slot contains a small graphic, which means the icons scale to any size without losing quality and can be styled using standard CSS color and size rules. Using the icons in a web project requires copying five font files and a single minified CSS file into your project folder. From there, you add an icon to any webpage by writing a short HTML tag with two class names: the base class wi and then the specific icon name, such as wi-day-sunny or wi-rain. Optional modifier classes let you flip or rotate an icon, or set it to a fixed width. A separate CSS file handles wind direction indicators. Wind icons take a degree value from 0 to 359 to point in any compass direction. Shorthand names for cardinal and intercardinal directions are also available, so you can use labels like sse or nw instead of numeric degrees. The project also includes companion CSS files that map icon names to the condition codes returned by several weather data services, including Forecast.io, Open Weather Map, the World Meteorological Organization, Weather Underground, and Yahoo Weather. If you are pulling weather data from one of those APIs, the companion file lets you display the matching icon without writing your own mapping logic. The icon designs were originally created by Lukas Bischoff. The CSS, Less files, and subsequent icon art were produced by Erik Flowers. The icons are licensed under the SIL Open Font License, the code under the MIT License, and the documentation under Creative Commons Attribution 3.0.

Copy-paste prompts

Prompt 1
I'm building a weather app with Open Weather Map API data. Show me how to use weather-icons' companion CSS file to display the right icon for each OWM condition code.
Prompt 2
I want to show a wind direction arrow on my weather dashboard using weather-icons. How do I use degree values with the wind direction icon classes?
Prompt 3
How do I install weather-icons in a web project and display a rainy day icon using the wi base class and wi-rain modifier?
Prompt 4
I'm using the Forecast.io API and want to map its condition codes to weather-icons automatically. How do I use the Forecast.io companion CSS file?
Open on GitHub → Explain another repo

← erikflowers on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.