Skip to content

refactor: migrate to design tokens and remove terminal.css#36

Merged
suradet-ps merged 10 commits into
mainfrom
refactor/css-codebase
May 26, 2026
Merged

refactor: migrate to design tokens and remove terminal.css#36
suradet-ps merged 10 commits into
mainfrom
refactor/css-codebase

Conversation

@suradet-ps
Copy link
Copy Markdown
Owner

@suradet-ps suradet-ps commented May 26, 2026

Summary by Sourcery

Consolidate the site’s styling into a single global design system, replacing page‑specific CSS with shared tokens, components, and utilities, and align navigation and layout behaviors with the new system.

Enhancements:

  • Introduce a comprehensive global design system with color, typography, spacing, shadow, and component tokens plus utility classes for consistent styling across the site.
  • Refactor layout, hero, page header, blog, tools, and HOSxP pages to use shared global components (e.g., page layout, hero, banners, grids, chips, social pills) instead of inline styles.
  • Unify navbar, progress bar, feature cards, and blog post layout styling to consume the new semantic tokens and motion scales, improving consistency and maintainability.
  • Simplify mobile navigation behavior by centralizing menu state updates and refining overlay transitions without altering visible functionality.

Chores:

  • Remove the legacy terminal.css stylesheet and its import from the base layout now that its styles are reimplemented within the global design system.

Summary by CodeRabbit

  • New Features

    • Enhanced mobile navigation: improved accessibility, focus management, inert/interaction blocking, and instant-close behavior.
  • Style

    • Large shift to a tokenized design system for colors, spacing, radii, shadows, z-index, and transitions.
    • Restyled navbar, cards, progress bar, tables, and many pages; removed several page-specific inline styles in favor of global tokens.
    • Global stylesheet reorganized; legacy terminal styles removed.
  • Bug Fixes

    • Refined mobile scroll-lock behavior and improved text wrapping in tables.

Review Change Stack

@vercel
Copy link
Copy Markdown

vercel Bot commented May 26, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
rxdevnotes Ready Ready Preview, Comment May 26, 2026 1:10pm

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented May 26, 2026

Reviewer's Guide

Refactors the design system to centralize tokens and shared components in global.css, removes the legacy terminal.css, and updates layouts, pages, and the navbar to consume the new design tokens and shared utility classes while simplifying some JS behavior around the mobile menu.

Sequence diagram for updated mobile navbar menu behavior

sequenceDiagram
  actor User
  participant HamburgerButton
  participant MobileOverlay
  participant DocumentBody

  User->>HamburgerButton: click
  HamburgerButton->>HamburgerButton: setMenuState(true)
  HamburgerButton->>MobileOverlay: classList.add(open)
  HamburgerButton->>DocumentBody: classList.add(no-scroll)
  MobileOverlay->>MobileOverlay: inert = false

  User->>MobileOverlay: click link a
  MobileOverlay->>MobileOverlay: classList.add(instant-close)
  MobileOverlay->>HamburgerButton: setMenuState(false)
  HamburgerButton->>MobileOverlay: classList.remove(open)
  HamburgerButton->>DocumentBody: classList.remove(no-scroll)
  MobileOverlay->>MobileOverlay: inert = true
  MobileOverlay->>MobileOverlay: void offsetHeight  %% force reflow
Loading

Flow diagram for the updated design token system in global.css

flowchart LR
  A[root_color_primitives]
  B[semantic_tokens
  -- surfaces, text, borders,
  brand, states]
  C[component_tokens
  -- nav_height, depth,
  focus]
  D[legacy_aliases
  -- bg-color, brand-color,
  font-color]
  E[components/layout/Navbar.astro]
  F[layouts/BaseLayout.astro]
  G[pages_*_and_blog_layouts]

  A --> B
  B --> C
  B --> D
  C --> E
  C --> F
  B --> E
  B --> G
  D --> G
Loading

File-Level Changes

Change Details Files
Introduce a structured design system in global.css and migrate scattered page-level styles into shared layout, component, and utility classes.
  • Reorganizes :root tokens into primitive, semantic, component, and legacy alias groups (colors, typography, spacing, radii, shadows, z-index, transitions, focus styles).
  • Adds shared layout and component classes (page-layout, container, page-banner, section-header, post-grid, tools-grid, project-* blocks, hero-section, blog layout grid, post header/hero/footer, footer styles, social/tag/status chips, etc.).
  • Refactors prose (blog content) typography, code blocks, tables, and Shiki override styles, including a new window-chrome style for code blocks and responsive adjustments.
  • Moves custom scrollbar styles into @layer base and adds utilities for text colors and surfaces tied to new semantic tokens.
src/styles/global.css
Refine navbar styling and mobile menu behavior to use global design tokens and shared z-index/transition scales while simplifying overlay state management.
  • Removes redundant no-scroll toggle on and uses body-only no-scroll with global scrollbar-gutter styling.
  • Replaces hard-coded navbar colors, radii, and z-index with semantic tokens and component vars (surface-page, border-accent, brand-red/orange, nav-height, z-*).
  • Updates transitions to use duration/easing tokens and color-mix for hover backgrounds, and ensures reduced-motion variants rely on @media rules.
  • Changes mobile overlay to always render but animate via transform/opacity, uses var-based z-indices, and replaces manual close logic with setMenuState(false) on link click.
src/components/layout/Navbar.astro
Remove terminal.css and inline layout/footer styles in favor of global page-layout and footer components.
  • Drops the import of src/styles/terminal.css from BaseLayout and deletes the stylesheet.
  • Deletes inline page-layout and footer CSS from BaseLayout; equivalent styles now live in global.css as .page-layout, .site-footer, and related classes.
src/layouts/BaseLayout.astro
src/styles/terminal.css
Align page-level layouts (home, about, tools, HOSxP, blog listing, tags, categories, and INVS) to use shared hero, banner, section header, grid, and helper classes from global.css.
  • Home page hero section is renamed to .hero-section and relies on shared hero classes from global.css; local styles now only keep the eyebrow definition referencing text tokens.
  • About page replaces .page-header with .page-banner and shared banner styles; local CSS is trimmed to content-specific rules and updated to use semantic text/border tokens.
  • Tools, HOSxP index, categories, tags, and blog index pages drop their local header/grid styling and instead apply .section-header, .post-grid, and filter label helpers; INVS page uses centralized post-grid and status-box styles and updated text colors.
  • Project detail pages (herbs-app, cupsabot, herbready) remove duplicated layout/button/stack/coming-soon styles that are now provided by global component classes, keeping only truly specific tweaks.
src/pages/index.astro
src/pages/about.astro
src/pages/tools/index.astro
src/pages/tools/herbs-app.astro
src/pages/tools/cupsabot.astro
src/pages/hosxp/index.astro
src/pages/hosxp/herbready.astro
src/pages/invs.astro
src/pages/blog/index.astro
src/pages/blog/categories/[category].astro
src/pages/blog/tags/[tag].astro
Update blog post layout and supporting components to consume shared blog/typography tokens and classes.
  • Replaces the local layout grid, sticky sidebar, post header, hero image, footer, tags, and tag chip styles in BlogPostLayout with shared classes defined in global.css (blog-layout-grid, blog-left-sidebar, post-header, post-hero-image, post-footer, tags-list, tag-chip).
  • Updates class names in the template (e.g., category-link → post-header-category, hero-image → post-hero-image, layout-grid → blog-layout-grid) and relies on global semantic color/font tokens.
  • Adds a hover style override for .post-header-category in BlogPostLayout to keep the visual accent while delegating base styling to global.css.
src/layouts/BlogPostLayout.astro
Retheme smaller components to use the new design tokens instead of hard-coded colors.
  • FeatureCard now uses border-default, depth-border, radius tokens, and brand/text semantic colors, and its transitions align with the global duration/easing tokens; card content links use brand-red/orange.
  • ProgressBar gradient colors switch from hex values to brand-red and brand-orange tokens for consistency.
src/components/ui/FeatureCard.astro
src/components/ui/ProgressBar.astro

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 26, 2026

📝 Walkthrough

Walkthrough

This PR centralizes a token-based global stylesheet, migrates components and navbar styles to design tokens, tightens mobile navbar accessibility/overlay behavior, and removes many page-local inline styles.

Changes

Design Token System & Component Migration

Layer / File(s) Summary
Design Token System & Layers
src/styles/global.css
Comprehensive refactor into a token architecture: primitive variables, semantic tokens (--surface-*, --text-*), component tokens (--radius-*, --z-*, --duration-*), legacy alias mappings, and CSS layer organization (@layer reset, base, components, utilities, overrides).
Navbar & Mobile Navigation with Accessibility
src/components/layout/Navbar.astro
Mobile menu state now syncs accessibility attributes (aria-expanded, aria-hidden), toggles body.no-scroll and overlayElement.inert, manages focus handoff, and delegates instant-close to setMenuState(false); navbar CSS migrated to token variables for z-index, surfaces, borders, spacing, radii, and transitions.
UI Component Token Adoption
src/components/ui/FeatureCard.astro, src/components/ui/ProgressBar.astro
Feature card and progress bar styles now use design tokens for borders, radii, colors, gradients, z-index, transitions, and reduced-motion handling.
Layout & Stylesheet Consolidation
src/layouts/BaseLayout.astro
Removed terminal.css import from BaseLayout and deleted inline layout/footer styles in favor of global token-based styles.
Blog Layout & Metadata Structure
src/layouts/BlogPostLayout.astro, src/pages/blog/index.astro, src/pages/blog/categories/[category].astro, src/pages/blog/tags/[tag].astro
Updated blog layout class names and metadata hooks; removed most inline blog styles; category/tag pages adopt filter-label/filter-subtitle hooks.
Page Template & Style Consolidation
src/pages/*.astro (about, index, invs, hosxp, tools pages)
Removed many page-scoped inline <style> blocks, renamed CSS hooks (e.g., herohero-section, page-headersection-header/page-banner), and updated local rules to use token variables like --text-secondary and --text-muted.
Content & Table tweak
src/components/content/Table.astro
Header cell wrapping improved with overflow-wrap: break-word and word-break: break-word.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Possibly Related PRs

  • suradet-ps/rxdevman#35: Mobile overlay close logic refinement in Navbar using instant-close class and setMenuState(false) delegation.

Poem

🐰 I hop through tokens, soft and bright,

Borders, colors, each delight,
Pages lean and styles align,
A tidy garden, line by line,
Hooray — the stylesheet’s right! 🥕

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and accurately summarizes the main changes: migrating to design tokens and removing terminal.css, which aligns with the primary refactoring work across the codebase.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/css-codebase

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

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey - I've found 2 issues, and left some high level feedback:

  • The new design tokens look well structured, but you still have a few hard-coded colors in components (e.g. .prose pre background/header, code editor dots) that bypass the semantic tokens—consider mapping those to the new --surface-*/--brand-* variables for consistency and easier theming later.
  • You've moved a lot of page- and component-specific CSS into global @layer components (e.g. .hero-section, .page-banner, .project-header); if you intend these to be shared primitives, it may be worth tightening their naming or scoping (e.g. with a prefix) to avoid collisions with future one-off styles.
  • The color-mix() usage in navbar and feature card hover states is nice, but it may not be supported in all target browsers; if you need wider compatibility, consider adding a simple fallback background color before the color-mix() declarations.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The new design tokens look well structured, but you still have a few hard-coded colors in components (e.g. `.prose pre` background/header, code editor dots) that bypass the semantic tokens—consider mapping those to the new `--surface-*`/`--brand-*` variables for consistency and easier theming later.
- You've moved a lot of page- and component-specific CSS into global `@layer components` (e.g. `.hero-section`, `.page-banner`, `.project-header`); if you intend these to be shared primitives, it may be worth tightening their naming or scoping (e.g. with a prefix) to avoid collisions with future one-off styles.
- The `color-mix()` usage in navbar and feature card hover states is nice, but it may not be supported in all target browsers; if you need wider compatibility, consider adding a simple fallback background color before the `color-mix()` declarations.

## Individual Comments

### Comment 1
<location path="src/components/layout/Navbar.astro" line_range="206-207" />
<code_context>
     const link = event.target instanceof Element ? event.target.closest('a') : null;
     if (link) {
-      // Instantly hide overlay to prevent transition jank during navigation
       overlayElement.classList.add('instant-close');
-
-      isMenuOpen = false;
-      overlayElement.classList.remove('open');
-      hamburgerButton.classList.remove('active');
-      hamburgerButton.setAttribute('aria-expanded', 'false');
-      overlayElement.setAttribute('aria-hidden', 'true');
-      document.body.classList.remove('no-scroll');
-      document.documentElement.classList.remove('no-scroll');
-      overlayElement.inert = true;
-
-      // Force a synchronous layout reflow.
-      // This ensures the browser flushes its layout queue and applies the
-      // 'instant-close' state immediately BEFORE Astro View Transitions
-      // or the browser starts painting the next page, preventing animation jank.
+      setMenuState(false);
       void overlayElement.offsetHeight;
     }
</code_context>
<issue_to_address>
**issue (bug_risk):** The `instant-close` class is never cleared, so subsequent opens may lose the slide-in animation.

Because `setMenuState` only toggles the `open` class, `instant-close` remains on the overlay after navigation. On the next open, `.mobile-overlay.instant-close` still disables the transition (opacity/visibility are applied instantly), so the panel never animates. Please clear `instant-close` when reopening (e.g. in `setMenuState(true)`) or via a `transitionend`/`animationend` handler so only the first navigation short-circuits the animation.
</issue_to_address>

### Comment 2
<location path="src/components/ui/ProgressBar.astro" line_range="55" />
<code_context>
     width: 100%;
     height: 100dvh;
-    background: #fdfdf8;
-    z-index: 999999;
+    background: var(--surface-page);
+    z-index: var(--z-overlay);
</code_context>
<issue_to_address>
**suggestion (bug_risk):** Progress bar z-index is hard-coded instead of using the new z-index token, and may conflict with the mobile overlay.

Since we now have both `--z-progress` and `--z-overlay`, this component should use the dedicated progress token instead of `var(--z-overlay)`. That will keep layering consistent and avoid the progress bar sharing a stacking level with the mobile overlay, which could lead to unexpected overlaps based on DOM order.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread src/components/layout/Navbar.astro
Comment thread src/components/ui/ProgressBar.astro Outdated
Copy link
Copy Markdown

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
src/components/layout/Navbar.astro (1)

160-162: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Avoid focusing a hidden hamburger when closing on desktop resize.

When setMenuState(false) is triggered after window.innerWidth > 900, focus is moved to hamburgerButton even though it is hidden by CSS. This can leave keyboard users without a visible focus target.

Suggested fix
   else {
-      hamburgerButton.focus();
+      if (window.innerWidth <= 900) {
+        hamburgerButton.focus();
+      } else {
+        const desktopActive =
+          navbarElement.querySelector<HTMLElement>('.nav-link.active') ??
+          navbarElement.querySelector<HTMLElement>('.nav-link') ??
+          navbarElement;
+        desktopActive.focus();
+      }
   }

Also applies to: 187-190, 527-531

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/layout/Navbar.astro` around lines 160 - 162, When calling
setMenuState(false) in the resize/close logic, avoid calling
hamburgerButton.focus() unconditionally when the button is hidden; instead check
that the hamburgerButton is visible/interactive before focusing (e.g., test
computed style/offsetParent/aria-hidden/visibility or that window.innerWidth <=
900) and only call hamburgerButton.focus() when it will be a visible focus
target. Update the three locations referenced (the block around
setMenuState(false) with hamburgerButton.focus() at lines near 160–162, 187–190,
and 527–531) to perform this visibility check before focusing.
src/styles/global.css (1)

1354-1364: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Honor reduced-motion for the animation utilities.

These helpers still run infinite animations when the user has prefers-reduced-motion: reduce enabled. Because they are global utilities, one missing override reintroduces motion anywhere they are used.

🧩 Suggested safeguard
 `@layer` utilities {
   .animate-wiggle {
     animation: wiggle 0.5s ease-in-out infinite;
   }
   .animate-float {
     animation: float 3s ease-in-out infinite;
   }
   .animate-shimmer {
     background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.4) 50%, transparent 100%);
     background-size: 200% auto;
     animation: shimmer 2s linear infinite;
   }
+
+  `@media` (prefers-reduced-motion: reduce) {
+    .animate-wiggle,
+    .animate-float,
+    .animate-shimmer {
+      animation: none;
+    }
+  }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/styles/global.css` around lines 1354 - 1364, The animation utilities
(.animate-wiggle, .animate-float, .animate-shimmer) currently ignore user motion
preferences; add a prefers-reduced-motion: reduce media query that overrides
those utilities to disable animations (e.g., set animation: none !important and
remove background animation for .animate-shimmer) so any use of these classes
respects reduced-motion; target the same selectors (.animate-wiggle,
.animate-float, .animate-shimmer) inside the media block to ensure the global
utilities are fully disabled when the user requests reduced motion.
🧹 Nitpick comments (4)
src/pages/hosxp/herbready.astro (1)

111-111: ⚡ Quick win

Use semantic text token for migrated page styles.

Line 111 still uses a legacy-style token (--font-color-light). For consistency with this PR’s semantic-token migration, switch it to a semantic text token (for example --text-secondary or --text-muted).

Suggested diff
-  .desc-line { color: var(--font-color-light); }
+  .desc-line { color: var(--text-secondary); }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/pages/hosxp/herbready.astro` at line 111, The CSS rule for .desc-line
uses the legacy token --font-color-light; update it to use a semantic text token
(e.g., --text-secondary or --text-muted) to match the PR’s semantic-token
migration, i.e., replace the value for .desc-line { color:
var(--font-color-light); } with color: var(--text-secondary) (or --text-muted)
so the class .desc-line uses a semantic token instead of --font-color-light.
src/components/ui/ProgressBar.astro (1)

55-55: ⚡ Quick win

Replace hardcoded progress bar z-index with a token.

z-index: 999999 bypasses the new layering token system and can create brittle stacking behavior. Prefer a design token (or component token) for this layer.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/ui/ProgressBar.astro` at line 55, Replace the hardcoded
z-index in src/components/ui/ProgressBar.astro (the CSS rule using "z-index:
999999") with a layering design token (for example a CSS variable like
--z-layer-progress or the component token name used across the codebase), update
the component to reference that token instead of the literal number, and if the
token does not exist add it to the global tokens/vars (or theme) with the
appropriate numeric value; keep the token name consistent with existing layer
naming (e.g., z-layer-*) so other components can share it.
src/components/layout/Navbar.astro (1)

316-318: ⚡ Quick win

Tokenize remaining hardcoded active-state colors.

A few active-state colors are still literal values (#2b1f00, rgba(...)). Replacing these with semantic tokens will keep navbar theming consistent with the new token system.

Also applies to: 489-492, 520-523

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/layout/Navbar.astro` around lines 316 - 318, Replace the
remaining hardcoded active-state colors in the Navbar component CSS (the rules
showing color: `#2b1f00` and the rgba(...) active/background/border values) with
semantic design tokens (CSS custom properties) so theming is consistent; update
the CSS rules in Navbar.astro that set color, background and border-color to use
tokens like --color-text-on-brand, --brand-active-bg, --brand-btn-border (or
your existing token names) and ensure the same replacements are applied to the
other occurrences called out (the other rule blocks at the noted locations); if
the tokens don't exist, add appropriately named tokens to the theme/token
definitions and use those names in the Navbar styles.
src/styles/global.css (1)

424-425: ⚡ Quick win

Route the CTA hover color through the token layer.

Line 425 hardcodes the primary button hover color, so palette updates will not flow through the new token contract. This should live beside the other brand button tokens instead of bypassing them here.

🎨 Token-based cleanup
 :root {
   --brand-red: var(--color-red-600);
   --brand-orange: var(--color-orange-400);
   --brand-btn-shadow: var(--color-orange-600);
   --brand-btn-border: var(--color-orange-500);
+  --brand-btn-hover: `#f0a83a`;
 }

 .cta-button:hover {
-  background-color: `#f0a83a`;
+  background-color: var(--brand-btn-hover);
   color: var(--text-heading);
   transform: translateY(-1px);
   box-shadow: var(--depth-shadow-hover);
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/styles/global.css` around lines 424 - 425, The .cta-button:hover rule
currently hardcodes the hover color; replace that literal with the token used
for brand button hover states (e.g., use the existing brand/button token like
--button-cta-hover or add a new token such as --brand-cta-hover alongside the
other brand button tokens) and update .cta-button:hover to reference that CSS
variable instead of `#f0a83a` so palette changes flow through the token layer;
also move or consolidate the token declaration next to the other brand button
tokens rather than keeping a hardcoded value in global.css.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/styles/global.css`:
- Around line 823-829: The .blog-left-sidebar uses top: calc(var(--nav-height) +
1.5rem) but its max-height is fixed to calc(100vh - 4rem), causing the sidebar
to be taller than the remaining viewport; update max-height so it mirrors the
top offset (for example use calc(100vh - (var(--nav-height) + 1.5rem)) or
otherwise subtract the same var(--nav-height) + 1.5rem expression) to keep the
sticky sidebar height in sync with its offset.
- Around line 1053-1054: Remove deprecated word-wrap and word-break usages:
replace any "word-wrap: break-word" and "word-break: break-word" with
"overflow-wrap: break-word" (update the .prose code rule and the earlier
wrapping rule). Replace the hardcoded hover color in .cta-button:hover with the
design token (e.g. use var(--color-cta-hover) or the project's CTA hover token
name) for consistency. Fix sidebar sizing by making top and max-height use the
same nav-height offset (e.g. keep top using var(--nav-height) +/- spacing and
compute max-height as calc(100vh - var(--nav-height) - [same spacing]) so the
sidebar always fits the viewport). For .animate-wiggle, .animate-float,
.animate-shimmer, wrap or add prefers-reduced-motion: reduce rules to
disable/stop animations when the user requests reduced motion.

---

Outside diff comments:
In `@src/components/layout/Navbar.astro`:
- Around line 160-162: When calling setMenuState(false) in the resize/close
logic, avoid calling hamburgerButton.focus() unconditionally when the button is
hidden; instead check that the hamburgerButton is visible/interactive before
focusing (e.g., test computed style/offsetParent/aria-hidden/visibility or that
window.innerWidth <= 900) and only call hamburgerButton.focus() when it will be
a visible focus target. Update the three locations referenced (the block around
setMenuState(false) with hamburgerButton.focus() at lines near 160–162, 187–190,
and 527–531) to perform this visibility check before focusing.

In `@src/styles/global.css`:
- Around line 1354-1364: The animation utilities (.animate-wiggle,
.animate-float, .animate-shimmer) currently ignore user motion preferences; add
a prefers-reduced-motion: reduce media query that overrides those utilities to
disable animations (e.g., set animation: none !important and remove background
animation for .animate-shimmer) so any use of these classes respects
reduced-motion; target the same selectors (.animate-wiggle, .animate-float,
.animate-shimmer) inside the media block to ensure the global utilities are
fully disabled when the user requests reduced motion.

---

Nitpick comments:
In `@src/components/layout/Navbar.astro`:
- Around line 316-318: Replace the remaining hardcoded active-state colors in
the Navbar component CSS (the rules showing color: `#2b1f00` and the rgba(...)
active/background/border values) with semantic design tokens (CSS custom
properties) so theming is consistent; update the CSS rules in Navbar.astro that
set color, background and border-color to use tokens like --color-text-on-brand,
--brand-active-bg, --brand-btn-border (or your existing token names) and ensure
the same replacements are applied to the other occurrences called out (the other
rule blocks at the noted locations); if the tokens don't exist, add
appropriately named tokens to the theme/token definitions and use those names in
the Navbar styles.

In `@src/components/ui/ProgressBar.astro`:
- Line 55: Replace the hardcoded z-index in src/components/ui/ProgressBar.astro
(the CSS rule using "z-index: 999999") with a layering design token (for example
a CSS variable like --z-layer-progress or the component token name used across
the codebase), update the component to reference that token instead of the
literal number, and if the token does not exist add it to the global tokens/vars
(or theme) with the appropriate numeric value; keep the token name consistent
with existing layer naming (e.g., z-layer-*) so other components can share it.

In `@src/pages/hosxp/herbready.astro`:
- Line 111: The CSS rule for .desc-line uses the legacy token
--font-color-light; update it to use a semantic text token (e.g.,
--text-secondary or --text-muted) to match the PR’s semantic-token migration,
i.e., replace the value for .desc-line { color: var(--font-color-light); } with
color: var(--text-secondary) (or --text-muted) so the class .desc-line uses a
semantic token instead of --font-color-light.

In `@src/styles/global.css`:
- Around line 424-425: The .cta-button:hover rule currently hardcodes the hover
color; replace that literal with the token used for brand button hover states
(e.g., use the existing brand/button token like --button-cta-hover or add a new
token such as --brand-cta-hover alongside the other brand button tokens) and
update .cta-button:hover to reference that CSS variable instead of `#f0a83a` so
palette changes flow through the token layer; also move or consolidate the token
declaration next to the other brand button tokens rather than keeping a
hardcoded value in global.css.
🪄 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: 35c0117b-3764-44d6-9e3e-6e35b47d0d41

📥 Commits

Reviewing files that changed from the base of the PR and between d9d94c5 and d4927c1.

📒 Files selected for processing (18)
  • src/components/layout/Navbar.astro
  • src/components/ui/FeatureCard.astro
  • src/components/ui/ProgressBar.astro
  • src/layouts/BaseLayout.astro
  • src/layouts/BlogPostLayout.astro
  • src/pages/about.astro
  • src/pages/blog/categories/[category].astro
  • src/pages/blog/index.astro
  • src/pages/blog/tags/[tag].astro
  • src/pages/hosxp/herbready.astro
  • src/pages/hosxp/index.astro
  • src/pages/index.astro
  • src/pages/invs.astro
  • src/pages/tools/cupsabot.astro
  • src/pages/tools/herbs-app.astro
  • src/pages/tools/index.astro
  • src/styles/global.css
  • src/styles/terminal.css
💤 Files with no reviewable changes (4)
  • src/styles/terminal.css
  • src/layouts/BaseLayout.astro
  • src/pages/tools/herbs-app.astro
  • src/pages/tools/cupsabot.astro

Comment thread src/styles/global.css
Comment thread src/styles/global.css Outdated
@suradet-ps suradet-ps changed the title refactor: remove terminal.css and modifiled all css refactor: migrate to design tokens and remove terminal.css May 26, 2026
Copy link
Copy Markdown

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

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/components/layout/Navbar.astro`:
- Line 143: The issue: overlayElement.classList.remove('instant-close') is
executed unconditionally before toggling the overlay's 'open' class in
setMenuState, which breaks the intended instant-close when a nav link triggers
setMenuState(false). Fix it by moving or guarding that removal so it only
happens when the overlay is being opened (or after the 'open' class is toggled
off); specifically, in the code that calls
overlayElement.classList.remove('instant-close') (and in the setMenuState/open
toggle logic), either move the remove call to after toggling the 'open' class or
wrap it with a condition like if (nextOpen) so that clicking a nav link (which
calls setMenuState(false)) preserves the 'instant-close' class until after the
instant-close behavior has taken effect.
🪄 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: 6823442e-4a38-4825-878a-50aefb46f9ce

📥 Commits

Reviewing files that changed from the base of the PR and between d4927c1 and 7d0801f.

📒 Files selected for processing (3)
  • src/components/layout/Navbar.astro
  • src/components/ui/ProgressBar.astro
  • src/styles/global.css

Comment thread src/components/layout/Navbar.astro Outdated
Copy link
Copy Markdown

@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)
src/styles/global.css (1)

1101-1110: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Remove the deprecated word-break: break-word declarations.

Line 1109 and Line 1211 still use a deprecated CSS keyword that stylelint flags today. Keep overflow-wrap for the table headers and switch the inline-code rule to overflow-wrap instead so this stylesheet stays lint-clean.

♻️ Minimal fix
 .prose code {
   font-family: var(--font-mono);
   background-color: var(--surface-accent);
   color: var(--brand-red);
   border: 1px solid var(--border-default);
   padding: 0.15em 0.4em;
   border-radius: var(--radius-sm);
   font-size: 0.875em;
-  word-break: break-word;
+  overflow-wrap: anywhere;
 }
@@
 .prose th {
   background-color: var(--surface-accent);
   color: var(--text-primary);
   font-weight: 600;
   text-align: left;
   padding: var(--space-3) var(--space-4);
   border-bottom: 2px solid var(--border-default);
   overflow-wrap: break-word;
-  word-break: break-word;
 }

Also applies to: 1203-1212

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/styles/global.css` around lines 1101 - 1110, The .prose code rule
currently uses the deprecated word-break: break-word; update this selector
(".prose code") to remove word-break and add overflow-wrap: anywhere; (or
overflow-wrap: break-word) to preserve the same wrapping behavior; ensure you do
not change the existing table header rules which already use overflow-wrap (the
block around lines ~1203-1212) so the stylesheet remains stylelint-clean.
🧹 Nitpick comments (1)
src/components/layout/Navbar.astro (1)

304-309: ⚡ Quick win

Finish the token migration for the active nav colors.

Line 305, Line 478, Line 509, and Line 510 still hardcode the active-state palette. Since this PR is moving the navbar to token-driven styling, these should come from semantic/component tokens too so future palette changes stay centralized.

🎨 Minimal token-based cleanup
 .nav-link.active {
-  color: `#2b1f00`;
+  color: var(--text-heading);
   background: var(--brand-orange);
   border-color: var(--brand-btn-border);
   font-weight: 700;
 }
@@
 .mobile-link.active {
-  color: `#2b1f00`;
+  color: var(--text-heading);
   background: var(--brand-orange);
   border-color: var(--brand-btn-border);
   font-weight: 700;
   transform: none;
 }
@@
 .mobile-link.active .mobile-link-icon {
-  color: `#2b1f00`;
-  border-color: rgba(43, 31, 0, 0.2);
+  color: var(--text-heading);
+  border-color: color-mix(in srgb, var(--text-heading) 20%, transparent);
   background: rgba(255, 255, 255, 0.4);
 }

Also applies to: 477-483, 508-512

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/layout/Navbar.astro` around lines 304 - 309, The CSS for the
active nav state currently hardcodes colors in the .nav-link.active rule (and
the duplicate rules around the other occurrences) — replace the literal values
(color: `#2b1f00`; background: var(--brand-orange); border-color:
var(--brand-btn-border); font-weight: 700) with semantic/component CSS tokens
(for example use tokens like --nav-active-foreground, --nav-active-background,
--nav-active-border and keep font-weight as a token or existing variable) so all
occurrences of .nav-link.active and the duplicated blocks (the other navbar
active-state rules) reference those tokens instead of hardcoded palette values.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Duplicate comments:
In `@src/styles/global.css`:
- Around line 1101-1110: The .prose code rule currently uses the deprecated
word-break: break-word; update this selector (".prose code") to remove
word-break and add overflow-wrap: anywhere; (or overflow-wrap: break-word) to
preserve the same wrapping behavior; ensure you do not change the existing table
header rules which already use overflow-wrap (the block around lines ~1203-1212)
so the stylesheet remains stylelint-clean.

---

Nitpick comments:
In `@src/components/layout/Navbar.astro`:
- Around line 304-309: The CSS for the active nav state currently hardcodes
colors in the .nav-link.active rule (and the duplicate rules around the other
occurrences) — replace the literal values (color: `#2b1f00`; background:
var(--brand-orange); border-color: var(--brand-btn-border); font-weight: 700)
with semantic/component CSS tokens (for example use tokens like
--nav-active-foreground, --nav-active-background, --nav-active-border and keep
font-weight as a token or existing variable) so all occurrences of
.nav-link.active and the duplicated blocks (the other navbar active-state rules)
reference those tokens instead of hardcoded palette values.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: cbdc228f-ac4e-4804-ab9e-6fb301c9c43d

📥 Commits

Reviewing files that changed from the base of the PR and between 7d0801f and 32a3c8a.

📒 Files selected for processing (3)
  • src/components/content/Table.astro
  • src/components/layout/Navbar.astro
  • src/styles/global.css
✅ Files skipped from review due to trivial changes (1)
  • src/components/content/Table.astro

@suradet-ps suradet-ps merged commit 60e53ae into main May 26, 2026
9 checks passed
@suradet-ps suradet-ps deleted the refactor/css-codebase branch May 26, 2026 13:18
github-actions Bot pushed a commit that referenced this pull request May 26, 2026
## [1.13.4](v1.13.3...v1.13.4) (2026-05-26)

### ♻️ Refactoring

* migrate to design tokens and remove terminal.css ([#36](#36)) ([60e53ae](60e53ae))
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 1.13.4 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant