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

Allow Gitea to have themes #56

Closed
DblK opened this issue Nov 3, 2016 · 25 comments · Fixed by #4198
Closed

Allow Gitea to have themes #56

DblK opened this issue Nov 3, 2016 · 25 comments · Fixed by #4198
Labels
type/enhancement An improvement of existing functionality
Milestone

Comments

@DblK
Copy link
Member

DblK commented Nov 3, 2016

Since we use semantic-ui and it can handle themes, Gitea should provide the default theme and a dark theme also.
Users will be able to make their own theme too.

I would suggest to begin with only css tweaks to change the display of pages.
In a second step, maybe we can add themes to modify templates file (.tmpl) to modify the links on each page.

What do you think about that?

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/38935464-allow-gitea-to-have-themes?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).
@DblK DblK added the type/proposal The new feature has not been accepted yet but needs to be discussed first. label Nov 3, 2016
@joubertredrat
Copy link
Contributor

@DblK your idea is only change color or html components too?

@DblK
Copy link
Member Author

DblK commented Nov 3, 2016

With Semantic you can do both (See http:https://semantic-ui.com/usage/theming.html).
The implementation could be simple, by looking to bindata and see if there are few themes inside a possible "themes" folder.
A list of theme could be selected from an admin page and/or adding option to each repo to set the default theme.

@joubertredrat
Copy link
Contributor

theme with material design sounds good

@tboerger tboerger added this to the 1.x.x milestone Nov 3, 2016
@metalmatze
Copy link
Contributor

metalmatze commented Nov 5, 2016

I was actually thinking about a material theme too. I'd like to join the discussion here.
I really like https://getmdl.io. A new UI should probably wait for #64.

@xinity xinity added type/enhancement An improvement of existing functionality and removed type/proposal The new feature has not been accepted yet but needs to be discussed first. labels Nov 5, 2016
@xinity
Copy link
Contributor

xinity commented Nov 5, 2016

switched to enhancement as we agree on benefits of this idea :)

@gabrielsimoes
Copy link
Contributor

I'm planning on tackling this issue (or at least #730) , and I thought about implementing a button close to the language button on the bottom of the page, which would be used to choose theming. Any thoughts on this?

@gabrielsimoes
Copy link
Contributor

gabrielsimoes commented Jan 27, 2017

Does anybody suggest a way to pack themes? The css-only version of semantic-ui, which gitea uses, apparently is not made to support themes. Do you guys have any ideas on how to approach this?

@lunny
Copy link
Member

lunny commented Jan 27, 2017

I remember someone have provide a github-like theme.

@pgaskin
Copy link
Contributor

pgaskin commented Jan 29, 2017

Just pack the theme into a single CSS file, and apply it over the existing theme. It usually works fine.

@pgaskin
Copy link
Contributor

pgaskin commented Jan 29, 2017

@lunny is this what you are talking about?

@lunny
Copy link
Member

lunny commented Jan 29, 2017

No. It's a Gitea patch which could just replace for a github-like theme.

@pgaskin
Copy link
Contributor

pgaskin commented Jan 29, 2017

@lunny here is some CSS which can be appended to the page. It is taken from the example, and makes gitea look like github. http:https://pastebin.com/NJF5wg9W Is this the kind of thing you want?

@gabrielsimoes
Copy link
Contributor

gabrielsimoes commented Jan 29, 2017

@geek1011 Maybe, but how did you build it? I mean, it is way over 10 000 lines.

EDIT: nervermind, didn't see you got it from the example.

@pgaskin
Copy link
Contributor

pgaskin commented Jan 29, 2017

@gabrielsimoes I just concatenated a the CSS files in the example.

@gabrielsimoes
Copy link
Contributor

gabrielsimoes commented Jan 29, 2017

The issue I encountered is the following: the Semantic UI build tools allows to build a custom .css file using a theme which overrides the default one. That is, a single css file containing all the Semantic UI css with your changes included. I think editing the css manually is just too time consuming. I think the ideal way would be to build a custom css per theme. This also affects custom css which are added to gitea through index.css.

What I propose is the following: reimplement the gitea custom less files as a Semantic UI theme, and auto compile it to separate semantic UI css for each theme. If someone wants to build its own theme, it should override this gitea theme, and build a custom css for it. This custom css would be loaded to the page instead of the default theme css, and so on.

I mean, the css files would not be used as an override to a default css, as this is not supported by Semantic UI build tools. Instead, a themer (or whatever)should use the Semantic UI build tools to create a custom css for his theme which includes all the Semantic UI css.

@gabrielsimoes
Copy link
Contributor

Would it be a problem to have the Semantic UI "distribution" inside gitea? So that themes can be generated together with the files inside /public/less/.

@DblK
Copy link
Member Author

DblK commented Jul 4, 2017

I don't see any issues

@kolaente
Copy link
Member

Any news on this?

@lunny
Copy link
Member

lunny commented Jan 15, 2018

Nobody work on this. @kolaente

@lstolcman
Copy link

FYI: I've created simple github-like theme for gitea here.
The work is based on #56 (comment) with some small changes, like changing color of directories in repo.

However, it would be good to have some kind of documentation how to generate css from less files, to help make themes easier

@lunny
Copy link
Member

lunny commented May 14, 2018

Maybe we could give some proposals. We could define a themes on custom/ and i.e. custom/themes/dark. And then we allow user put their files on the directory. CSS, templates, js and images both could be supported.
A themes list could be put on the UI, when the theme changed, we could copy custom/themes/dark to custom, and restart the service internally, then the new theme could be applied.

@lafriks
Copy link
Member

lafriks commented May 15, 2018

I don't think themes should replace css file, it should just change existing styles by being added as additional css file, otherwise with base css file changed themes will become outdated as will have missing styles

@DblK
Copy link
Member Author

DblK commented May 15, 2018

I did a POC for a theme, with the css inside the public directory.
I edited the base.tmpl (inside custom) to add the css and now I can start theming.

@kolaente
Copy link
Member

@lafriks That would mean we dont use Semantic-UI's themeing but own css files which are added after the base css?

@daviian
Copy link
Member

daviian commented May 15, 2018

@lafriks I'm with @kolaente , we should stick with the theming of semantic-ui and thus provide a way to edit the less variable files or something like that.

@lunny lunny modified the milestones: 1.x.x, 1.6.0 Jul 6, 2018
lunny pushed a commit to lunny/gitea that referenced this issue Feb 7, 2019
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.