From 24a025c1738437109dcaed7adeee68e6777706ae Mon Sep 17 00:00:00 2001 From: peptiderepo Date: Mon, 20 Apr 2026 13:20:59 +0700 Subject: [PATCH] Use theme CSS variables for table colors (dark mode fix) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hardcoded light-mode hex colors in table styles broke dark mode — header backgrounds and text were unreadable. Now uses theme CSS custom properties (--color-border-default, --color-bg-secondary, --color-text-primary) with light-mode fallbacks. Bump 0.7.2 → 0.7.3. Co-Authored-By: Claude Opus 4.6 --- CHANGELOG.md | 8 ++++++++ includes/frontend/class-article-typography.php | 12 +++++++----- prautoblogger.php | 4 ++-- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 31da430..782916b 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,14 @@ All notable changes to PRAutoBlogger will be documented in this file. Format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project uses [Semantic Versioning](https://semver.org/). +## [0.7.3] — 2026-04-20 + +### Fixed +- **Table colors broken in dark mode.** Replaced hardcoded hex colors + with theme CSS custom properties (`--color-border-default`, + `--color-bg-secondary`, `--color-text-primary`) so table borders, + header backgrounds, and text adapt to light/dark mode automatically. + ## [0.7.2] — 2026-04-20 ### Fixed diff --git a/includes/frontend/class-article-typography.php b/includes/frontend/class-article-typography.php index a6667d1..424c70e 100644 --- a/includes/frontend/class-article-typography.php +++ b/includes/frontend/class-article-typography.php @@ -102,8 +102,10 @@ class PRAutoBlogger_Article_Typography { $table_borders = get_option( self::OPT_TABLE_BORDERS, '1' ); if ( '1' === $table_borders ) { + // Uses theme CSS custom properties for dark mode compatibility. + // --color-border-default, --color-bg-secondary, --color-bg-primary, + // --color-text-primary are set by PR Theme for both light and dark. $rules[] = implode( "\n", [ - // Wrapper for horizontal scroll on narrow viewports. '.entry-content .prab-table-wrap {', "\toverflow-x: auto;", "\t-webkit-overflow-scrolling: touch;", @@ -116,18 +118,18 @@ class PRAutoBlogger_Article_Typography { '}', '.entry-content th,', '.entry-content td {', - "\tborder: 1px solid #d1d5db;", + "\tborder: 1px solid var(--color-border-default, #d1d5db);", "\tpadding: 0.6em 1em;", "\ttext-align: left;", + "\tcolor: var(--color-text-primary, #111827);", '}', '.entry-content thead th {', - "\tbackground: #f3f4f6;", + "\tbackground: var(--color-bg-secondary, #f3f4f6);", "\tfont-weight: 600;", '}', '.entry-content tbody tr:nth-child(even) {', - "\tbackground: #f9fafb;", + "\tbackground: var(--color-bg-secondary, #f9fafb);", '}', - // Mobile: tighter padding, smaller text for tables. '@media (max-width: 600px) {', "\t.entry-content th,", "\t.entry-content td {", diff --git a/prautoblogger.php b/prautoblogger.php index bca7254..bfb0c11 100644 --- a/prautoblogger.php +++ b/prautoblogger.php @@ -8,7 +8,7 @@ declare(strict_types=1); * Plugin Name: PRAutoBlogger * Plugin URI: https://peptiderepo.com/prautoblogger * Description: Monitors social media for trending topics, generates SEO-friendly blog posts using AI, and publishes them on a daily schedule with full cost tracking and self-improvement metrics. - * Version: 0.7.2 + * Version: 0.7.3 * Requires at least: 6.0 * Requires PHP: 7.4 * Author: PeptideRepo @@ -35,7 +35,7 @@ if ( ! defined( 'ABSPATH' ) ) { | and limits without magic strings. */ -define( 'PRAUTOBLOGGER_VERSION', '0.7.2' ); +define( 'PRAUTOBLOGGER_VERSION', '0.7.3' ); define( 'PRAUTOBLOGGER_DB_VERSION', '1.1.0' ); define( 'PRAUTOBLOGGER_PLUGIN_FILE', __FILE__ ); define( 'PRAUTOBLOGGER_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );