3 ms·
HN already lets you edit the top bar color, just repeat that with extra fields for the rest of the layout, and maybe add font size to boot. The UI of the user p
by krapp 2y ago
HN already lets you edit the top bar color, just repeat that with extra fields for the rest of the layout, and maybe add font size to boot. The UI of the user panel would be slightly more complicated but it would be no less safe than what you already have. And if you want to get fancy, you can use the HTML5 color tag.
edit I see you just answered another similar comment, but I'm still going to obstinately argue for it because it's the simplest and safest solution. There's nothing wrong with adding UI elements when you're adding new functionality. And that extra complexity is still less complex than something more superficially "elegant" like an internal CSS parser.
- dang 2y ago> extra fields That leads to settings hell and I don't want that complexity curve.
- krapp 2y agoIf you want people to be able to use custom styles, that's extra complexity regardless. If you let people upload their own stylesheets, you need storage for potentially millions of extra files, validation, size limits, etc. All of the hazards associated with arbitrary file uploads. Or extra fields. Then all you're dealing with is a few more color values on the backend for a stylesheet that's already being generated by code. It's a lot easier to validate a color (the code for which is already there) than an entire nearly Turing complete language. You could even split the difference and have themes generated from one or two user supplied colors, instead of fields for each css value.