+
Skip to content

jackd248/weather-iconic

Repository files navigation

Icon

Weather Iconic

npm version npm downloads npm total downloads License: CC BY-SA 3.0 minified size

A minimal multi-color weather icon set containing 100 icons offered in multiple integration options.

✨Features

  • 100 minimal weather icons
  • Multi-color support for enhanced visual communication
  • TypeScript support with auto-completion
  • Tree-shaking for optimal bundle sizes
  • Accessibility features (ARIA labels)
  • Customizable props (size, color, className)
  • SVG sprites for performance optimization
  • Webfont generation (WOFF2, WOFF, TTF, EOT)
  • PNG exports in multiple sizes (16px to 128px) with retina support

Note

Originally made for the weather app temps.

🪄 Icons

All 100 weather icons with exemplary multi-color visual previews:

Tip

Search for specific icons within the landing page: https://jackd248.github.io/weather-iconic/

Note

Icons are also available in single-color versions in the same packages.

barometer
barometer
celsius
celsius
cloud-alt
cloud-alt
cloud-down
cloud-down
cloud-fog
cloud-fog
cloud-hail
cloud-hail
cloud-haze
cloud-haze
cloud-rain-alt
cloud-rain-alt
cloud-rain
cloud-rain
cloud-sleet
cloud-sleet
cloud-smog
cloud-smog
cloud-snow-alt
cloud-snow-alt
cloud-snow
cloud-snow
cloud-up
cloud-up
cloud-wind
cloud-wind
cloud
cloud
clouds-alt
clouds-alt
clouds
clouds
compass-east
compass-east
compass-north-east
compass-north-east
compass-north-west
compass-north-west
compass-north
compass-north
compass-south-east
compass-south-east
compass-south-west
compass-south-west
compass-south
compass-south
compass-west
compass-west
date
date
earthquake
earthquake
fahrenheit
fahrenheit
fire
fire
flood
flood
fog
fog
humidity
humidity
hurricane
hurricane
info
info
lightning
lightning
moon-cloud-fog
moon-cloud-fog
moon-cloud-hail
moon-cloud-hail
moon-cloud-haze
moon-cloud-haze
moon-cloud-lightning
moon-cloud-lightning
moon-cloud-rain-alt
moon-cloud-rain-alt
moon-cloud-rain
moon-cloud-rain
moon-cloud-sleet
moon-cloud-sleet
moon-cloud-snow-alt
moon-cloud-snow-alt
moon-cloud-snow
moon-cloud-snow
moon-cloud-wind
moon-cloud-wind
moon-cloud
moon-cloud
moon-first-quarter
moon-first-quarter
moon-fog
moon-fog
moon-fullmoon
moon-fullmoon
moon-last-quarter
moon-last-quarter
moon-newmoon
moon-newmoon
moon-waning-crescent
moon-waning-crescent
moon-waning-gibbous
moon-waning-gibbous
moon-waxing-crescent
moon-waxing-crescent
moon-waxing-gibbous
moon-waxing-gibbous
moon
moon
moonrise
moonrise
moonset
moonset
na
na
pollen
pollen
rainbow
rainbow
raindrop
raindrop
refresh
refresh
sandstorm
sandstorm
shooting-star
shooting-star
snowflake
snowflake
star
star
stars
stars
sun-cloud-fog
sun-cloud-fog
sun-cloud-hail
sun-cloud-hail
sun-cloud-haze
sun-cloud-haze
sun-cloud-lightning
sun-cloud-lightning
sun-cloud-rain-alt
sun-cloud-rain-alt
sun-cloud-rain
sun-cloud-rain
sun-cloud-sleet
sun-cloud-sleet
sun-cloud-snow-alt
sun-cloud-snow-alt
sun-cloud-snow
sun-cloud-snow
sun-cloud-wind
sun-cloud-wind
sun-cloud
sun-cloud
sun-eclipse
sun-eclipse
sun-fog
sun-fog
sun-high
sun-high
sun-low
sun-low
sun-medium
sun-medium
sun
sun
sunrise
sunrise
sunset
sunset
thermometer-cold
thermometer-cold
thermometer-freeze
thermometer-freeze
thermometer-heat
thermometer-heat
thermometer-hot
thermometer-hot
thermometer-medium
thermometer-medium
time
time
tornado
tornado
umbrella
umbrella
warning
warning
wind-high
wind-high
wind
wind
windsock
windsock

🔥 Installation

npm install weather-iconic

⚡ Usage

Webfonts

Webfont Usage Webfont Usage

<!-- Include the CSS -->
<link rel="stylesheet" href="node_modules/weather-iconic/dist/weather-iconic.css">

<!-- Use icons with proper classes -->
<i class="weather weather-sun"></i>
<i class="weather weather-cloud-rain weather-icon--lg"></i>

Tip

See the CodePen example for more details.

SVG Sprites

Sprite Usage Sprite Usage

<!-- Use sprite icons directly -->
<svg width="32" height="32">
  <use xlink:href="/path/to/sprites.svg#weather-sun"></use>
</svg>
<svg width="32" height="32">
  <use xlink:href="/path/to/sprites.svg#weather-moon"></use>
</svg>

🌈 Multi-Color Support

Weather Iconic supports multi-color icons for enhanced visual communication. Many weather icons contain multiple elements (e.g., thermometer mercury + body, sun + cloud) that can be styled with different colors.

Tip

Color Philosophy: The primary color (--weather-primary-fill) is used for highlight elements like lightning bolts, sun rays, or thermometer mercury. The secondary color (--weather-secondary-fill) serves as the base color for clouds, thermometer bodies, and single-element icons. This creates a natural visual hierarchy where important elements stand out.

CSS Multi-Color

CSS Multi-Color

<!-- Include enhanced CSS for multi-color support -->
<link rel="stylesheet" href="node_modules/weather-iconic/dist/weather-iconic-enhanced.css">
/* Basic multi-color usage with CSS custom properties */
.weather-multi-color {
  --weather-primary-fill: #80BBB2;   /* Highlight color (lightning, sun rays, mercury) */
  --weather-secondary-fill: #666666; /* Base color (clouds, bodies, single elements) */
}

HTML Usage

<!-- Multi-color with CSS custom properties -->
<div class="weather-multi-color" style="--weather-primary-fill: #80BBB2; --weather-secondary-fill: #666666;">
  <svg><use xlink:href="/path/to/sprites.svg#weather-sun-cloud-lightning"></use></svg>
</div>

<!-- Multi-color with utility classes -->
<div class="weather-multi-color weather-primary-teal">
  <svg><use xlink:href="/path/to/sprites.svg#weather-sun-cloud-lightning"></use></svg>
</div>

Custom Utility Classes

/* Primary color utilities */
.weather-primary-red    { --weather-primary-fill: #dc3545; }
.weather-primary-blue   { --weather-primary-fill: #007bff; }
.weather-primary-green  { --weather-primary-fill: #28a745; }
.weather-primary-yellow { --weather-primary-fill: #ffc107; }

/* Secondary color utilities */
.weather-secondary-red    { --weather-secondary-fill: #dc3545; }
.weather-secondary-blue   { --weather-secondary-fill: #007bff; }
.weather-secondary-green  { --weather-secondary-fill: #28a745; }
.weather-secondary-yellow { --weather-secondary-fill: #ffc107; }

Dark Mode Support

/* Automatic dark mode detection */
@media (prefers-color-scheme: dark) {
  .weather-multi-color {
    --weather-secondary-fill: #cccccc;
  }
}

/* Manual dark mode toggle */
[data-theme="dark"] .weather-multi-color {
  --weather-secondary-fill: #cccccc;
}

Note

Multi-color support works with icons that have multiple paths or groups. Single-path icons will use the primary color for the entire icon.

🧑‍💻Development

Build Commands

npm run build:icons      # Process and optimize SVGs
npm run build:components # Generate React/Vue components
npm run build:sprite     # Create SVG sprite
npm run build:fonts      # Generate webfonts (WOFF2, WOFF, TTF, EOT)
npm run build:png        # Export PNG images (multiple sizes + retina)
npm run build           # Full build pipeline

Testing

# open test page
cd tests
npm install
open index.html

Package Information

  • Bundle Sizes: SVG Sprite (~189KB), Webfonts (~100KB), JS Bundles (~14KB)
  • Total Package: ~390KB (optimized distribution without PNG assets)
  • Formats: SVG sprites, webfonts with TypeScript definitions, ES/CJS modules
  • Font Formats: WOFF2, WOFF, TTF, EOT for maximum browser support
  • Node.js: Requires Node.js >=16.0.0

⭐ License

This work is licensed under Creative Commons' Attribution-ShareAlike 3.0 United States (CC BY-SA 3.0)

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载