# Add per-user CSS in a plugin?

**URL:** https://meta.discourse.org/t/add-per-user-css-in-a-plugin/377962
**Category:** Development
**Created:** [August 9, 2025, 4:42am UTC](https://meta.discourse.org/t/add-per-user-css-in-a-plugin/377962 "2025-08-09T04:42:15Z")
**Posts on this page:** 1
**Showing post:** 6

<div class="post-metadata">

### Author: ![keegan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/keegan/32/383395_2.png) [@keegan](https://meta.discourse.org/u/keegan)
#### Post date: [August 11, 2025, 11:20pm UTC](https://meta.discourse.org/t/add-per-user-css-in-a-plugin/377962/6 "2025-08-11T23:20:27Z")

</div>

You can probably achieve this in a plugin by doing something along the lines of:

- with the plugin API add a [`api.addSaveableUserOptionField("composer-custom-font")`](https://github.com/discourse/discourse/blob/3ab8e66c00cfd89890cf57275ff1777f85ec2c86/app/assets/javascripts/discourse/app/lib/plugin-api.gjs#L2318-L2320)
- add the field to the `UserOption` table in the db and the serializer so it can be set
- add a connector to the user’s interface page so the setting can be set
- you can make the setting a dropdown, for example, so if the user picks a certain font/font style it adds their preference in the db
- you can extend the composer code to take into account their selected preference, and either change the styles directly with JS or make it add a CSS class based on the preference chosen, which you can apply styles via CSS for that specific class

---

_[View the full topic](https://meta.discourse.org/t/add-per-user-css-in-a-plugin/377962)._
