erikflowers / weather-icons

215 Weather Themed Icons and CSS
https://github.com/erikflowers/weather-icons
6.88k stars 849 forks source link

How to use mapping? #261

Closed alucardu closed 1 year ago

alucardu commented 1 year ago

Apologies up front for what seems like a basic question. I'm using openweathermap as my weather API and I have the following code: 804.

If I check the https://github.com/erikflowers/weather-icons/blob/master/sass/mappings/wi-owm.scss file and look for 804 I see cloudy which corresponds to the weather forecast.

But how do I implement that in my client?

Forecast: <i class="wi wi-day-sunny"></i> works but for example <i class="wi owm-804"></i> doesn't.

alucardu commented 1 year ago

I was using the wrong npm package. Appearently there are two, weathericons and weather-icons. The last one does not have the sass files.

Added this file to my project weather-icons.css, added the font folder to my project (and update the weather-icons.css path) and now I can use Forecast: <i class="wi wi-owm-804"></i>.