When working with tags on a web page, Materializecss makes it easy. However, I have a requirement where the tags need to be of different colors based on their types. Although this is feasible, another complication arises when supporting Materializecss keyboard functions.
Prior to this, I resorted to a hack by manually adding div elements with a class "chip" for tags. Now, I am using the materialize addChip function, which only accepts 'tag' and 'data' as parameters.
The challenge now is how to specify color and textcolor classes for these chips when creating them dynamically in JavaScript using:
instance.addChip({ tag: 'tag text', });
I wish there was a simple solution like:
instance.addChip({ tag: 'tag text', color: 'teal', text-color: 'white-text', });
If anyone has any insights or suggestions, please let me know!