Skip to content

Conversation

@NicholasCloud4
Copy link

@NicholasCloud4 NicholasCloud4 commented Aug 28, 2025

Adjusted the icon for the sun and changed the color when it is visible during hover

Summary by CodeRabbit

  • Refactor

    • Reorganized the Invoice page into a split layout with a clearer form (Company, Client, Comment, Currency/Tax, Items) and an improved preview (company info, client, items, totals, download section).
    • Streamlined page structure and navigation for better readability.
  • New Features

    • Added a contextual hover effect for the theme toggle that adapts to the active theme.
  • Style

    • Polished sun icon visuals; minor icon attribute adjustments.
    • Introduced enhanced hover styling for the theme toggle.

@vercel
Copy link

vercel bot commented Aug 28, 2025

@NicholasCloud4 is attempting to deploy a commit to the Eshita's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link

coderabbitai bot commented Aug 28, 2025

Walkthrough

Refactors markup in index.html and invoice.html for modular structure and consistent sections; retains existing navigation and logic. Adds a class toggle in script.js to reflect theme state on the toggle button. Introduces a CSS hover style for the sun-visible state. Other changes are formatting/whitespace.

Changes

Cohort / File(s) Change Summary
HTML structure and layout refactor
index.html, invoice.html
Normalize head/body structure and indentation; reorganize invoice layout into header/nav, main container, split form/preview, and renamed sections (e.g., Comment). Preserve existing links, items table, and Download PDF placement adjusted. Update sun SVG to stroke-based; minor moon SVG attribute tweak.
Theme toggle behavior
script.js
In toggleThemeIcons, also toggles sun-visible class on the theme-toggle button based on isDark; otherwise formatting/whitespace only.
Theme toggle hover styles
style.css
Add selector .theme-toggle-btn.sun-visible:hover with color, transform, and subtle background; remaining diffs are whitespace-only.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant Button as Theme Toggle Button
  participant Script as script.js
  participant DOM as Document
  participant CSS as CSS Rules

  User->>Button: Click
  Button->>Script: toggleTheme()
  Script->>DOM: Toggle data-theme (dark/light)
  Script->>DOM: toggleThemeIcons(isDark)
  Note over Script,DOM: New: add/remove <sun-visible> on toggle button
  DOM-->>CSS: Updated classes and attributes
  CSS-->>User: Apply hover style when .sun-visible:hover
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Suggested reviewers

  • versac3s

Poem

I twitched my ears at the rising sun,
A stroke of light—theme toggles, done! ☀️
Invoice fields lined neat in rows,
Preview gleams as total grows.
With a hop and click, I softly cheer—
CSS whispers, “Hover here.”
Downloads nibble close and near.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbit in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbit in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbit gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbit read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbit help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbit ignore or @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbit summary or @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbit or @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@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: 4

🧹 Nitpick comments (2)
script.js (1)

20-23: Consider CSS-only icon toggling to reduce JS DOM writes

You can let CSS handle visibility based on body.dark-theme and avoid inline style mutations. Keeps state in one place.

Add to CSS (in the stylesheet used by both pages):

.theme-toggle-btn .sun-icon { display: none; }
.theme-toggle-btn .moon-icon { display: inline; }
.dark-theme .theme-toggle-btn .sun-icon { display: inline; }
.dark-theme .theme-toggle-btn .moon-icon { display: none; }

Then you can remove the moonIcon/sunIcon display writes here.

index.html (1)

8-8: Ensure hover color rule exists in home.css too

The new .theme-toggle-btn.sun-visible:hover rule was added to style.css, but this page loads home.css. If home.css lacks that selector, the hover color change won’t apply here.

Options:

  • Duplicate the rule in home.css, or
  • Load a shared stylesheet used by both pages for the theme-toggle rules.
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 311be7c and b84a4a9.

📒 Files selected for processing (4)
  • index.html (1 hunks)
  • invoice.html (1 hunks)
  • script.js (3 hunks)
  • style.css (4 hunks)
🔇 Additional comments (1)
script.js (1)

43-45: LGTM: theme state applied and icon class sync’d

Initial apply + click handler keep icons and hover styling in sync.

Also applies to: 61-62

Comment on lines +26 to +44
<button id="theme-toggle" class="theme-toggle-btn">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="currentColor"
class="moon-icon">
<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="sun-icon"
style="display: none;">
<circle cx="12" cy="12" r="5" fill="currentColor" />
<line x1="12" y1="1" x2="12" y2="4" />
<line x1="12" y1="20" x2="12" y2="23" />
<line x1="1" y1="12" x2="4" y2="12" />
<line x1="20" y1="12" x2="23" y2="12" />
<line x1="4.22" y1="4.22" x2="6.36" y2="6.36" />
<line x1="17.64" y1="17.64" x2="19.78" y2="19.78" />
<line x1="4.22" y1="19.78" x2="6.36" y2="17.64" />
<line x1="17.64" y1="6.36" x2="19.78" y2="4.22" />
</svg>

Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Add accessible label/state to the theme toggle and hide SVGs from AT

This makes the control understandable to screen readers while keeping the SVGs decorative.

-      <button id="theme-toggle" class="theme-toggle-btn">
+      <button
+        id="theme-toggle"
+        class="theme-toggle-btn"
+        aria-label="Switch to dark mode"
+        aria-pressed="false"
+        title="Switch to dark mode">
         <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="currentColor"
-          class="moon-icon">
+          class="moon-icon" aria-hidden="true" focusable="false">
           <path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path>
         </svg>
         <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none"
-          stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="sun-icon"
-          style="display: none;">
+          stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="sun-icon"
+          style="display: none;" aria-hidden="true" focusable="false">
           <circle cx="12" cy="12" r="5" fill="currentColor" />
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<button id="theme-toggle" class="theme-toggle-btn">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="currentColor"
class="moon-icon">
<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="sun-icon"
style="display: none;">
<circle cx="12" cy="12" r="5" fill="currentColor" />
<line x1="12" y1="1" x2="12" y2="4" />
<line x1="12" y1="20" x2="12" y2="23" />
<line x1="1" y1="12" x2="4" y2="12" />
<line x1="20" y1="12" x2="23" y2="12" />
<line x1="4.22" y1="4.22" x2="6.36" y2="6.36" />
<line x1="17.64" y1="17.64" x2="19.78" y2="19.78" />
<line x1="4.22" y1="19.78" x2="6.36" y2="17.64" />
<line x1="17.64" y1="6.36" x2="19.78" y2="4.22" />
</svg>
<button
id="theme-toggle"
class="theme-toggle-btn"
aria-label="Switch to dark mode"
aria-pressed="false"
title="Switch to dark mode">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="currentColor"
class="moon-icon" aria-hidden="true" focusable="false">
<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="sun-icon"
style="display: none;" aria-hidden="true" focusable="false">
<circle cx="12" cy="12" r="5" fill="currentColor" />
<line x1="12" y1="1" x2="12" y2="4" />
<line x1="12" y1="20" x2="12" y2="23" />
<line x1="1" y1="12" x2="4" y2="12" />
<line x1="20" y1="12" x2="23" y2="12" />
<line x1="4.22" y1="4.22" x2="6.36" y2="6.36" />
<line x1="17.64" y1="17.64" x2="19.78" y2="19.78" />
<line x1="4.22" y1="19.78" x2="6.36" y2="17.64" />
<line x1="17.64" y1="6.36" x2="19.78" y2="4.22" />
</svg>
🤖 Prompt for AI Agents
index.html lines 26-44: the theme toggle button lacks an accessible label and
state and the decorative SVGs are exposed to assistive tech; add an aria-label
(e.g., "Toggle theme") or include visually hidden text inside the button, add an
explicit state attribute such as aria-pressed (updated dynamically to reflect
current theme), and mark both SVG icons as decorative (aria-hidden="true" and
focusable="false") so screen readers ignore them; ensure any JS that switches
icons also updates aria-pressed (true/false) to keep AT in sync.

Comment on lines +27 to +45
<button id="theme-toggle" class="theme-toggle-btn">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="currentColor"
class="moon-icon">
<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="sun-icon"
style="display: none;">
<circle cx="12" cy="12" r="5" fill="currentColor" />
<line x1="12" y1="1" x2="12" y2="4" />
<line x1="12" y1="20" x2="12" y2="23" />
<line x1="1" y1="12" x2="4" y2="12" />
<line x1="20" y1="12" x2="23" y2="12" />
<line x1="4.22" y1="4.22" x2="6.36" y2="6.36" />
<line x1="17.64" y1="17.64" x2="19.78" y2="19.78" />
<line x1="4.22" y1="19.78" x2="6.36" y2="17.64" />
<line x1="17.64" y1="6.36" x2="19.78" y2="4.22" />
</svg>
</button>
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Apply the same a11y improvements to the theme toggle

Mirror the ARIA fixes here and hide SVGs from AT.

-      <button id="theme-toggle" class="theme-toggle-btn">
+      <button
+        id="theme-toggle"
+        class="theme-toggle-btn"
+        aria-label="Switch to dark mode"
+        aria-pressed="false"
+        title="Switch to dark mode">
         <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="currentColor"
-          class="moon-icon">
+          class="moon-icon" aria-hidden="true" focusable="false">
           <path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path>
         </svg>
         <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none"
-          stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="sun-icon"
-          style="display: none;">
+          stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="sun-icon"
+          style="display: none;" aria-hidden="true" focusable="false">
           <circle cx="12" cy="12" r="5" fill="currentColor" />
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<button id="theme-toggle" class="theme-toggle-btn">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="currentColor"
class="moon-icon">
<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="sun-icon"
style="display: none;">
<circle cx="12" cy="12" r="5" fill="currentColor" />
<line x1="12" y1="1" x2="12" y2="4" />
<line x1="12" y1="20" x2="12" y2="23" />
<line x1="1" y1="12" x2="4" y2="12" />
<line x1="20" y1="12" x2="23" y2="12" />
<line x1="4.22" y1="4.22" x2="6.36" y2="6.36" />
<line x1="17.64" y1="17.64" x2="19.78" y2="19.78" />
<line x1="4.22" y1="19.78" x2="6.36" y2="17.64" />
<line x1="17.64" y1="6.36" x2="19.78" y2="4.22" />
</svg>
</button>
<button
id="theme-toggle"
class="theme-toggle-btn"
aria-label="Switch to dark mode"
aria-pressed="false"
title="Switch to dark mode">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="currentColor"
class="moon-icon" aria-hidden="true" focusable="false">
<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="sun-icon"
style="display: none;" aria-hidden="true" focusable="false">
<circle cx="12" cy="12" r="5" fill="currentColor" />
<line x1="12" y1="1" x2="12" y2="4" />
<line x1="12" y1="20" x2="12" y2="23" />
<line x1="1" y1="12" x2="4" y2="12" />
<line x1="20" y1="12" x2="23" y2="12" />
<line x1="4.22" y1="4.22" x2="6.36" y2="6.36" />
<line x1="17.64" y1="17.64" x2="19.78" y2="19.78" />
<line x1="4.22" y1="19.78" x2="6.36" y2="17.64" />
<line x1="17.64" y1="6.36" x2="19.78" y2="4.22" />
</svg>
</button>
🤖 Prompt for AI Agents
In invoice.html around lines 27 to 45, the theme toggle button lacks ARIA
attributes and its decorative SVGs are exposed to assistive tech; add an
accessible label to the button (e.g., aria-label="Toggle theme" or aria-pressed
toggle state as appropriate) and mark both SVG icons as presentation by adding
aria-hidden="true" and focusable="false" (and remove any text content inside
them for AT), optionally include a visually-hidden live text node if you need to
announce state changes; ensure the button remains keyboard-focusable and that
only the button element conveys accessible state to screen readers.

Comment on lines +24 to 33
const themeToggleBtn = document.getElementById("theme-toggle");
if (!themeToggleBtn) return;

// Add a class to the button for styling hover
if (isDark) {
themeToggleBtn.classList.add("sun-visible");
} else {
themeToggleBtn.classList.remove("sun-visible");
}
}
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Add ARIA state/label to the theme toggle for accessibility

Expose the toggle state and the resulting action to screen readers.

   const themeToggleBtn = document.getElementById("theme-toggle");
   if (!themeToggleBtn) return;

   // Add a class to the button for styling hover
   if (isDark) {
     themeToggleBtn.classList.add("sun-visible");
   } else {
     themeToggleBtn.classList.remove("sun-visible");
   }
+  // A11y: reflect state and action
+  themeToggleBtn.setAttribute("aria-pressed", String(isDark));
+  const nextLabel = isDark ? "Switch to light mode" : "Switch to dark mode";
+  themeToggleBtn.setAttribute("aria-label", nextLabel);
+  themeToggleBtn.setAttribute("title", nextLabel);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const themeToggleBtn = document.getElementById("theme-toggle");
if (!themeToggleBtn) return;
// Add a class to the button for styling hover
if (isDark) {
themeToggleBtn.classList.add("sun-visible");
} else {
themeToggleBtn.classList.remove("sun-visible");
}
}
const themeToggleBtn = document.getElementById("theme-toggle");
if (!themeToggleBtn) return;
// Add a class to the button for styling hover
if (isDark) {
themeToggleBtn.classList.add("sun-visible");
} else {
themeToggleBtn.classList.remove("sun-visible");
}
// A11y: reflect state and action
themeToggleBtn.setAttribute("aria-pressed", String(isDark));
const nextLabel = isDark ? "Switch to light mode" : "Switch to dark mode";
themeToggleBtn.setAttribute("aria-label", nextLabel);
themeToggleBtn.setAttribute("title", nextLabel);
}
🤖 Prompt for AI Agents
In script.js around lines 24-33, the theme-toggle button is not exposing its
state/action to assistive tech; add an accessible state and label by setting
aria-pressed (true when dark, false when light) and an appropriate aria-label
(e.g., "Switch to light theme" when isDark is true, "Switch to dark theme" when
false). Apply these attributes when initializing the button (in the shown block)
and update them inside the theme toggle handler whenever the theme changes; if
the element is not a native button ensure it has role="button" and is
keyboard-focusable.

Comment on lines +152 to +156
.theme-toggle-btn.sun-visible:hover {
color: #f59e0b;
transform: scale(1.1) rotate(15deg);
background-color: rgba(253, 230, 138, 0.2);
}
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Mirror hover styling on keyboard focus for accessibility

Add a :focus-visible variant so keyboard users get the same affordance. Include an outline for contrast.

 .theme-toggle-btn.sun-visible:hover {
   color: #f59e0b;
   transform: scale(1.1) rotate(15deg);
   background-color: rgba(253, 230, 138, 0.2);
 }
+
+.theme-toggle-btn.sun-visible:focus-visible {
+  color: #f59e0b;
+  transform: scale(1.1) rotate(15deg);
+  background-color: rgba(253, 230, 138, 0.2);
+  outline: 2px solid #f59e0b;
+  outline-offset: 2px;
+}
🤖 Prompt for AI Agents
In style.css around lines 152 to 156, the .theme-toggle-btn.sun-visible hover
rules are not applied to keyboard focus; add a matching :focus-visible selector
that duplicates the color, transform and background-color rules and also add a
visible high-contrast outline and outline-offset for accessibility (use
:focus-visible rather than :focus so only keyboard users see it); ensure the
visual treatment matches the hover affordance and include an outline color that
contrasts with the background.

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.

1 participant