50 shades of green

One contribution to the Django world Sarah Abderemane @ DjangoCon Africa 2025

Linkedin - Mastodon - Twitter/X - Bluesky

Hello, Jambo !

I'm thrilled to be here, coming from France ๐Ÿ‡ซ๐Ÿ‡ท

Who am I

Sarah Abderemane
  • Django Software Foundation Vice President ๐Ÿ’š
  • Django Paris Meetup organizer ๐ŸŽค
  • Djangonaut Space Co-founder ๐Ÿš€
  • Django Website team chair ๐Ÿ–ฅ๏ธ
  • Django Accessibility team member ๐Ÿค—
Linkedin - Mastodon - Twitter/X - Bluesky

"Nice, how did you start to be involved in Django?"

Let's me tell you the story โœจ

The origins

cartoon of me coding in front a computer during the day
django-website
cartoon of me coding in front a computer during the night, eyes are hurting.

Why not a dark mode for the Django website?

should be simple, right?

Github issue created in January 22, 2021 saying:"Django website is simple and good. But what about the health of developers? As of now, there is no provision for dark theme. Having a dark theme will improve user experience. I would like to work on this issue."
screenshot of 4 comments of the github issue. People are asking if the issueis still open. Someone replied by "Please do, my retinas will thank you."

I can give it a try

I'm not an expert in Django

But I know how it works

I know frontend stuff

Let's do it! ๐Ÿ’ช

What is a dark mode?

Dark mode example on sarahabd.com website.

The deep dive

The start

Django website repository in GitHub

Style and more

  • the Django website is using Django under the hood
  • only a few dependencies
  • colors are spread everywhere in the CSS file
  • Sass (SCSS) is used for styling
  • jQuery is used for the JavaScript part

Did you know the website has a style guide page?

screenshot the styleguide on Django website

Accessibility

Web accessibility means that websites, tools, and technologies are designed and developed so that people with disabilities can use them.

More specifically, people can:

  • perceive, understand, navigate, and interact with the Web
  • contribute to the Web

Accessibility

example of a form with poor accessibility: how green and red border are seen when you have deuteranopia.

Source: https://cruxcollaborative.com/

screenshot of the Django website in 2021 with the WAVE extension used to check the website in terms of accessibility.

The plan

Change the whole design and re-do everything

  • gather all colors to create the white theme
  • do the reverse colors for the dark theme
  • increase contrast in dark theme
  • add the button to toggle between themes
  • test everything ๐Ÿงช

The green odyssey: gather all the shades

Colors defined in the styleguide.

Simple. Not so many colors.

right?

Let's do a quizz ๐Ÿค”

How many colors do you think were on the website in 2021?

  • 12
  • 23
  • 36 โœ…

How many colors do you think are on the website now?

  • 36
  • 42 โœ…
  • 70

How many greens do you think are on the website now?

  • 9
  • 13
  • 16 โœ…

9 greens, 1 grey, 2 reds

... but in reality it's 16 shades of green ๐Ÿ˜ฑ

Gather all colors to create the white theme


					$text: #0C3C26;
					$text-l10: lighten($text, 10);
					$text-l20: lighten($text, 20);
					$text-light: #798780;
					$text-light-l20: lighten($text-light, 20);
					$text-light-l30: lighten($text-light, 30);
					$text-light-d10: darken($text-light, 10);
					$text-light-d20: darken($text-light, 20);
					$green-very-light: #C9F0DD;
					$green-very-light-l5: lighten($green-very-light, 5);
					$green-very-light-l10: lighten($green-very-light, 10);
					$green-light: #93D7B7;
					$green-medium: #44B78B;
					$green-medium-dark: #2B8C67;
					$green: #20AA76;
					$green-l6: lighten($green, 6);
					$green-dark: #0C4B33;
					$green-dark-text: #3C8866;
				

Naming is hard...

Create the white theme


					html[data-theme="light"],
					:root {
						--body-fg: #{$text};
						--body-bg: #{$white};
						--logo-bg: #{$white};

						--menu: #{$white};

						--text-l10: #{$text-l10};
						--text-l20: #{$text-l20};
						--text-light: #{$text-light};

						--primary: #{$green-medium};
						--primary-accent: #{$green-medium-dark};

						--secondary: #{$green};
						--secondary-accent: #{$green-very-light};
						...	
					}
				

Do the reverse colors for the dark theme


					@media (prefers-color-scheme: dark) {
					html:not([data-theme="light"]) {
						--body-fg: #C1CAD2;
						--body-bg: #{$black};
						--logo-bg: #{$logo-bg-dark};

						--text-l10: #{$green-light};
						--text-l20: #{$green-very-light};
						--text-light: #{$text-light-l20};

						--primary: #{$green-medium};
						--primary-accent: #{$green-light};

						--secondary-accent: #{$green-medium};
						...
					}
				

increase contrast in dark theme

screenshot of the contrast checker tool with the dark theme colors.

add the button to toggle between themes

					
						function cycleTheme() {
							const currentTheme = getCookie('theme') || 'auto';

							if (prefersDark) {
								// Auto (dark) -> Light -> Dark
								if (currentTheme === 'auto') {
								setTheme('light');
								} else if (currentTheme === 'light') {
								setTheme('dark');
								} else {
								setTheme('auto');
								}
							} else {
								// Auto (light) -> Dark -> Light
								...
								}
							}
						}
					
				

Testing

... But not alone ๐Ÿค

More feedback from the community

The finish line

Outcomes and impact

Making a contribution is rewarding

Paolo's tweet: Paolo's tweet:

Still needs improvements

Quotes from 20Tab's survey on Django Website

First conference in person: DjangoCon Europe 2021

DjangoCon Porto, on a boat, from left to right: Sarah, Tom, Sage and Daniel. We are all smiling and looking at the camera except Tom.
					
						djangoproject.com
						โ”œโ”€โ”€ Overview
						โ”œโ”€โ”€ Download
						โ”œโ”€โ”€ Documentation
						โ”‚   โ””โ”€โ”€ docs.djangoproject.com
						โ”œโ”€โ”€ News
						โ”œโ”€โ”€ Community
						โ”œโ”€โ”€ Code
						โ”œโ”€โ”€ Issues
						โ”‚   โ””โ”€โ”€ code.djangoproject.com
						โ”œโ”€โ”€ About
						โ””โ”€โ”€ Donate
					
				
Tom's feedback on my PR
Email to join the GitHub Django organization from Mariusz Felix

Took initiatives in Django community

  • Co-founder of Djangonaut Space
  • Django Girls+ coach
  • Django Website WG Chair
  • Maintainer of the website djangoproject.com
  • Help others to contribute
  • and more...

I made a lot of friends

Collage of my friends in multiple conferences: we can see Kojo, Thibaud, Sage, Eli, Raffaella

There are so many we can't fit them all on one slide ๐Ÿ’š

You don't need to be an expert to contribute

Try, even if it sounds scary

You can start with small contributions

You can learn and grow with the community

You could be the next expert โœจ

Want to give it a try?

Many possibilities โœจ

  • Join us for the sprints on Thursday
  • Help shape the future of the website
  • Contribute to things that could interest you
    • Register to the new Djangonaut Space session
    • Triage the tickets
    • Contribute to Django core
    • Mentor people
    • Help DSF fundraising
    • Join a Working Group
    • and more...

We all have a story to tell. What's yours?

If you don't, you can still write your story.

Thank you, Asante

Sarah Abderemane
@sabderemane
sarahabd.com

Slides link: https://sarahabd.com/shades/