A javascript library to convert weather-types to SVG icons.
import WeatherType from 'weather-type';
import {draw} from 'weather-type-icons';
const weatherOption = WeatherType.fromString('storm');
weatherOption.map(weatherType => draw(weatherType, '#body');
Further example outputs can be found here.
npm install weather-type-icons --save
Appends an SVG element to an element in the HTML document mathcing the provided CSS selector. The SVG is a pictorial representation of the WeatherType.
The generated SVG has default fill colours set for each component. However, these can be overridden by adding CSS 'fill' rules to the following CSS selectors:
Selector | Default fill
|
Component description |
---|---|---|
.cloud |
Any cloud | |
.cloud.light |
lightgrey |
Light clouds |
.cloud.heavy |
grey |
Heavy clouds |
.raindrop |
dodgerblue |
Raindrops |
.hail |
white |
Hail stones |
.snowflake |
white |
Snowflakes |
.lightning |
gold |
Lightning bolt |
.sun |
gold |
Sun |
.icon-text |
grey |
Text for Mist & Fog |