Change the colors and the icon#
The site uses the colors of the Python Calendaring Ecosystem: the blue and the
yellow of its logo. The people who run a site can change every color, the icon
and the name, with settings in .env.
Colors#
Each color has a setting COLOR_<NAME> for the light pages and
COLOR_DARK_<NAME> for the dark pages, which browsers show when the system
is dark or when the visitor chooses them (see Light and dark pages). The values are hexadecimal colors such as #3b79aa or #fd0.
Setting |
Default |
Used for |
|---|---|---|
|
|
links and buttons |
|
|
links and buttons under the pointer |
|
|
the blue of the logo |
|
|
the yellow line below the menu and the sign in button |
|
|
text on the accent color |
|
|
the background of the menu |
|
|
the text of the menu |
|
|
the background of the pages |
|
|
the background of highlighted parts |
|
|
the text |
|
|
less important text |
|
|
lines and borders |
|
|
signed agreements and added lines |
|
|
agreements to sign |
|
|
errors and removed lines |
For example:
COLOR_PRIMARY=#7a1f5c
COLOR_NAV=#4a1238
COLOR_DARK_PRIMARY=#f0a8d8
A wrong value stops the start of the site with
InvalidColor or
UnknownColor. Check the contrast of
text and background, for example with the contrast checker of the developer
tools of the browser.
Light and dark pages#
The menu of every page has a button with the icon of the current colors, like
the switch of this documentation: a half circle for As the system, a sun for
Light and a moon for Dark. It opens a dropdown with the three choices. It
works without JavaScript: the dropdown is a <details> element and the
choices are the buttons of a form sent to /theme/,
which keeps Light or Dark for a year in the cookie theme and returns to
the page. As the system removes the cookie, so that the browser chooses the
light or the dark colors again. The site ignores unknown values of the cookie.
More style#
EXTRA_CSS_URL adds a style sheet after that of the site, to change more
than the colors.
Icon#
FAVICON is the icon: an address on the web, or the path of a PNG, ICO or
SVG file in the container. An address is linked as it is:
echo FAVICON=https://pycal.org/favicon.png >> .env
A file is served by the site; put it in the volume of the data:
cp my-icon.png data/favicon.png
echo FAVICON=/app/data/favicon.png >> .env
The icon is shown in the menu and as icon of the browser tab; /favicon.ico
serves the file or redirects to the address. The default is the icon of pycal.
A file that is missing or of another type stops the start of the site.
FAVICON_FILE is the older name of the setting and still works.
Name#
SITE_NAME is shown in the menu, in the titles and in the names of the
checks of the pull requests (STATUS_CONTEXT).