Skip to content

fix: replace all inline style= attributes and <style> tags with CSS classes - #25

Open
datengraben wants to merge 3 commits into
masterfrom
claude/wordpress-templates-styling-yltf43
Open

fix: replace all inline style= attributes and <style> tags with CSS classes#25
datengraben wants to merge 3 commits into
masterfrom
claude/wordpress-templates-styling-yltf43

Conversation

@datengraben

Copy link
Copy Markdown
Owner

High-severity WordPress community standards violations:

  • Remove inline <style> block from Admin/Filter.php (CSP violation)
  • Replace hardcoded color style= attrs in Migration, TimeframeExport,
    MassOperations, Dashboard, Map, Booking views with semantic CSS classes
    (.cb-text-error, .cb-text-success, .cb-border-error, etc.)
  • Remove style= from all templates (dashboard-index, timeframe-calendar,
    timeframe-calendar-day, shortcode-bookings); use CSS classes instead
  • Add new utility/semantic classes to SCSS partials
  • Add LATER.md documenting deferred medium/low severity items

SCSS compiles cleanly (validated with dart-sass).

Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01KwwjrTFVrzzFUfDsC83zgV

claude added 3 commits June 22, 2026 18:45
…lasses

High-severity WordPress community standards violations:
- Remove inline <style> block from Admin/Filter.php (CSP violation)
- Replace hardcoded color style= attrs in Migration, TimeframeExport,
  MassOperations, Dashboard, Map, Booking views with semantic CSS classes
  (.cb-text-error, .cb-text-success, .cb-border-error, etc.)
- Remove style= from all templates (dashboard-index, timeframe-calendar,
  timeframe-calendar-day, shortcode-bookings); use CSS classes instead
- Add new utility/semantic classes to SCSS partials
- Add LATER.md documenting deferred medium/low severity items

SCSS compiles cleanly (validated with dart-sass).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KwwjrTFVrzzFUfDsC83zgV
getColorCSS() ran the full SCSS compiler on every public page load.
Now the compiled CSS is stored in the cb_color_css transient (TTL: 1
year) and the transient is deleted in OptionsTab::savePostOptions()
whenever the template colour settings are saved, triggering a single
recompile on the next request.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KwwjrTFVrzzFUfDsC83zgV
Add commonsbooking_is_cb_page() helper that returns true when the current
page is a CB custom post type (cb_item, cb_location, cb_booking) or its
post content contains a CB shortcode. commonsbooking_public() now returns
early when neither condition is met, so the main stylesheet, vendor bundle,
Select2, Moment, datepicker, and AJAX nonces are skipped on unrelated pages.

A commonsbooking_load_public_assets filter lets site owners opt in on pages
where CB content is embedded outside the main post (widgets, page builders).
AJAX endpoint registrations and query-var hooks are left ungated.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KwwjrTFVrzzFUfDsC83zgV
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.

2 participants