Thanks for considering to contribute!
GitHub's API for Discussions is currently only available through the GraphQL API, which currently requires authentication for all requests. With the way giscus works, you'll need to create a GitHub App in order to get it running on your machine. Follow the self-hosting guide to get it running.
This project is built with Next.js. To get started:
yarn
: install dependenciesyarn dev
: compile and hot-reload for developmentyarn build
: compile and minify for productionyarn lint
: lint and fix filesyarn start
: serve the compiled build in production mode
If you want to submit your custom theme to giscus, create a new file in
styles/themes
. The file name (without .css
) will be the
theme's key. You can use the other theme files as reference (see
custom_example.css
). Once you've added the theme file, add the key
and name to Theme
in lib/variables.ts
to register it.
If you want to customize the syntax themes, you can change the CSS variables
that start with the --color-prettylights-syntax-
prefix. See the
custom_example.css
file for more details.
To support both light and dark mode based on the user's system preferences, you
can use the @media (prefers-color-scheme: dark)
query. For more details, see
the preferred_color_scheme
theme file.
Several classes prefixed with gsc-
are used in the HTML
generated by giscus. You can take advantage of this to further customize your
theme. Note that the classes and HTML structure are subject to change, as
updates to giscus may require modifications to the HTML. You'll need to make
sure that your theme is up-to-date.
If you want to use a custom theme without submitting it to giscus, you can do
so by using a custom theme URL. Note that you cannot
@import
a syntax theme and must inline it in your CSS. That said, if you
create a nice theme, I'd appreciate it if you create a PR instead so others can
use it easily.