Provide configuration options to style a layer based on an attribute or (even better) a set of attributes.
There may be distinct considerations to make this work for different data types (ie Esri feature service vs geojson).
Leaflet tutorial with examples