Skip to content
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

[Frontend HTML Markup] Add specific body classes to different frontend pages #2825

Open
jeherve opened this issue Apr 11, 2024 · 1 comment
Labels
enhancement New feature or request
Milestone

Comments

@jeherve
Copy link

jeherve commented Apr 11, 2024

Is your feature request related to a problem ?

The custom CSS feature is very useful, and could be improved with additional CSS classes to allow more specific style adjustments, depending on the page.

Describe the solution you'd like.

The current frontend of GoToSocial is built with a single page class added to the body:

Screenshot 2024-04-11 at 12 27 19

It would be nice if extra CSS classes were added when visiting different pages:

  • When viewing a profile's home page, we could add a profile class.
  • When viewing a single thread, an additional single class could be added.
  • When looking at the About page, an about class could be added.

Describe alternatives you've considered.

I've been relying on the :has() pseudo-class, but I find it a bit more complex than it could be:

/* Hide the header on the home page */
.page header.page-header {
   display: none;
}

/* Display it when looking at single threads */
head:has(meta[property="og:title"][content*="Post by"]) + .page header.page-header {
  display: block;
}

Ideally, I'd want to do this instead:

.profile header.page-header {
   display: none;
}

Additional context.

No response

@jeherve jeherve added the enhancement New feature or request label Apr 11, 2024
@tsmethurst
Copy link
Contributor

This is a very reasonable request!

@tsmethurst tsmethurst added this to the v0.16.0 milestone Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants