Skip to content

@ghs-hazard-pictograms/css

Terminal window
npm install @ghs-hazard-pictograms/css

Import the sprite stylesheet once in your project entry point or global CSS file.

import '@ghs-hazard-pictograms/css/sprite.css';

Or reference it directly from a <link> tag if you are not using a bundler.

<link rel="stylesheet" href="node_modules/@ghs-hazard-pictograms/css/sprite.css" />

Add the class ghs-{code-lowercase} to any inline element to display the pictogram as a background image.

<span class="ghs-ghs01" role="img" aria-label="Explosives"></span>
<span class="ghs-ghs02" role="img" aria-label="Flammable"></span>
<span class="ghs-ghs06" role="img" aria-label="Toxic"></span>
GHS codeCSS classPictogram name
GHS01ghs-ghs01Explosives
GHS02ghs-ghs02Flammable
GHS03ghs-ghs03Oxidising
GHS04ghs-ghs04Compressed gas
GHS05ghs-ghs05Corrosive
GHS06ghs-ghs06Toxic
GHS07ghs-ghs07Harmful / Irritant
GHS08ghs-ghs08Health hazard
GHS09ghs-ghs09Environmental hazard

The CSS class is always the GHS code lowercased and prefixed with ghs-.

The stylesheet sets a default size via CSS custom properties. Override them per element or globally.

.ghs-ghs01 {
--ghs-size: 64px;
}

CSS background images are invisible to assistive technologies. Always pair each icon element with a semantic role and label.

<!-- Informative icon -->
<span class="ghs-ghs06" role="img" aria-label="Toxic — keep out of reach of children"></span>
<!-- Decorative icon (label provided by adjacent text) -->
<span class="ghs-ghs06" aria-hidden="true"></span>
<span>Toxic</span>