rbreslow / speak

A full featured chatbox addon for Garry's Mod.
GNU Affero General Public License v3.0
4 stars 0 forks source link

Use CSS variables to handle theming #16

Open rbreslow opened 4 years ago

rbreslow commented 4 years ago

Right now, we have methods on the JS instance to set individual style properties like font family, size, etc. It'd be nice to roll this up into one setTheme(data) method that takes a JSON object and then updates CSS variables, rather than iterating over elements and setting what are essentially inline styles.

See:

rbreslow commented 4 years ago

It'd be nice to have some prebaked themes like:

image

And then have an unfurlable DProperties element for doing your own customization:

image

You could theme the chatbox and then copy your generated JSON theme and share with other folks / enforce it via a policy.