Custom CSS and Custom Themes #3661

Closed
opened 2025-11-02 05:20:55 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @HarvsG on GitHub (Jul 24, 2019).

  • Gitea version (or commit ref): 1.8.2
  • Git version: Na
  • Operating system: Ubuntu 18.04
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

How do I load a custom stylesheet into my Gitea deployment? I have tried putting a styles.css in custom/public/ and custom/public/css/ the only method I have found that works is to place it in the templates which is sub-optimal.

Perhaps the best way to do this would be to allow for a custom/themes/ folder where users could create and share themes, then make the appropriate changes in custom/conf/app.ini and change the default theme.

It looks as if a similar idea was discussed before #56.
...

Edit

A shift+refresh revealed that a new index.css in custom/public/css/ will overwrite the gitea index.css and is helpful for changing some styles. However I am still finding myself running up against the semantic UI css. Which, itself, supports theming

Originally created by @HarvsG on GitHub (Jul 24, 2019). <!-- NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue --> <!-- 1. Please speak English, this is the language all maintainers can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/gitea) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): 1.8.2 - Git version: Na - Operating system: Ubuntu 18.04 - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [ ] MSSQL - [x] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x] Not relevant - Log gist: ## Description How do I load a custom stylesheet into my Gitea deployment? I have tried putting a `styles.css` in `custom/public/` and `custom/public/css/` the only method I have found that works is to place it in the templates which is sub-optimal. Perhaps the best way to do this would be to allow for a `custom/themes/` folder where users could create and share themes, then make the appropriate changes in `custom/conf/app.ini` and change the default theme. It looks as if a similar idea was discussed before #56. ... ## Edit A `shift+refresh` revealed that a new `index.css` in `custom/public/css/` will overwrite the gitea `index.css` and is helpful for changing some styles. However I am still finding myself running up against the semantic UI css. Which, itself, supports [theming](https://semantic-ui.com/usage/theming.html) <!-- **If this issue involves the Web Interface, please include a screenshot** -->
GiteaMirror added the type/question label 2025-11-02 05:20:55 -06:00
Author
Owner

@sapk commented on GitHub (Jul 24, 2019):

I think you will find what you need under https://docs.gitea.io/en-us/customizing-gitea/ especially Other additions to the page you can add the custom/templates/custom/header.tmpl to load your css under custom/public/css/style.css that will be available at the path /css/style.css.

@sapk commented on GitHub (Jul 24, 2019): I think you will find what you need under https://docs.gitea.io/en-us/customizing-gitea/ especially `Other additions to the page` you can add the `custom/templates/custom/header.tmpl` to load your css under `custom/public/css/style.css` that will be available at the path `/css/style.css`.
Author
Owner

@HarvsG commented on GitHub (Jul 25, 2019):

Thank you, this is what I did and it has worked well. Would still be cool to be able to develop whole custom themes that could be user-selectable and shared amongst the community.

@HarvsG commented on GitHub (Jul 25, 2019): Thank you, this is what I did and it has worked well. Would still be cool to be able to develop whole custom themes that could be user-selectable and shared amongst the community.
Author
Owner

@sapk commented on GitHub (Jul 25, 2019):

If you want to share you can make a PR and add your css style under the contrib folder.
Being able to extend gitea via plugin (and theme) is a long goal but it need a lot of refactor and there is a lot of issue to be fix before. You can see that gitea still change a lot and for a plugin solution to exist we need to support a stable standard. We are near it because we soon be able to host gitea on a gitea instance and that mean a more stable approach.

@sapk commented on GitHub (Jul 25, 2019): If you want to share you can make a PR and add your css style under the [contrib](https://github.com/go-gitea/gitea/tree/master/contrib) folder. Being able to extend gitea via plugin (and theme) is a long goal but it need a lot of refactor and there is a lot of issue to be fix before. You can see that gitea still change a lot and for a plugin solution to exist we need to support a stable standard. We are near it because we soon be able to host gitea on a gitea instance and that mean a more stable approach.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#3661