Skip to content

Add light mode with CSS variables and prevent FOUC#118

Merged
yash-pouranik merged 8 commits intogeturbackend:mainfrom
aliyasyeddd:feature/theme-css-fouc
Apr 20, 2026
Merged

Add light mode with CSS variables and prevent FOUC#118
yash-pouranik merged 8 commits intogeturbackend:mainfrom
aliyasyeddd:feature/theme-css-fouc

Conversation

@aliyasyeddd
Copy link
Copy Markdown
Contributor

@aliyasyeddd aliyasyeddd commented Apr 19, 2026

Fixes #98

🛠️ Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • 💥 Breaking change
  • 📝 Documentation update
  • 🎨 UI/UX improvement (Frontend only)
  • ⚙️ Refactor / Chore

🧪 Testing & Validation(Checking)

Frontend Verification:

  • I have run npm run lint in the frontend/ directory.
  • Verified the UI changes on different screen sizes (Responsive).
  • Checked for any console errors in the browser dev tools.

✅ Checklist

  • My code follows the code style of this project.
  • I have performed a self-review of my code.
  • I have commented my code, particularly in hard-to-understand areas.
  • My changes generate no new warnings or errors.
  • I have updated the documentation (README/Docs) accordingly.

Built with ❤️ for urBackend.

Summary by CodeRabbit

  • New Features
    • Added a light mode option alongside dark mode. The site now detects system color preference on load, preserves the user’s choice for future visits (with safe fallback if storage access is unavailable), and updates UI colors and surfaces for a consistent light theme.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 19, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 17a74f86-88f7-4583-9fe3-fe39c8c9ea3a

📥 Commits

Reviewing files that changed from the base of the PR and between 45c5637 and 3271542.

📒 Files selected for processing (2)
  • apps/web-dashboard/index.html
  • apps/web-dashboard/src/index.css
✅ Files skipped from review due to trivial changes (1)
  • apps/web-dashboard/src/index.css
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/web-dashboard/index.html

📝 Walkthrough

Walkthrough

Adds a light theme variant and client-side initialization: an inline script in apps/web-dashboard/index.html reads urbackend-theme from localStorage (try/catch), falls back to prefers-color-scheme, and toggles a .light-mode class; apps/web-dashboard/src/index.css defines .light-mode variables and replaces hard-coded dark colors with tokens.

Changes

Cohort / File(s) Summary
Theme Initialization
apps/web-dashboard/index.html
Adds an inline page-load script that safely reads urbackend-theme from localStorage, lowercases the value, treats "light"/"light-mode" as light, falls back to matchMedia('(prefers-color-scheme: light)'), and toggles light-mode on document.documentElement (note: toggle is called twice with same args).
Light-mode CSS variables & tokenization
apps/web-dashboard/src/index.css
Introduces .light-mode overrides for many CSS custom properties (colors for primary, backgrounds, text, borders, danger/success, overlay, glassmorphism, auth tokens). Replaces numerous hard-coded dark color usages (glass-card, scrollbar, hover/surface states, skeletons, selects, auth surfaces, inputs, links, footer) with new variables. Reviewers should check variable coverage and auth/glass UI surfaces for regressions.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • Feature/theme toggle UI #114 — Implements the same theme mechanism using the urbackend-theme localStorage key and matchMedia; related at the code level (this PR adds inline initialization while #114 adds a React ThemeToggle component).

Suggested labels

frontend, level-2

Poem

🐇
I hopped in quick to swap the night,
A little class and pixels bright.
LocalStorage hums the path to take,
No flash, just warmth — a gentler wake. ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Linked Issues check ❓ Inconclusive The PR implements light-mode CSS variables and FOUC prevention (#98), but the toggle component and localStorage persistence are incomplete—they depend on PR #114's ThemeToggle component, which has already been merged. Verify that the 'urbackend-theme' localStorage key handling is correctly implemented and that all referenced CSS variables are properly defined to avoid breaking the dark-mode theme.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main changes: adding light mode with CSS variables and preventing FOUC, which directly aligns with the primary objectives.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing light mode and preventing FOUC as specified in issue #98, with no unrelated modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (2)
apps/web-dashboard/index.html (1)

17-17: Multiple storage keys risks divergence — pick one canonical key.

Reading from four different keys (theme, color-theme, colorTheme, mode) without defining which the rest of the app writes to is a recipe for stale/conflicting state: the toggle component (yet to be added per the issue) writes to key A, but on reload this script might read a stale value from key B. Please commit to a single key (e.g., theme) and document it; if the keys are intended for backward compatibility, add a short comment stating which ones are legacy.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/web-dashboard/index.html` at line 17, The storageKeys array
(storageKeys) currently contains four different keys ('theme', 'color-theme',
'colorTheme', 'mode') which can cause divergence; update the code to use a
single canonical key (e.g., 'theme') everywhere the app reads/writes theme state
and remove the other keys from storageKeys, or if those other keys are for
backward compatibility, leave them only for an initial migration step and add a
short comment marking them as legacy and which key is canonical; ensure any
theme toggle component and any read/write helpers reference the canonical key
(storageKeys variable or its consumers) so the app consistently reads/writes the
same key.
apps/web-dashboard/src/index.css (1)

42-42: Scope selector to :root.light-mode to match the issue spec and improve specificity intent.

The linked issue calls out :root.light-mode. Using the bare .light-mode class works today (the inline script targets document.documentElement), but :root.light-mode makes the intent explicit and guarantees the override only applies to the root token layer, preventing accidental matches if someone later adds a descendant element with that class name.

-.light-mode {
+:root.light-mode {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/web-dashboard/src/index.css` at line 42, Update the CSS selector from
the generic .light-mode to :root.light-mode so the rule explicitly targets the
document root and avoids accidental matches on descendant elements; locate the
existing .light-mode selector in index.css and replace it with :root.light-mode
to increase specificity and align with the issue spec.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@apps/web-dashboard/index.html`:
- Around line 16-26: Wrap the synchronous localStorage reads in a try/catch to
prevent exceptions from aborting inline head scripts: around the loop that uses
storageKeys and calls localStorage.getItem (the storedValue assignment logic),
catch any errors (e.g., SecurityError) and treat them as a non-existent value
(leave storedValue null) so the rest of the script can continue; ensure you only
access localStorage if window and window.localStorage exist and on catch simply
break/continue without throwing.
- Around line 15-36: The script currently defaults to dark when no stored
preference is found; modify the logic that computes shouldUseLightMode (which
uses storageKeys, storedValue, and normalizedValue) to fall back to the OS
preference by checking window.matchMedia('(prefers-color-scheme:
light)').matches when storedValue is falsy/empty, then use that result alongside
the existing normalizedValue checks before calling
document.documentElement.classList.toggle('light-mode', shouldUseLightMode);
ensure the matchMedia branch only runs if no storedValue was discovered so
stored preferences still win.

In `@apps/web-dashboard/src/index.css`:
- Around line 42-65: The .light-mode block only overrides some CSS variables but
many rules still use hardcoded dark colors (notably .skeleton,
::-webkit-scrollbar-thumb, .btn-secondary, .btn-icon:hover, .nav-link:hover,
.glass-card, select/select option, and the entire .auth-shell) so light theme
looks broken; update the stylesheet to replace hardcoded color literals with
semantic custom properties (add vars such as --color-surface-hover,
--color-skeleton-from, --color-skeleton-to, --color-scrollbar-thumb,
--color-select-text, --color-select-bg, etc.), refactor rules that reference
.skeleton, ::-webkit-scrollbar-thumb, .btn-secondary, .btn-icon:hover,
.nav-link:hover, .glass-card, select, and .auth-shell to use those variables,
and then set appropriate light values inside .light-mode so enabling .light-mode
fully switches all surfaces to the light palette.

---

Nitpick comments:
In `@apps/web-dashboard/index.html`:
- Line 17: The storageKeys array (storageKeys) currently contains four different
keys ('theme', 'color-theme', 'colorTheme', 'mode') which can cause divergence;
update the code to use a single canonical key (e.g., 'theme') everywhere the app
reads/writes theme state and remove the other keys from storageKeys, or if those
other keys are for backward compatibility, leave them only for an initial
migration step and add a short comment marking them as legacy and which key is
canonical; ensure any theme toggle component and any read/write helpers
reference the canonical key (storageKeys variable or its consumers) so the app
consistently reads/writes the same key.

In `@apps/web-dashboard/src/index.css`:
- Line 42: Update the CSS selector from the generic .light-mode to
:root.light-mode so the rule explicitly targets the document root and avoids
accidental matches on descendant elements; locate the existing .light-mode
selector in index.css and replace it with :root.light-mode to increase
specificity and align with the issue spec.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3be99773-9dbf-4875-b512-4d98a196bb14

📥 Commits

Reviewing files that changed from the base of the PR and between 0f96f3e and 6058abb.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (2)
  • apps/web-dashboard/index.html
  • apps/web-dashboard/src/index.css

Comment thread apps/web-dashboard/index.html
Comment thread apps/web-dashboard/index.html
Comment thread apps/web-dashboard/src/index.css
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@aliyasyeddd aliyasyeddd changed the title feat: add light mode with CSS variables and prevent FOUC Add light mode with CSS variables and prevent FOUC Apr 19, 2026
@yash-pouranik
Copy link
Copy Markdown
Collaborator

@coderabbitai is this PR ok to merge as a toggle feature that integrates with #114
also the code quality.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 19, 2026

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

Let me examine both PRs and the code changes in detail.


🏁 Script executed:

#!/bin/bash
# Get details of PR `#114`
gh pr view 114 --repo geturbackend/urBackend --json title,body,files,state,additions,deletions

echo "=== PR `#118` Files ==="
gh pr view 118 --repo geturbackend/urBackend --json files,additions,deletions

echo "=== PR `#118` Diff ==="
gh pr diff 118 --repo geturbackend/urBackend

Length of output: 4686


Let me read the ThemeToggle.jsx from PR #114 to verify localStorage key compatibility.


🏁 Script executed:

#!/bin/bash
# Get the ThemeToggle.jsx content from PR `#114`'s branch
gh pr view 114 --repo geturbackend/urBackend --json headRefName | jq -r '.headRefName'

# Fetch the file content via API
gh api repos/geturbackend/urBackend/pulls/114/files --jq '.[] | select(.filename | contains("ThemeToggle")) | .patch'

echo "=== Sidebar.jsx patch from PR `#114` ==="
gh api repos/geturbackend/urBackend/pulls/114/files --jq '.[] | select(.filename | contains("Sidebar")) | .patch'

echo "=== index.css :root variables for completeness ==="
gh api repos/geturbackend/urBackend/contents/apps/web-dashboard/src/index.css --jq '.content' | base64 -d | head -50

Length of output: 5292


@yash-pouranik: Here's a detailed assessment of both PRs.


⚠️ PR #118 is NOT safe to merge as-is — critical key mismatch with PR #114

🔴 Critical Bug: localStorage Key Mismatch

This is the most important finding. PR #114's ThemeToggle.jsx saves the user's choice under the key 'urbackend-theme' with values 'light' or 'dark':

// ThemeToggle.jsx (PR `#114`)
localStorage.setItem('urbackend-theme', newIsDark ? 'dark' : 'light');
const saved = localStorage.getItem('urbackend-theme');

PR #118's FOUC script in index.html scans these keys:

var storageKeys = ['theme', 'color-theme', 'colorTheme', 'mode'];

'urbackend-theme' is completely absent from this list. This means:

  • The FOUC script will never find the preference saved by the toggle.
  • On every page reload, it falls back to prefers-color-scheme — causing the exact flash-of-unstyled-content it was built to prevent, for any user whose OS is set to dark but who toggled the app to light mode.

The fix is straightforward — add 'urbackend-theme' as the first key to check:

- var storageKeys = ['theme', 'color-theme', 'colorTheme', 'mode'];
+ var storageKeys = ['urbackend-theme', 'theme', 'color-theme', 'colorTheme', 'mode'];

🟡 Secondary Code Quality Issues in PR #118

Issue Location Detail
Dead code index.html normalizedValue === 'true' — ThemeToggle never stores 'true'; it stores 'light'/'dark'
Overly broad key scan index.html Scanning 4 generic keys (theme, color-theme, colorTheme, mode) when only urbackend-theme is used
Generic key risk index.html 'mode' is too generic and could match unrelated localStorage entries from other parts of the app
PR checklist PR description Lint, responsiveness, and console error checks are unchecked

✅ What PR #118 Gets Right

  • IIFE pattern in <head> is the correct approach for FOUC prevention — runs synchronously before any render.
  • prefers-color-scheme fallback is correct and good UX.
  • CSS variables are comprehensive and well-organized; all relevant color variables are overridden (dimensions like --sidebar-width don't need to be, and correctly aren't).

✅ PR #114 Code Quality — Good

  • Defensive try/catch around all localStorage and matchMedia calls.
  • Proper accessibility: aria-label and aria-pressed on the toggle button.
  • Correct system preference listener with cleanup in useEffect.
  • getInitialTheme runs synchronously to minimize React-level flash.

Recommended Merge Order

Fix PR `#118` (add 'urbackend-theme' key + clean up dead code)
         ↓
    Merge PR `#118`  ← foundational CSS + FOUC prevention
         ↓
    Merge PR `#114`  ← the toggle UI that uses those CSS vars

Neither PR is complete in isolation#118 without #114 has no UI to toggle; #114 without #118 has no light-mode CSS variables and no FOUC protection. They must land together, in order.

@yash-pouranik
Copy link
Copy Markdown
Collaborator

@coderabbitai I am going to merge #114 and @aliyasyeddd please fix this in next commit.
Theres no issue if toggle will visible and not worked for a night.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 19, 2026

Tip

For best results, initiate chat on the files or code changes.

@yash-pouranik: Understood, that's a reasonable call — having the toggle visible (even if FOUC prevention isn't wired up yet) for a short window is a low-risk tradeoff. 👍

@aliyasyeddd: When you do the follow-up commit on PR #118, the critical fix is a one-liner in apps/web-dashboard/index.html. Change the storageKeys array to put 'urbackend-theme' first (this is the exact key ThemeToggle.jsx from PR #114 writes to):

- var storageKeys = ['theme', 'color-theme', 'colorTheme', 'mode'];
+ var storageKeys = ['urbackend-theme', 'theme', 'color-theme', 'colorTheme', 'mode'];

While you're at it, you can also clean up the two minor quality issues flagged earlier:

  1. Remove the normalizedValue === 'true' branch — the toggle only ever writes 'light' or 'dark', never 'true'.
  2. Consider removing the overly generic 'mode' key from the scan list to avoid accidental matches with unrelated localStorage entries.

@yash-pouranik
Copy link
Copy Markdown
Collaborator

@aliyasyeddd please update this whenever u came on

@aliyasyeddd aliyasyeddd force-pushed the feature/theme-css-fouc branch from 05faf3b to 45c5637 Compare April 19, 2026 16:35
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
apps/web-dashboard/src/index.css (1)

42-65: ⚠️ Potential issue | 🟠 Major

Define the new semantic variables before using them.

Many changed rules now reference custom properties that are not declared in either :root or .light-mode in this file, so declarations like background: var(--color-auth-shell-bg) and color: var(--color-select-text) become invalid. This can break auth surfaces, skeletons, scrollbars, selects, and hover states in both dark and light themes.

Please add dark defaults in :root and light overrides in .light-mode for every newly introduced token, or add safe var(..., fallback) values at each use. This is still in the same theme-tokenization area previously flagged.

Suggested direction
 :root {
   /* Glassmorphism - Darker & Smoother */
   --glass-bg: rgba(10, 10, 10, 0.7);
   --glass-border: rgba(255, 255, 255, 0.05);
   --glass-backdrop: blur(12px);
+
+  --color-glass-card-bg: rgba(255, 255, 255, 0.02);
+  --color-glass-card-border: rgba(255, 255, 255, 0.08);
+  --color-scrollbar-thumb: `#333333`;
+  --color-scrollbar-thumb-hover: `#444444`;
+  --color-surface-hover: rgba(255, 255, 255, 0.05);
+  --color-surface-hover-strong: rgba(255, 255, 255, 0.08);
+  --color-skeleton-from: `#1c1c1c`;
+  --color-skeleton-to: `#2a2a2a`;
+  --color-select-text: `#ffffff`;
+  --color-select-bg: `#0f0f0f`;
+
+  /* Add matching dark defaults for every --color-auth-* / text/divider token used below. */
 }

 .light-mode {
   --color-primary: `#3ECF8E`;
   --color-primary-hover: `#2fb67a`;
@@
   --glass-bg: rgba(255, 255, 255, 0.6);
   --glass-border: rgba(0, 0, 0, 0.08);
   --glass-backdrop: blur(10px);
+
+  --color-glass-card-bg: rgba(0, 0, 0, 0.04);
+  --color-glass-card-border: rgba(0, 0, 0, 0.08);
+  --color-scrollbar-thumb: `#d1d5db`;
+  --color-scrollbar-thumb-hover: `#9ca3af`;
+  --color-surface-hover: rgba(0, 0, 0, 0.04);
+  --color-surface-hover-strong: rgba(0, 0, 0, 0.08);
+  --color-skeleton-from: `#e5e7eb`;
+  --color-skeleton-to: `#f3f4f6`;
+  --color-select-text: `#111111`;
+  --color-select-bg: `#ffffff`;
+
+  /* Add matching light overrides for every --color-auth-* / text/divider token used below. */
 }

Also applies to: 117-119, 217-223, 259-267, 291-293, 340-341, 641-649, 653-955

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/web-dashboard/src/index.css` around lines 42 - 65, The new theme
variables (e.g., --color-auth-shell-bg, --color-select-text and any other tokens
introduced in the diff) are being referenced before they are declared; add
dark-theme defaults in :root and corresponding light overrides in .light-mode
for every newly introduced custom property, or alternatively change each usage
to use var(--token, <fallback>) so there is always a safe fallback; locate
references in the theme-tokenization area and update the :root block and the
.light-mode block (and any other theme blocks) to declare the missing variables
rather than leaving them undefined.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@apps/web-dashboard/src/index.css`:
- Around line 42-65: The new theme variables (e.g., --color-auth-shell-bg,
--color-select-text and any other tokens introduced in the diff) are being
referenced before they are declared; add dark-theme defaults in :root and
corresponding light overrides in .light-mode for every newly introduced custom
property, or alternatively change each usage to use var(--token, <fallback>) so
there is always a safe fallback; locate references in the theme-tokenization
area and update the :root block and the .light-mode block (and any other theme
blocks) to declare the missing variables rather than leaving them undefined.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 61d4331c-6ab9-48e7-b115-948ca8fbfe45

📥 Commits

Reviewing files that changed from the base of the PR and between 6058abb and 45c5637.

📒 Files selected for processing (2)
  • apps/web-dashboard/index.html
  • apps/web-dashboard/src/index.css
✅ Files skipped from review due to trivial changes (1)
  • apps/web-dashboard/index.html

@aliyasyeddd
Copy link
Copy Markdown
Contributor Author

@yash-pouranik merged the changes

@yash-pouranik
Copy link
Copy Markdown
Collaborator

@coderabbitai Please check if we can merge to main? its good to me

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 19, 2026

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

Let me pull the latest state of PR #118 to verify the fix.


🏁 Script executed:

#!/bin/bash
echo "=== Current PR `#118` diff ==="
gh pr diff 118 --repo geturbackend/urBackend

echo "=== PR `#118` status ==="
gh pr view 118 --repo geturbackend/urBackend --json state,mergeable,mergeStateStatus,reviewDecision,commits

echo "=== Latest commit messages ==="
gh pr view 118 --repo geturbackend/urBackend --json commits --jq '.commits[-3:] | .[] | {sha: .oid, message: .messageHeadline}'

Length of output: 11913


Good progress — the critical fix and dead code cleanup are confirmed. Let me do one more check on the CSS variables before giving the green light.


🏁 Script executed:

#!/bin/bash
# Fetch the full index.css from the PR branch to check :root variable definitions
BRANCH=$(gh pr view 118 --repo geturbackend/urBackend --json headRefName --jq '.headRefName')
echo "Branch: $BRANCH"

gh api "repos/geturbackend/urBackend/contents/apps/web-dashboard/src/index.css?ref=$BRANCH" \
  --jq '.content' | base64 -d | head -120

Length of output: 118


🏁 Script executed:

#!/bin/bash
# Use the head commit SHA directly
HEAD_SHA=$(gh pr view 118 --repo geturbackend/urBackend --json headRefOid --jq '.headRefOid')
echo "Head SHA: $HEAD_SHA"

gh api "repos/geturbackend/urBackend/contents/apps/web-dashboard/src/index.css?ref=$HEAD_SHA" \
  --jq '.content' | base64 -d | head -130

Length of output: 3049


@yash-pouranik: The FOUC fix is clean and correct ✅ — localStorage.getItem("urbackend-theme") is now used directly. However, I found a new blocking issue in the CSS that would break dark mode on merge.


🔴 Blocking: ~30 new CSS variables used but never defined in :root

The PR replaces hardcoded dark-mode colour values with CSS variables (good intention), but none of those new variables are defined in :root. In dark mode (the default), undefined CSS variables resolve to empty/invalid, which means styles silently vanish.

Affected areas and the undefined variables:

Area Undefined variables
Glass card --color-glass-card-bg, --color-glass-card-border
Scrollbars --color-scrollbar-thumb, --color-scrollbar-thumb-hover
Buttons / hover states --color-surface-hover, --color-surface-hover-strong
Skeleton loader --color-skeleton-from, --color-skeleton-to
Select dropdowns --color-select-text, --color-select-bg
Auth shell --color-auth-shell-bg, --color-auth-ambient-secondary
Auth brand --color-auth-brand-mark-bg/text, --color-auth-brand-text
Auth mode pill --color-auth-mode-bg, --color-auth-mode-text
Auth typography --color-auth-heading, --color-text-soft, --color-text-faint, --color-text-placeholder, --color-auth-label
Auth inputs --color-auth-input-border, --color-auth-input-bg, --color-auth-icon, --color-auth-input-toggle-text/hover
Auth links/dividers --color-auth-link, --color-auth-link-hover, --color-auth-divider-text, --color-divider
Auth password check --color-auth-password-text/passed/dot/shadow
Auth footer --color-border-subtle, --color-auth-footer-text, --color-auth-footer-note

@aliyasyeddd — all of these need dark-mode values added to :root in index.css. Example for a few:

:root {
  /* ... existing vars ... */

  /* Glass card */
  --color-glass-card-bg: rgba(255, 255, 255, 0.02);
  --color-glass-card-border: rgba(255, 255, 255, 0.08);

  /* Scrollbar */
  --color-scrollbar-thumb: `#333`;
  --color-scrollbar-thumb-hover: `#444`;

  /* Surfaces */
  --color-surface-hover: rgba(255, 255, 255, 0.05);
  --color-surface-hover-strong: rgba(255, 255, 255, 0.08);

  /* Skeleton */
  --color-skeleton-from: `#1c1c1c`;
  --color-skeleton-to: `#2a2a2a`;

  /* Select */
  --color-select-text: `#ffffff`;
  --color-select-bg: `#0f0f0f`;

  /* Auth */
  --color-auth-shell-bg: `#050505`;
  --color-auth-ambient-secondary: rgba(255, 255, 255, 0.03);
  /* ... and so on for the rest */
}

The .light-mode block can then override whichever of these need light values.


Also noted: mergeStateStatus is UNSTABLE, suggesting CI checks are failing — worth verifying that too once the CSS is fixed.

@yash-pouranik
Copy link
Copy Markdown
Collaborator

@aliyasyeddd ??

@aliyasyeddd
Copy link
Copy Markdown
Contributor Author

@yash-pouranik i am currently making changes

@yash-pouranik
Copy link
Copy Markdown
Collaborator

@coderabbitai Bro I think all done?

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 20, 2026

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

Let me pull the latest state of PR #118 to verify.


🏁 Script executed:

#!/bin/bash
echo "=== PR `#118` status ==="
gh pr view 118 --repo geturbackend/urBackend --json state,mergeable,mergeStateStatus,reviewDecision,commits --jq '{state,mergeable,mergeStateStatus,reviewDecision}'

echo ""
echo "=== Latest commit messages ==="
gh pr view 118 --repo geturbackend/urBackend --json commits --jq '.commits[-5:] | .[] | {sha: .oid[0:7], message: .messageHeadline}'

echo ""
echo "=== index.css :root block (first 200 lines) ==="
HEAD_SHA=$(gh pr view 118 --repo geturbackend/urBackend --json headRefOid --jq '.headRefOid')
echo "Head SHA: $HEAD_SHA"
gh api "repos/geturbackend/urBackend/contents/apps/web-dashboard/src/index.css?ref=$HEAD_SHA" \
  --jq '.content' | base64 -d | head -200

echo ""
echo "=== Check for undefined variables: look for new vars used in CSS but missing from :root ==="
gh api "repos/geturbackend/urBackend/contents/apps/web-dashboard/src/index.css?ref=$HEAD_SHA" \
  --jq '.content' | base64 -d > /tmp/index.css

# Extract all var(--xxx) usages
grep -oP 'var\(--[a-zA-Z0-9_-]+\)' /tmp/index.css | sort -u > /tmp/used_vars.txt

# Extract all defined --xxx: in :root
grep -oP '^\s+--[a-zA-Z0-9_-]+' /tmp/index.css | tr -d ' ' | sort -u > /tmp/defined_vars.txt

echo "=== Used variables ==="
cat /tmp/used_vars.txt

echo ""
echo "=== Defined variables ==="
cat /tmp/defined_vars.txt

echo ""
echo "=== Variables used but NOT defined anywhere in :root or .light-mode ==="
# Extract all var references without var() wrapper
grep -oP 'var\(--[a-zA-Z0-9_-]+\)' /tmp/index.css | grep -oP '--[a-zA-Z0-9_-]+' | sort -u > /tmp/used_bare.txt
# Extract all defined variable names
grep -oP '^\s+--[a-zA-Z0-9_-]+(?=\s*:)' /tmp/index.css | tr -d ' ' | sort -u > /tmp/defined_bare.txt
comm -23 /tmp/used_bare.txt /tmp/defined_bare.txt

Length of output: 9565


@yash-pouranik: Yes, PR #118 is clear to merge 🟢 — here's what the latest check confirms:

Check Status
mergeStateStatus CLEAN (CI passing)
mergeable MERGEABLE
urbackend-theme localStorage key ✅ Present in FOUC script
normalizedValue === 'true' dead code ✅ Removed
All ~30 new CSS variables defined in :root (dark) ✅ Every single one is defined
.light-mode overrides for all variables ✅ Complete
Zero undefined CSS variables ✅ Used list and defined list match perfectly

@aliyasyeddd did a thorough job — all the dark-mode :root values (glass card, scrollbars, skeleton, auth tokens, etc.) are now properly defined, and .light-mode overrides all of them correctly. The PR is solid.

( ˶°ᗜ°˶)ᐝ

@yash-pouranik
Copy link
Copy Markdown
Collaborator

@coderabbitai
What to level this PR?

Level 1- 3pt
level 2- 5pt
level 3 - 10pt

Altough the changes were of level 1 but I think she cooperated so well during the PR so we should consider level2 ? what say

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 20, 2026

Tip

For best results, initiate chat on the files or code changes.

@yash-pouranik: Honestly, Level 2 is fair on technical merit alone — it's not just a simple CSS tweak. Here's the breakdown:

Technical scope (leans Level 1→2 boundary):

Task Complexity
Full CSS variable theming system (152 lines) Medium
FOUC prevention IIFE (requires understanding browser rendering pipeline) Medium
Defining ~30 new :root dark-mode variables across glass, auth, skeleton, scrollbar, etc. Medium
Coordinating localStorage key compatibility with PR #114 Medium

This isn't a Level 3 (no new feature architecture, no backend, no complex logic), but it's solidly above a trivial Level 1 change like fixing a typo or tweaking a colour value.

Cooperation factor:

  • Picked up the 'urbackend-theme' key fix quickly.
  • Came back and defined all ~30 missing :root variables when flagged — that was a non-trivial amount of work.
  • Left the PR in a CLEAN/mergeable state.

Recommendation: Level 2 (5pt) ✅ — justified both on scope and responsiveness. The cooperation tipped a borderline call into a clear one.

@yash-pouranik
Copy link
Copy Markdown
Collaborator

Ok thanky @coderabbitai for the suggestions
Thank You @aliyasyeddd for the PR and nice cooperation. Hope to see more contributions from you on something big.
Also do Star the REPO.
All the best.

@yash-pouranik yash-pouranik merged commit 4e93ee7 into geturbackend:main Apr 20, 2026
7 checks passed
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 20, 2026

Tip

For best results, initiate chat on the files or code changes.

@yash-pouranik: Happy to help! 🙌 It was a well-managed review cycle — the issue was caught early, fixed cleanly, and the PR landed in great shape. Best of luck with the next features on the dashboard, and congrats to @aliyasyeddd on a solid first contribution! 🚀

@yash-pouranik yash-pouranik added enhancement New feature or request frontend NSOC'26 level-2 5 - points labels Apr 20, 2026
@aliyasyeddd
Copy link
Copy Markdown
Contributor Author

@yash-pouranik Thank you so much for the kind words! I really appreciate the support and guidance throughout the process. I’m excited to contribute more and take on bigger tasks going forward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request frontend level-2 5 - points NSOC'26

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Frontend] Implementation of Dark/Light Mode Toggle **Difficulty**: Beginner | **Area**: apps/web-dashboard

2 participants