Allow custom CSS to be appended to Gitea #244

Closed
opened 2025-11-02 03:15:17 -06:00 by GiteaMirror · 9 comments
Owner

Originally created by @pgaskin on GitHub (Jan 17, 2017).

  • Gitea version (or commit ref): 1.0.1
  • Git version: 2.9.3
  • Operating system: Alpine Linux
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant

Description

I have a Gitea server. I would like to be able to append custom CSS to the page to make small changes, such as the size of the buttons, and padding on certain elements. Sometimes, I want to make other small changes. I would like a way CSS can be injected from a file to the end of the page, so I can do this quickly, and without rebuilding Gitea after patching it with my CSS.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/41043453-allow-custom-css-to-be-appended-to-gitea?utm_campaign=plugin&utm_content=tracker%2F47456670&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F47456670&utm_medium=issues&utm_source=github).
Originally created by @pgaskin on GitHub (Jan 17, 2017). - Gitea version (or commit ref): 1.0.1 - Git version: 2.9.3 - Operating system: Alpine Linux - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [X] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [X] Not relevant ## Description I have a Gitea server. I would like to be able to append custom CSS to the page to make small changes, such as the size of the buttons, and padding on certain elements. Sometimes, I want to make other small changes. I would like a way CSS can be injected from a file to the end of the page, so I can do this quickly, and without rebuilding Gitea after patching it with my CSS. <bountysource-plugin> --- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/41043453-allow-custom-css-to-be-appended-to-gitea?utm_campaign=plugin&utm_content=tracker%2F47456670&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F47456670&utm_medium=issues&utm_source=github). </bountysource-plugin>
GiteaMirror added the type/feature label 2025-11-02 03:15:17 -06:00
Author
Owner

@esell commented on GitHub (Jan 17, 2017):

As of today if you build from source without the bindata tag you can use custom templates which in this case would get you what you want. Once you've compiled the code without bindata you'll be able to update the CSS whenever you want.

EDIT: as a reference you can check out this existing issue: https://github.com/go-gitea/gitea/issues/529

@esell commented on GitHub (Jan 17, 2017): As of today if you build from source without the bindata tag you can use custom templates which in this case would get you what you want. Once you've compiled the code without bindata you'll be able to update the CSS whenever you want. EDIT: as a reference you can check out this existing issue: https://github.com/go-gitea/gitea/issues/529
Author
Owner

@pgaskin commented on GitHub (Jan 17, 2017):

I already know about bindata, but I require bindata at the moment. Also, if I modify the original CSS, I cannot update without losing my changes.

I am asking about a file which gitea would append CSS from automatically, even with bindata.

@pgaskin commented on GitHub (Jan 17, 2017): I already know about bindata, but I require bindata at the moment. Also, if I modify the original CSS, I cannot update without losing my changes. I am asking about a file which gitea would append CSS from automatically, even with bindata.
Author
Owner

@tboerger commented on GitHub (Jan 17, 2017):

With custom templates you can add additional css files, but there is currently an open issue related to that.

@tboerger commented on GitHub (Jan 17, 2017): With custom templates you can add additional css files, but there is currently an open issue related to that.
Author
Owner

@tboerger commented on GitHub (Jan 28, 2017):

A pr for custom public data have been merged, hopefully I can fix custom templates as well soon

@tboerger commented on GitHub (Jan 28, 2017): A pr for custom public data have been merged, hopefully I can fix custom templates as well soon
Author
Owner

@pgaskin commented on GitHub (Jan 29, 2017):

@tboerger I have opened pull request #784. This builds on your work on #782 to allow custom css without overriding the whole gitea stylesheet.

@pgaskin commented on GitHub (Jan 29, 2017): @tboerger I have opened pull request #784. This builds on your work on #782 to allow custom css without overriding the whole gitea stylesheet.
Author
Owner

@hooch commented on GitHub (Jan 9, 2018):

+1 ?

Pulling out the head.tmpl is getting more complicated with each release.

@hooch commented on GitHub (Jan 9, 2018): +1 ? Pulling out the head.tmpl is getting more complicated with each release.
Author
Owner

@tboerger commented on GitHub (Jan 9, 2018):

Pulling out the head.tmpl is getting more complicated with each release.

Just use this custom template: https://github.com/go-gitea/gitea/blob/master/templates/base/head.tmpl#L130

@tboerger commented on GitHub (Jan 9, 2018): > Pulling out the head.tmpl is getting more complicated with each release. Just use this custom template: https://github.com/go-gitea/gitea/blob/master/templates/base/head.tmpl#L130
Author
Owner

@lafriks commented on GitHub (Jan 9, 2018):

I think this can be closed already as we provide custom block to be added in head

@lafriks commented on GitHub (Jan 9, 2018): I think this can be closed already as we provide custom block to be added in head
Author
Owner

@lafriks commented on GitHub (Jan 9, 2018):

Implemented by #3051

@lafriks commented on GitHub (Jan 9, 2018): Implemented by #3051
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#244