An Oxocarbon port for instances of Forgejo
Find a file
2024-09-25 17:46:33 +00:00
img Upload files to "img" 2024-09-24 21:22:03 +00:00
LICENSE Upload files to "/" 2024-09-24 21:21:05 +00:00
README.md Update README.md 2024-09-25 17:46:33 +00:00
theme-oxocarbon.css Upload files to "/" 2024-09-24 21:21:05 +00:00

Oxocarbon Theme for Forgejo

Oxocarbon is a sleek, modern dark theme for Forgejo, inspired by IBM's Carbon Design System and specifically tailored to match the aesthetics of the Oxocarbon color scheme. This theme enhances the user interface with a consistent, visually appealing look that aligns with the design principles of the Carbon Design System.

Oxocarbon Theme Preview

Table of Contents

Installation

Prerequisites

  • Forgejo instance running v8.0.2 or later.
  • Access to the server's file system to add custom theme files.

Step-by-Step Guide

For Standard Installations

  1. Download the Theme Files

    Clone or download the theme files from the repository:

    # https clone
    git clone https://codeberg.org/bipp/oxocarbon-forgejo.git
    # ssh clone
    git clone git@codeberg.org:bipp/oxocarbon-forgejo.git
    
  2. Locate the Custom Theme Directory

    Navigate to your Gitea custom configuration directory. By default, this is usually located at:

    /var/lib/gitea/custom/
    

    If you have configured a different CUSTOM_PATH, use that path instead.

  3. Create Theme Directories

    Inside the custom directory, create the following subdirectories if they don't already exist:

    mkdir -p public/css/themes
    mkdir -p templates
    
  4. Copy the Theme CSS File

    Copy the theme-oxocarbon.css file into the public/css/themes directory:

    cp oxocarbon-forgejo/theme-oxocarbon.css /var/lib/gitea/custom/public/css/themes/
    
  5. Restart Forgejo

    Restart the Forgejo service to apply the changes:

    sudo systemctl restart forgejo 
    
  6. Select the Oxocarbon Theme

    Log in to your Forgejo instance, navigate to your user settings, and select oxocarbon from the list of available themes.

For Docker Installations

If you're running Forgejo within a Docker container, the steps are similar, but the file paths will be different. The /data directory inside the container is typically mounted to a local directory on your host machine. Replace /var/lib/gitea with your local mount point.

  1. Download the Theme Files

    Clone or download the theme files from the Codeberg repository:

    git clone https://codeberg.org/bipp/oxocarbon-forgejo.git
    
  2. Locate the Custom Theme Directory

    Navigate to your Forgejo data directory on the host machine. This is the directory you have mounted to /data inside the Docker container. For example:

    /path/to/your/forgejo/data
    
  3. Create Theme Directories

    Inside the data directory, create the following subdirectories if they don't already exist:

    mkdir -p custom/public/css/themes
    mkdir -p custom/templates
    
  4. Copy the Theme CSS File

    Copy the theme-oxocarbon.css file into the custom/public/css/themes directory:

    cp oxocarbon-forgejo/theme-oxocarbon.css /path/to/your/gitea/data/custom/public/css/themes/
    
  5. Restart the Forgejo Container

    Restart your Forgejo Docker container to apply the changes:

    docker restart forgejo_container_name
    

    Or restart the Forgejo Docker stack:

    docker compose down && docker compose up -d
    
  6. Select the Oxocarbon Theme

    Log in to your Forgejo instance, navigate to your user settings, and select oxocarbon from the list of available themes.

Setting as Default Theme

To set Oxocarbon as the default theme for all users:

  1. Edit the app.ini Configuration File

    • Standard Installations:

      Locate and open your app.ini file, typically found at /etc/gitea/app.ini or /var/lib/gitea/custom/conf/app.ini.

    • Docker Installations:

      The app.ini file is located inside your Forgejo data directory on the host machine:

      /path/to/your/forgejo/data/gitea/conf/app.ini
      
  2. Update the UI Theme Settings

    Under the [ui] section, set DEFAULT_THEME to oxocarbon:

    [ui]
    DEFAULT_THEME = oxocarbon
    
  3. Restart Forgejo

    • Standard Installations:

      Apply the changes by restarting the Forgejo service:

      sudo systemctl restart forgejo
      
    • Docker Installations:

      Restart your Forgejo Docker container:

      docker restart forgejo_container_name
      

      Or restart your Forgejo Docker stack:

      docker compose down && docker compose up -d
      

Now, all users will see the Oxocarbon theme by default when they visit your Forgejo instance.

Acknowledgments

  • This theme is based on the Gitea Dark Theme.
  • The Oxocarbon theme was created with the assistance of ChatGPT o1-preview, with minor tweaking from the author to ensure compatibility and adherence to the Carbon Design System's principles (separate of the code-viewer, which uses the code-editor's background for consistency in viewing/editing code).
  • Special thanks to the Forgejo community for their continuous support and contributions.

License

This project is licensed under the GNU GPL-v3.0 License. See the LICENSE file for details.


Note: This theme is not an official Forgejo product. It is an independent project aimed at enhancing the user experience by providing an alternative dark theme option.