# For newly created labels, assign a random style

**URL:** <https://meta.discourse.org/t/for-newly-created-labels-assign-a-random-style/316577>\
**Category:** Development\
**Created:** [July 16, 2024, 2:56pm UTC](https://meta.discourse.org/t/for-newly-created-labels-assign-a-random-style/316577 "2024-07-16T14:56:39Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![sheng\_hualuo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sheng_hualuo/32/430359_2.png) [@sheng\_hualuo](https://meta.discourse.org/u/sheng_hualuo)\
**Post date:** [July 16, 2024, 2:56pm UTC](https://meta.discourse.org/t/for-newly-created-labels-assign-a-random-style/316577/1 "2024-07-16T14:56:39Z")

</div>

I have created 6 css classes for tags: tag-style-1, tag-style-2, tag-style-3, tag-style-4, tag-style-5, tag-style-6. I want to randomly assign one of the above 6 classes to a new tag when I create a new tag, so that the newly created tag will have a different style. I know the tag style component is possible, but it needs to be added manually, not randomly assigned!

---

_[View the full topic](https://meta.discourse.org/t/for-newly-created-labels-assign-a-random-style/316577)._
