Skip to content

fix(truth-table): make generator input follow the active colour scheme (#631) - #803

Closed
WasThatRudy wants to merge 1 commit into
CircuitVerse:masterfrom
WasThatRudy:fix/truth-table-input-theme-631
Closed

WasThatRudy wants to merge 1 commit into
CircuitVerse:masterfrom
WasThatRudy:fix/truth-table-input-theme-631

Conversation

@WasThatRudy

@WasThatRudy WasThatRudy commented Sep 27, 2026 •

Copy link
Copy Markdown

Fixes #631

What was wrong

_includes/truth_table.html hardcoded color: black on .truth_table_input:

.truth_table_input {
    ...
    color: black;
}

The theme already colours inputs per scheme (input { color: $inputcolor } in _sass/custom/custom.scss, with $inputcolor: #000000 in circuitverse.scss and #ffffff in circuitversedark.scss). The class selector outranks the element selector, so the generator field kept black text no matter which scheme was active, while nothing pinned its background. Text colour fixed and background not fixed is exactly how the typed expression ends up unreadable.

What this does

Moves the colours to _sass/custom/custom.scss, where the scheme variables are in scope, and sets background, border and text colour together so they cannot diverge:

.truth_table_input {
  background-color: $body-background-color;
  border: 1px solid $border-color;
  color: $inputcolor;

  &::placeholder {
    color: $inputcolor;
    opacity: 0.6;
  }
}

Light scheme: white field, black text. circuitversedark: dark field, white text. The placeholder is dimmed rather than left at the browser default so it stays legible on both backgrounds.

The inline <style> block in the include keeps the layout rules (width, padding, font) and drops only the colour line.

How to check

  1. bundle exec jekyll serve
  2. Open /docs/logic-design/canonical.html and scroll to the Truth Table Generator.
  3. Type an expression, e.g. (AB)'C+D. The value is visible.
  4. Toggle Dark mode from the top-right aux link and type again. Still visible.

No JS or markup changes, so nothing else on the page is affected.

Summary by CodeRabbit

  • Bug Fixes
    • Truth-table inputs now follow the active theme’s colors, including their background, border, text, and placeholder. This improves readability and visual consistency when using different themes.

The truth table generator hardcoded 'color: black' on .truth_table_input.
That rule has higher specificity than the theme's 'input { color: $inputcolor }',
so the field ignored the active scheme while its background kept following it,
which is how the typed expression ends up unreadable.

Move the colours to _sass/custom/custom.scss, where the scheme variables are
available, and set the background, border and text colour together so they can
never diverge: white field with black text in the light scheme, dark field with
white text in circuitversedark.

Fixes CircuitVerse#631
Comment thread _sass/custom/custom.scss
}

// Fix: truth table generator input follows the active colour scheme (Issue #631)
.truth_table_input {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Selector truth_table_input should be written in lowercase with hyphens

@coderabbitai

coderabbitai Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: ccad03d9-1f6a-40a9-bc40-8ffbeb91983e

📥 Commits

Reviewing files that changed from the base of the PR and between 38767e9 and 7769274.

📒 Files selected for processing (2)
  • _includes/truth_table.html
  • _sass/custom/custom.scss

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.


Walkthrough

The truth table input no longer sets its text color to black. Custom Sass now sets its background, border, text, and placeholder colors.

Priority: ⬇️ Low

Change: Bug fix · Severity of issue fixed: Low

Merge Risk: ⚪ Minimal · up to 77692

The truth-table input’s theme-color change is ready to merge after normal checks.

Architecture Summary

Architecture risk: 🔵 Low · up to 77692

The change affects 2 systems.

Changed systems: _includes, _sass

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — _includes (service) was modified; 1 changed file maps to changed impact.
  • observed — _sass (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in _includes/truth_table.html: Removed the input’s explicit black text color and added a comment identifying the custom Sass stylesheet as the source of theme-following colors.
  • observed — Modified behavior in _sass/custom/custom.scss: Added .truth_table_input styling for its background, border, text, and placeholder color and opacity.
🚥 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 concisely describes the main change: updating the truth table generator input to follow the active colour scheme.
Linked Issues check ✅ Passed The PR addresses issue #631. It removes the hardcoded black text color from _includes/truth_table.html and adds theme-aware .truth_table_input styles in _sass/custom/custom.scss. The styles set …
Out of Scope Changes check ✅ Passed The reported changes are limited to truth-table input color styling. The inline style retains layout rules, and the Sass additions support the linked visibility objective. No unrelated change is shown…
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

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.

@WasThatRudy

Copy link
Copy Markdown
Author

Closing this. I checked the history after opening it: 4a3a865 (PR #703) already fixed the reported dark-mode visibility problem by setting color: black on this field, and I verified by rendering the deployed page against both compiled stylesheets that the value is readable in the light scheme and in circuitversedark today. This PR only restyled the field, so it is churn on top of a working fix. Apologies for the noise.

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.

Input in truth table generator should be visible

1 participant