Skip to content

CSS cleanup and light mode - #70

Merged
gerrywastaken merged 6 commits into
mainfrom
css-cleanup-and-light-mode
Dec 16, 2025
Merged

CSS cleanup and light mode#70
gerrywastaken merged 6 commits into
mainfrom
css-cleanup-and-light-mode

Conversation

@gerrywastaken

Copy link
Copy Markdown
Owner

This PR does too much... I know, but it is worth it and not worth the PR refactor

It gives us light mode support and does a massive CSS cleanup to follow better design and engineering practices to make maintenance easier.

It Is Essentially 3 PRs, but at least They Are 3 separate Commits.


Fix CSS issues: tokens, reduced-motion, hardcoded values

  • Add z-index scale and transition duration tokens
  • Add toggle switch semantic tokens for theming
  • Fix hardcoded colors in phrase-tag and toggle-slider
  • Add prefers-reduced-motion support for accessibility
  • Remove deprecated -webkit-overflow-scrolling vendor prefix
  • Update z-index values to use design tokens
  • Add explanatory comment for dark mode duplication

Move CSS files to styles directory with guidelines

  • Consolidate all CSS into src/styles/ for better organization
  • Update HTML file references to new paths
  • Update vite.config.ts build copy logic
  • Add CLAUDE.md with CSS best practices and known issues

Add light mode support with auto/manual theme switching

Implements a theme system for the settings and popup UI with three modes:

  • Light: Force light mode
  • Auto: Follow system preferences (default)
  • Dark: Force dark mode

Changes:

  • Added theme.ts: Core theme detection and application logic
  • Updated types.ts: Added theme field to StorageData
  • Updated settings.css & popup.css: Added data-theme attribute support
  • Updated settings.html: Added Appearance section with theme selector
  • Updated settings.ts: Integrated theme initialization and event handlers
  • Updated popup.ts: Added theme initialization
  • Updated browser-mock.ts: Added theme to mock storage

The UI now respects user theme preference while maintaining backward
compatibility with system theme detection via media queries.

claude and others added 3 commits December 16, 2025 15:28
Implements a theme system for the settings and popup UI with three modes:
- Light: Force light mode
- Auto: Follow system preferences (default)
- Dark: Force dark mode

Changes:
- Added theme.ts: Core theme detection and application logic
- Updated types.ts: Added theme field to StorageData
- Updated settings.css & popup.css: Added data-theme attribute support
- Updated settings.html: Added Appearance section with theme selector
- Updated settings.ts: Integrated theme initialization and event handlers
- Updated popup.ts: Added theme initialization
- Updated browser-mock.ts: Added theme to mock storage

The UI now respects user theme preference while maintaining backward
compatibility with system theme detection via media queries.
- Consolidate all CSS into src/styles/ for better organization
- Update HTML file references to new paths
- Update vite.config.ts build copy logic
- Add CLAUDE.md with CSS best practices and known issues
- Add z-index scale and transition duration tokens
- Add toggle switch semantic tokens for theming
- Fix hardcoded colors in phrase-tag and toggle-slider
- Add prefers-reduced-motion support for accessibility
- Remove deprecated -webkit-overflow-scrolling vendor prefix
- Update z-index values to use design tokens
- Add explanatory comment for dark mode duplication
@github-actions

Copy link
Copy Markdown

🤖 Hi @gerrywastaken, I've received your request, and I'm working on it now! You can track my progress in the logs for more details.

@gerrywastaken gerrywastaken changed the title Css cleanup and light mode CSS cleanup and light mode Dec 16, 2025
@github-actions

github-actions Bot commented Dec 16, 2025

Copy link
Copy Markdown

ext: makeitpop-build-2ba77eb.zip
sha: 2ba77eb

@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello @gerrywastaken, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the extension's styling infrastructure by introducing light mode support and performing a major CSS cleanup. The changes aim to improve maintainability, consistency, and user experience by adopting a robust design token system, reorganizing stylesheets for better modularity, and providing users with theme customization options.

Highlights

  • Comprehensive CSS Refactor: Implemented a two-tier token system for colors, added z-index and transition duration tokens, fixed hardcoded color values in components like phrase-tag and toggle-slider, and introduced prefers-reduced-motion support for accessibility.
  • CSS File Reorganization: Consolidated all CSS files into a new src/styles/ directory for better organization, updated all HTML references and build configurations, and added CLAUDE.md with detailed CSS best practices and known issues.
  • Light Mode Support: Introduced a theme system allowing users to switch between Light, Auto (system preference), and Dark modes for the extension's UI. This includes core theme detection and application logic in theme.ts, an updated StorageData interface, and UI integration in the settings and popup.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This is an excellent and substantial pull request that significantly improves the project's CSS architecture and adds a valuable theme-switching feature. The move to a token-based design system in shared.css is a fantastic step for maintainability, and the new CLAUDE.md style guide will help keep the CSS consistent going forward. The light/dark mode implementation is well-thought-out, correctly handling both user preference and system settings.

I've found a couple of issues, one high-severity issue related to a redundant initialization call in the new theme logic, which could lead to duplicate event listeners, and a medium-severity suggestion to improve how theme changes are reflected in the UI. My review comments include fixes and suggestions.

Overall, this is a high-quality contribution that modernizes the frontend codebase. Great work!

Comment thread src/settings/settings.ts Outdated
// Initialize theme system
async function initThemeUI() {
// Initialize theme engine
await initTheme();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

This call to initTheme() is redundant. The theme is already initialized in the main IIFE at the bottom of the file (line 660). Calling initTheme() twice will attach duplicate event listeners for system theme changes and storage changes, which can lead to unnecessary processing and potential bugs. Please remove this line.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

will fix

Comment on lines +68 to +90
export function updatePreviewDefaults(theme: 'light' | 'dark') {
currentEffectiveTheme = theme;

// Find all group cards and update their preview toggle to match the new theme
const cards = document.querySelectorAll('#groupsList .card');
cards.forEach(card => {
const lightBtn = card.querySelector('.mode-toggle-btn:first-child') as HTMLElement;
const darkBtn = card.querySelector('.mode-toggle-btn:last-child') as HTMLElement;
if (lightBtn && darkBtn) {
// Update button states
lightBtn.classList.toggle('active', theme === 'light');
darkBtn.classList.toggle('active', theme === 'dark');

// Switch preview visibility
const previews = card.querySelectorAll('.mode-preview');
previews.forEach(p => {
const preview = p as HTMLElement;
const previewMode = preview.getAttribute('data-mode');
preview.classList.toggle('active', previewMode === theme);
});
}
});
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The updatePreviewDefaults function manually queries and iterates over all group cards in the DOM to update their styles when the theme changes. A more performant and idiomatic CSS approach would be to leverage the data-theme attribute on the <html> element, which is already being set by your new theme logic. This would eliminate the need for this JavaScript-based DOM manipulation.

For example, you could replace the logic here with CSS rules in settings.css:

/* Show the correct preview based on the theme */
.mode-preview {
  display: none;
}

[data-theme='light'] .mode-preview[data-mode='light'],
[data-theme='dark'] .mode-preview[data-mode='dark'] {
  display: block;
}

/* Style the active toggle button */
[data-theme='light'] .mode-toggle-btn:first-child,
[data-theme='dark'] .mode-toggle-btn:last-child {
  /* ... active styles ... */
  background: var(--card-bg);
  color: var(--text-color);
}

This would make the component more declarative and less reliant on imperative JavaScript for styling.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Invalid, the previews can be set independent of the user's current theme.

You misunderstood the feature. The light/dark preview toggle in group cards is for previewing highlight colors on target websites - it's independent of the settings UI theme. A user in dark mode UI might want to preview how their highlights look on a light-mode website. Tying preview visibility to [data-theme] would break this functionality.

@github-actions

Copy link
Copy Markdown

🤖 I'm sorry @gerrywastaken, but I was unable to process your request. Please see the logs for more details.

initTheme() is already called in the main IIFE before initThemeUI(),
so calling it again inside initThemeUI() attached duplicate event
listeners for system theme and storage changes.
Use --transition-normal (0.2s) and --transition-slow (0.3s) tokens
throughout shared.css and settings.css for consistency.
Repository owner deleted a comment from chatgpt-codex-connector Bot Dec 16, 2025
@gerrywastaken

Copy link
Copy Markdown
Owner Author

@codex is there anything user facing and relevant that should be added to the changelog. If so please create a pr

@chatgpt-codex-connector

Copy link
Copy Markdown

Summary

  • Added changelog entries for the new Light/Auto/Dark theme selector covering settings and popup UIs. CHANGELOG.mdL8-L10
  • Documented accessibility and visual polish improvements from honoring prefers-reduced-motion and adopting the refreshed design tokens. CHANGELOG.mdL9-L10

Testing

  • ⚠️ Not run (not requested)

View task →

@gerrywastaken
gerrywastaken merged commit 065e9da into main Dec 16, 2025
2 checks passed
@gerrywastaken
gerrywastaken deleted the css-cleanup-and-light-mode branch December 16, 2025 19:02
@gerrywastaken
gerrywastaken restored the css-cleanup-and-light-mode branch December 16, 2025 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants