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

Customizing colors #69

Open
maria-antoniak opened this issue Oct 5, 2023 · 2 comments
Open

Customizing colors #69

maria-antoniak opened this issue Oct 5, 2023 · 2 comments

Comments

@maria-antoniak
Copy link

I'm wondering whether it's possible to customize the colors and other aesthetic features of the interface. Poking around in the repo, I wasn't able to find a place where the color palette is defined (the grays and navy blues of the default base_template). Is there an easy way to do this, or is it more complicated than I expected? (This is extremely non-urgent; just curious!)

@Jiaxin-Pei
Copy link
Collaborator

Hi @maria-antoniak, yes!

The aesthetic features are generally defined by the css settings in the header template. By default, each project is using the default header . For example, the legend is defined here

            legend {
                background-color: #160085;
                color: white;
                padding: 5px 5px;
                font-size: 13pt;
                font-weight: bold;
            }

If you want to use customized color, you could copy the default header template into the templates folder into your project directory, and change the header_file key's value from default to templates/header.html, then all your edits to this new header file will be used.

    # The core UI files for Potato. You should not need to change these normally.
    #
    # Exceptions to this might include:
    # 1) You want to add custom CSS/fonts to style your task
    # 2) Your layout requires additional JS/assets to render
    # 3) You want to support additional keybinding magic
    #
    # if you want to use your own template,
    # please replace the string as a path to the template
    "base_html_template": "default",
    "header_file": "templates/header.html",

For example, if changing the color to tomato:

            legend {
                background-color: tomato;
                color: white;
                padding: 5px 5px;
                font-size: 13pt;
                font-weight: bold;
            }

The color of all the legends will be changed.

image

The navigation bar, however, is defined in another template file. To customize this file, you could follow a similar step copying it into the templates folder under your project directory, and edit the base_html_template file:

    "base_html_template": "templates/base_template.html",
    "header_file": "templates/header.html",

Then if you edit the navigation bar tag, the background color of it will also be changed

    <nav class="navbar navbar-expand-md navbar-dark mb-3" style="background-color:tomato;">

image

Simply put, via editing the template files, you have full control over the style of you pages and everything is compatible with the potato-annotation python package (you can still potato start your-project).

  "html_layout": "templates/layout.html",
  "base_html_template": "templates/base.html",
  "header_file": "templates/header.html",

@maria-antoniak
Copy link
Author

Ah this is awesome, thank you!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants