Use theme CSS variables for table colors (dark mode fix)

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 <noreply@anthropic.com>
This commit is contained in:
peptiderepo
2026-04-20 13:20:59 +07:00
parent 2a921e963f
commit 24a025c173
3 changed files with 17 additions and 7 deletions

View File

@@ -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/), Format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project uses [Semantic Versioning](https://semver.org/). 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 ## [0.7.2] — 2026-04-20
### Fixed ### Fixed

View File

@@ -102,8 +102,10 @@ class PRAutoBlogger_Article_Typography {
$table_borders = get_option( self::OPT_TABLE_BORDERS, '1' ); $table_borders = get_option( self::OPT_TABLE_BORDERS, '1' );
if ( '1' === $table_borders ) { 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", [ $rules[] = implode( "\n", [
// Wrapper for horizontal scroll on narrow viewports.
'.entry-content .prab-table-wrap {', '.entry-content .prab-table-wrap {',
"\toverflow-x: auto;", "\toverflow-x: auto;",
"\t-webkit-overflow-scrolling: touch;", "\t-webkit-overflow-scrolling: touch;",
@@ -116,18 +118,18 @@ class PRAutoBlogger_Article_Typography {
'}', '}',
'.entry-content th,', '.entry-content th,',
'.entry-content td {', '.entry-content td {',
"\tborder: 1px solid #d1d5db;", "\tborder: 1px solid var(--color-border-default, #d1d5db);",
"\tpadding: 0.6em 1em;", "\tpadding: 0.6em 1em;",
"\ttext-align: left;", "\ttext-align: left;",
"\tcolor: var(--color-text-primary, #111827);",
'}', '}',
'.entry-content thead th {', '.entry-content thead th {',
"\tbackground: #f3f4f6;", "\tbackground: var(--color-bg-secondary, #f3f4f6);",
"\tfont-weight: 600;", "\tfont-weight: 600;",
'}', '}',
'.entry-content tbody tr:nth-child(even) {', '.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) {', '@media (max-width: 600px) {',
"\t.entry-content th,", "\t.entry-content th,",
"\t.entry-content td {", "\t.entry-content td {",

View File

@@ -8,7 +8,7 @@ declare(strict_types=1);
* Plugin Name: PRAutoBlogger * Plugin Name: PRAutoBlogger
* Plugin URI: https://peptiderepo.com/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. * 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 at least: 6.0
* Requires PHP: 7.4 * Requires PHP: 7.4
* Author: PeptideRepo * Author: PeptideRepo
@@ -35,7 +35,7 @@ if ( ! defined( 'ABSPATH' ) ) {
| and limits without magic strings. | 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_DB_VERSION', '1.1.0' );
define( 'PRAUTOBLOGGER_PLUGIN_FILE', __FILE__ ); define( 'PRAUTOBLOGGER_PLUGIN_FILE', __FILE__ );
define( 'PRAUTOBLOGGER_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); define( 'PRAUTOBLOGGER_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );