naturalcrit / homebrewery

Create authentic looking D&D homebrews using only markdown
https://homebrewery.naturalcrit.com
MIT License
1.06k stars 323 forks source link

stylesheets for user page #1843

Open ericscheid opened 2 years ago

ericscheid commented 2 years ago

Unaddressed suggestions from comments on issue #240

  • Possibility of custom user-created stylesheets for their user pages? This might be an "easy" way of adding some meat to the user account 'experience', which compared to GMBinder is pretty lacking. Allowing users to add their own personality to their user page is "fun"....you know, like MySpace.

  • The html elements on the user page suffer from lack of class names or ID's. The previous suggestion would need a better naming convention. Giving each .brewItem an id# that matches the brew name, and the container div around each the Published and Unpublished brews class names would be helpful.

ericscheid commented 2 years ago

Since the HB barely has a culture of sharing links to people's user pages (and even then that user experience is in dire need of uplift), the per-account stylesheet wouldn't see much useful application.

Sounds like a bit of a rabbit hole.

Setting a class or ID on div.brewItem elements could be fragile — title's are not permanent, and even /share IDs are not permanent (yet).

That said, the per-brew styling could be accomplished by inserting the brew.style content inside a <style scoped/> element. That is, define the user-page css rules for a particular brew in that brew's css, and then inject that css into the user-page (and use <style scoped> to limit to just that .brewItem. No need for (a) adding a class or id to the .brewItem, (b) no need to keep the css selectors in sync with the brew.title or brew.shareId, and (c) no need for a whole other architecture in which to store these css rules.

Very low priority, I would think. Would also have to worry about XSS too.

ericscheid commented 2 years ago

Hmm .. actually, forget everything I said about <style scoped>the attribute has been removed from the current specification.

https://caniuse.com/?search=scoped

dbolack-ab commented 7 months ago

What about this slightly less... impactful option.

Add a property to default.json to set an alternate theme or brew for this layer of customization so someone could theme their instantiation without modding the base files.