Skip to content

Commit 591db78

Browse files
committed
updated the blog
2 parents c4b1d52 + 842fe6a commit 591db78

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/constants/MarkdownFiles/posts/2025-10-06-adding-dark-mode-to-sugar-labs.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "Adding dark mode to the main Sugar Labs website"
2+
title: "Adding dark mode to  the main Sugar Labs website"
33
excerpt: "New developer Syed Khubayb Ur Rahman shares how he implemented dark mode, what issues he faced and how he debugged them."
44
category: "DEVELOPER NEWS"
55
date: "2025-10-04"
@@ -9,22 +9,29 @@ tags: "dark-mode,accessibility,frontend,Sugar Labs"
99
image: "assets/Images/dark-mode.webp"
1010
---
1111

12+
1213
<!-- markdownlint-disable -->
1314

15+
1416
# Adding dark mode to a Sugar Labs Website
1517

18+
1619
## Introduction
1720
Sugar Labs builds free/libre/open-source (FLO) tools that make learning playful and accessible. I recently contributed dark mode to a Sugar Labs web project. This post outlines the problem I encountered, how I debugged and fixed it, and the key lessons I learned so others can ship accessible theming with confidence.
18-
Repository: https://github.com/sugarlabs/www-v2
21+
Repository: [https://github.com/sugarlabs/www-v2](https://github.com/sugarlabs/www-v2)
22+
1923

2024
## The Problem
2125
The main Sugar Labs website originally lacked a dark mode option, which made browsing less comfortable in low-light conditions.
2226
Without dark mode, the bright interface could cause eye strain and reduce accessibility for users with light sensitivity.
2327

24-
- **Goal:** Deliver a robust dark mode that respects system preference, including a manual toggle with persistence, and maintaining accessible contrast across the interface.
28+
29+
- **Goal:** Deliver a robust dark mode that respects system preference, including a manual toggle with persistence, and  maintaining accessible contrast across the interface.
30+
2531

2632
Implementing the dark mode required careful planning to ensure consistency and accessibility. I began by auditing the color system, identifying issues with hardcoded values, and setting up a structure that would support scalable theming. The steps below summarize my debugging process and how each challenge was resolved.
2733

34+
2835
## Debugging and Solution
2936
- **Color audit and mapping:** I inventoried all color usages, identified hardcoded values, and grouped them into semantic tokens (background, text, muted, accent, surface). This created a maintainable foundation for theming.
3037
- **Single source of truth:** I centralized color decisions via tokens instead of scattering values across files and components. This reduced duplication and made changes less error‑prone.
@@ -35,16 +42,19 @@ Implementing the dark mode required careful planning to ensure consistency and a
3542
- **Accessibility validation:** I checked contrast ratios, improved focus visibility, and tested keyboard navigation and zoom to ensure inclusive design.
3643
- **Cross‑browser and performance checks:** I verified behavior across major browsers and optimized the switch to be instantaneous by relying on theme variables rather than heavy DOM updates.
3744

45+
3846
## Challenges and Takeaways
3947
- **Third‑party components:** Some libraries hardcoded their colors. Carefully scoped overrides and mapping external variables to our tokens aligned them with the overall theme.
4048
- **Brand color tuning:** The primary accent required adjustments for dark backgrounds. Preserving hue while tweaking lightness/saturation retained brand identity and improved legibility.
4149
- **Legacy inline styles:** Inline color rules resisted theming. Moving values into tokens eliminated one‑off overrides and simplified maintenance.
4250
- **Documentation as leverage:** I documented the token system and theme architecture. Clear guidelines made it easier for future contributors to build consistently.
4351
- **Accessibility‑first mindset:** Dark mode is not color inversion. Designing for contrast, depth, and hierarchy from the start avoids costly rework later.
4452

53+
4554
## Impact and Conclusion
4655
- **Impact on users:** Reduced eye strain, improved readability, and a cohesive experience especially valuable for users with light sensitivity.
4756
- **Impact on the project:** A unified token system speeds up future development, theming, and contributor onboarding.
4857
- **Community value:** The approach respects user preferences, provides control, and centers accessibility principles aligned with Sugar Labs’ mission.
4958

59+
5060
By sharing my experience, I hope to inspire others to contribute to Sugar Labs and make a positive impact on the community. I started by defining semantic tokens, honoring system preferences, and prioritizing accessibility. Through this process, I was able to deliver a dark mode that feels natural, inclusive, and maintainable.

0 commit comments

Comments
 (0)