Q:

Labelling colors on leaflet category

I want to change the color of my leaflet map. As you can see, on my blockbuilder : http://blockbuilder.org/renauld94/4a704ff30993fe35e019f3184aa31399
I have hospitals in blue and pharmacies in pink.
For my pharmacies, I have categories : 2018, Other periods, and Never Covered. I want 3 different colors for each categories.
How I can modify this?
<style>
.leaflet-marker-icon {
    color: #fff;
    font-size: 16px;
    line-height: 16px;  
    text-align: center;
    vertical-align: middle;
    box-shadow: 2px 1px 4px rgba(0,0,0,0.3);
    border-radius: 8px;
    border:1px solid #fff;
}
.search-tip b {
    color: #fff;
}
.pharmacy.search-tip b,
.pharmacy.leaflet-marker-icon {
    background: #f6f
}
.hospital.search-tip b,
.hospital.leaflet-marker-icon {
    background: #66f
}

I was trying something like:
pharmacy.type('2018').search-tip b,
.pharmacy.leaflet-marker-icon {
    background: #6cf8d5

.pharmacy(type = '2018').search-tip b,
.pharmacy.leaflet-marker-icon {
    background: #fb69fb
}

A:

You could consider to introduce and pass an additional class name per a type via pointToLayer function:
pointToLayer: function(feature, latlng) {
  return L.marker(latlng, {
    icon: L.divIcon({
      className: [feature.properties.amenity, " type" + feature.properties.type].join(' '),
      iconSize: L.point(16, 16),
      html: feature.properties.amenity[0].toUpperCase()
    })
  });
}

where
.leaflet-marker-icon.pharmacy.type2018 {
    background: #6cf8d5
}

Demo

