-
Notifications
You must be signed in to change notification settings - Fork 340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add semantic ID's and classes to improve theming/userscript experience #1327
Add semantic ID's and classes to improve theming/userscript experience #1327
Conversation
The idea of using semantic elements (nav, footer) was brought up in a Matrix thread. This would be an improvement for theming, but would also likely be a breaking change for any existing custom CSS and possibly even userscripts that modify layout. I'm not opposed to this, especially this early in the lifecycle of Lemmy adoption, but I'd like to solicit feedback for the negative case (the positive is self evident). |
I guess the same could be said about any structural change of the frontend, and I doubt we consider this problem then. |
So far nothing makes any structural changes to the frontend, I was trying to avoid that where possible by starting with the light touch of adding semantic sugar. I do think the site could benefit from some breaking structural changes, but I think that would be outside of the scope of this task. That said I think the semantic tags definitely fall within the scope of this theming/userscript goal. Unless someone has a compelling argument to the contrary I'm going to move forward with the change |
I think this should be good enough to put up for review. It's now at a point where I feel I can start rewriting the included themes to utilize these new attributes. |
…my-ui into feature/add-ids-and-classes
I also added a class to the more button on a comment node as per a suggestion from another user |
Thanks everyone! <3 |
There is currently a major lack of semantic ID's and classes in the UI markup. This makes everything from detecting if the site is running Lemmy (for userscript) to theming more difficult than necessary.
This PR attempts to remedy that by adding semantics to the markup in a way that will simplify CSS queries and make site theming simpler. I'm aiming to take a light touch approach while still being thorough.
In the end I intend to rewrite the base CSS themes included with Lemmy to better utilize these markup enhancements. The current theme files are a bit messy and include lots of extraneous styling.
Changes made
Changed page elements to use semantic HTML tags
<footer>
article
aside
with containedsection
elementsAdded ID's and classes to improve CSS specificity for themes and userscripts
#app
gained thelemmy-site
classMarkdownTextArea
componentid
andformId
renamed fromcomment-textarea-{randomString}
tomarkdown-textarea-{randomString}
as the component is used for more than comments