Skip to content

CSS Refactor#32

Open
shsagir wants to merge 2 commits into
gaffner:mainfrom
shsagir:fix-issue-14
Open

CSS Refactor#32
shsagir wants to merge 2 commits into
gaffner:mainfrom
shsagir:fix-issue-14

Conversation

@shsagir

@shsagir shsagir commented May 11, 2026

Copy link
Copy Markdown

IMPORTANT: Opus 4.7 VIBE coding

CSS & frontend refactor

Cleanup pass across the Frontend/ tree — no behavior changes, just dedup and dead-code removal.

CSS

  • .error consolidated — was defined twice; now lives in components.css. style.css keeps a single #error { display: none; } override for the Control Panel placeholder.
  • .add-button collapsed into .btn-primary — added a .btn-primary--sm modifier in components.css for the smaller padding/font variant; removed the duplicate block from style.css.
  • Dead rules removed from style.css:
    • .success-message, .error-message {} empty stub
    • Duplicate .empty-state (used hardcoded color)
    • Merged two .room-number definitions into one
    • Fixed broken @media (max-width: 1200px) block with stray }
    • .dark-mode .logo { filter: brightness(1); } — identity filter, no-op
  • Verified remaining .dark-mode .X overrides — all 14 have legitimately different values from their light-mode bases, kept as-is.

Shared page chrome

  • New Frontend/js/chrome.js centralizes:
    • Dark-mode bootstrap (read localStorage, apply .dark-mode to <body>)
    • Toggle-switch wiring (only fires if #dark-mode-toggle exists on the page)
    • Hamburger menu wiring (only fires if .menu-button / .sidebar exist)
  • Removed duplicated dark-mode init scripts from admin.html, chat.html, credits.html, premium.html, whats_new.html, and index.html (also dropped the menu-toggle block from index.html).

<head> consistency

  • Added <script src="js/chrome.js" defer></script> to all six pages.
  • Added the missing favicon <link> to credits.html.

Backend

  • Added a /favicon.ico route in server.py that redirects to /Frontend/Images/favicon.ico — silences the browser's root-level favicon 404s.

@Imran-imtiaz48 Imran-imtiaz48 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.

The CSS is clean, structured, and easy to maintain. I like the consistent sectioning and the way the styles are grouped logically with clear comments. The use of CSS variables such as var(--error-color) and var(--surface-2) keeps the design system scalable and theme-friendly. The layout decisions are practical, especially the responsive handling in .grant-form with flex-wrap, and the horizontal overflow support for the users table. Sticky table headers improve usability for long datasets, and the expandable .rooms-list approach keeps the UI uncluttered by default. Naming conventions are also consistent and readable throughout the file. One small improvement would be to consider adding transition effects for interactive elements like .rooms-toggle and .rooms-list.expanded to make the UI feel smoother. You could also add focus states for accessibility on buttons and form inputs. Overall, this is well-organized frontend styling with good attention to usability and maintainability.

@gaffner

gaffner commented May 11, 2026

Copy link
Copy Markdown
Owner

Great PR! Currently im on a long OOF, so I wont have time to uodate version. Also the current kive version its an old one, and thays another problem ill had to face when merging (the SSO feature been disabled). Thank you for your time!

Comment thread server.py
return RedirectResponse(url="/Frontend/index.html")


@app.get("/favicon.ico", include_in_schema=False)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Nice thinking I wanted to do that long time ago haha

@shsagir

shsagir commented May 12, 2026

Copy link
Copy Markdown
Author

Summary

Resolved merge conflict with main and added small UX/accessibility polish.

Merge conflict resolution — Frontend/index.html

Conflict between this branch's CSS refactor and main's "Disabled sign-in button" commit.

  • Kept the refactored structure: external theme.css, components.css, index.css, and js/chrome.js (file reduced from ~1180 → 398 lines).
  • Ported main's change forward: both <a href="/login" class="login-button">…Sign in with Microsoft</a> blocks replaced with <button class="login-button" disabled …>Sign-in temporarily disabled</button> (logged-out branch and error-fallback branch).

UI polish — transitions

  • .rooms-toggle: added background-color, transform, and box-shadow transitions; :active press-down (scale(0.97)).
  • .rooms-list.expanded: added a 180ms fade-in keyframe animation (since display can't transition directly).
  • All animations honor @media (prefers-reduced-motion: reduce).

Accessibility — focus states

  • New --focus-ring token in theme.css with light and dark values.
  • Global :focus-visible ring applied to button, [role="button"], .back-button, .login-button, .add-button, input, select, textarea.
  • Inputs get a subtle border/box-shadow transition.
  • Uses :focus-visible so mouse users don't see rings on click — only keyboard navigation triggers the ring.

Files changed

  • Frontend/index.html — merge resolution
  • Frontend/css/admin.css.rooms-toggle / .rooms-list.expanded transitions + focus
  • Frontend/css/components.css — global focus-visible rules
  • Frontend/css/theme.css--focus-ring token (light + dark)

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.

3 participants