- Applying the GitHub Dark Theme to Miniflux with GPT
- Screenshots
- Before
- After
- Generating
- Thoughts
- Reference
- Recent Posts
Applying the GitHub Dark Theme to Miniflux with GPT
By @Charlie Revett on @May 6, 2023
I use the GitHub dark theme for both my VS Code and terminal setup, and wanted to experiment with applying the theme to my self-hosted Miniflux app as I find the default colour scheme quite dull and poor for readability; plus consistency is key of course.
Miniflux offers a primitive CSS override via the settings page, so the goals for this experiment were:
- Find the GitHub dark theme colour palette
- Find the Miniflux theme CSS custom properties
- Craft an OpenAI GPT prompt using the
v3.5-turbo
and apply it - Write no actual CSS
Screenshots
Before
After
Generating
Finding a full colour palette for the theme was tricky, however I found the best to be from the vv9k/vim-github-dark repo (see ghdark.vim
). This gave us 10 colours for inspiration:
base0: #0d1117
base1: #161b22
base2: #21262d
base3: #89929b
base4: #c6cdd5
base5: #ecf2f8
red: #fa7970
orange: #faa356
green: #7ce38b
lightblue: #a2d2fb
blue: #77bdfb
purple: #cea5fb
The Miniflux theme CSS custom properties can be found within the :root
block of system.css
. I removed any lines which were not related to colour (to reduce prompt size), and replaced any existing hex values with #blank
, as GPT would only change around 10-20% of the theme if existing values were present. This gives us:
:root {
--body-color: #blank;
--body-background: #blank;
--hr-border-color: #blank;
/* ... */
}
When crafting the final prompts, I needed to:
- Split it in two as the CSS code block hit the character limit for
v3.5-turbo
- Instruct GPT to not include any explanation as it was explaining why each colour was used
- Adjust the theme for links as GPT was using blue for nearly all text values
Using this colour palette (GitHub dark theme) as inspiration:
```
base0: #0d1117
base1: #161b22
base2: #21262d
base3: #89929b
base4: #c6cdd5
base5: #ecf2f8
red: #fa7970
orange: #faa356
green: #7ce38b
light blue: #a2d2fb
blue: #77bdfb
purple: #cea5fb
```
Amend these CSS values (`#blank`) to create a new theme:
```css
:root {
--body-color: #blank;
--body-background: #blank;
--hr-border-color: #blank;
/* ... */
}
```
- Do not use blue for links, use `base5` instead
- Do not include any explanation, just the code block
Followed by:
Apply the same change to these CSS values (`#blank`) following the
same theme as before:
```css
:root {
--page-header-title-border-color: #blank;
--logo-color: #blank;
--logo-hover-color-span: #blank;
/* ... */
}
```
Thoughts
I was impressed by GPT’s ability to generate only using the names of the CSS custom properties, without any existing colour values. I found the limitations of v3.5-turbo
the most interesting part:
- Being unable to return only the diff of the CSS code block
- Wanting to explain why all the changes were made
- Being overly zealous with the colour blue
Overall, applying the theme was a success; I was able to generate a custom theme without writing any CSS. If you're looking to customize your Miniflux theme, I highly recommend giving this method a try.
Reference
#blank