In a plugin, how does one add a per-user CSS? E.g. caused by a user setting?
Adding the styles and whatnot to elements/via stylesheets would be global, no?
In a plugin, how does one add a per-user CSS? E.g. caused by a user setting?
Adding the styles and whatnot to elements/via stylesheets would be global, no?
What are you trying to do? You can do things like change individual username/mention color just through the normal theme CSS. If you mean like, change some specific part of a theme with a toggle through a specific users preferences I don’t believe you could do that without giving them their own theme. I’m no expert though
Like for example, a per-user setting to change fonts of certain things (e.g. the Markdown composer).
You could offer groups that the user can join and use CSS Classes for Current User's Groups.
Or the user can use a browser plugin to change CSS only for themselves. I use Stylus to customize my experience on Meta.
Was the composer a random example? Or what do you want to offer in addition to “Use monospace font in composer’s Markdown mode,” which can be enabled or disabled in the preferences?
Kinda. I was thinking how the font would be changed per-user.
You can probably achieve this in a plugin by doing something along the lines of:
api.addSaveableUserOptionField("composer-custom-font")
UserOption
table in the db and the serializer so it can be set