Skip to content

Fix: Pattern Card Spacing Variables and Sticky Menu Scroll Offset#818

Merged
tibiii merged 7 commits into2.1-trunkfrom
fix/pattern-cards-spacings
Dec 18, 2025
Merged

Fix: Pattern Card Spacing Variables and Sticky Menu Scroll Offset#818
tibiii merged 7 commits into2.1-trunkfrom
fix/pattern-cards-spacings

Conversation

@tibiii
Copy link
Contributor

@tibiii tibiii commented Dec 18, 2025


type: fix
scope: patterns, sticky-menu
breaking: false

Description

This PR addresses spacing inconsistencies in pattern cards and improves the sticky menu scroll offset for better UX.

Changes

Pattern Cards Spacing

  • Created default spacing variables with theme inheritance using :where() selector
  • Added CSS spacing variables (--wp--preset--spacing--10 through --wp--preset--spacing--80) with zero-specificity fallbacks
  • Ensures theme values take precedence while providing consistent rem-based fallback values
  • Removed hardcoded CSS values from accommodation and tour card patterns
  • Replaced fixed pixel values with WordPress spacing presets for better theme compatibility

Sticky Menu Scroll

  • Added 5px buffer to scroll offset calculation for more precise positioning
  • Improves scroll-to-section accuracy when clicking sticky menu items

Files Changed

  • src/css/_variables.scss - Added spacing variable fallbacks
  • src/css/index.scss - Imported variables
  • src/css/_slider.scss - Updated spacing references
  • patterns/accommodation-card.php - Replaced hardcoded spacing with presets
  • patterns/tour-card.php - Replaced hardcoded spacing with presets
  • src/blocks/sticky-menu/view.js - Added scroll offset buffer
  • changelog.md - Updated

Testing

  • ✅ Verified spacing consistency across pattern cards
  • ✅ Tested theme variable inheritance
  • ✅ Confirmed sticky menu scroll positioning improvement

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • Improvement (non-breaking change which improves existing functionality)

Related Issues

Fixes spacing inconsistencies in card patterns and sticky menu scroll precision

Summary by CodeRabbit

  • New Features

    • Introduced CSS spacing variables with theme inheritance for consistent spacing across patterns and templates.
  • Bug Fixes

    • Refined sticky menu scroll behaviour (small offset adjustment and focus now avoids extra scrolling).
    • Adjusted slider arrow positioning for improved visual balance.
  • Style

    • Standardised spacing in accommodation and tour card patterns using spacing tokens.
  • Documentation

    • Added changelog entry describing spacing variables.

✏️ Tip: You can customize this high-level summary in your review settings.

@chatgpt-codex-connector
Copy link

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@github-actions github-actions bot added lang:php PHP code status:needs-review Awaiting code review area:theme Theme & styles (templates, template parts, FSE) lang:css Stylesheets lang:md Markdown content/docs lang:javascript area:block-editor labels Dec 18, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 18, 2025

Caution

Review failed

The pull request is closed.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Warning

.coderabbit.yaml has a parsing error

The CodeRabbit configuration file in this repository has a parsing error and default settings were used instead. Please fix the error(s) in the configuration file. You can initialize chat with CodeRabbit to get help with the configuration file.

💥 Parsing errors (1)
Validation error: String must contain at most 250 character(s) at "tone_instructions"
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Walkthrough

Adds theme spacing variables and imports, updates compiled stylesheets, converts patterns to use spacing tokens, adjusts slider arrow offsets, tweaks sticky-menu scroll target and focus behaviour, and updates a build asset version hash.

Changes

Cohort / File(s) Summary
Spacing variables & stylesheet build outputs
src/css/_variables.scss, src/css/index.scss, build/style.css, build/style-rtl.css
Adds a new SCSS variables module declaring --wp--preset--spacing--* tokens (rem fallbacks under :where(:root)), imports it in index.scss, and includes these root-level custom properties in the compiled CSS outputs.
Sticky-menu behaviour & build asset
src/blocks/sticky-menu/view.js, build/blocks/sticky-menu/view.js, build/blocks/sticky-menu/view.asset.php
In scroll_to_section the computed top adds +5px and focus calls use focus({ preventScroll: true }); built asset PHP version/hash updated.
Pattern spacing and text tweak
patterns/accommodation-card.php, patterns/tour-card.php
Replaces fixed paddings/gaps with theme spacing tokens (`var:preset
Slider arrow offset
src/css/_slider.scss
Reduces horizontal offset for .slick-prev / .slick-next from -4rem to -2rem.
Changelog
changelog.md
Documents the addition of spacing variables with theme-inheritance fallbacks and related changes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Review src/blocks/sticky-menu/view.js for focus/accessibility edge cases and the +5px scroll adjustment.
  • Confirm :where(:root) variable use allows theme overrides and check compiled build/style*.css for duplication or specificity issues.
  • Validate pattern spacing substitutions and the "From:" label change render as intended across breakpoints.
  • Verify slider arrow position across responsive breakpoints.

Possibly related PRs

Suggested reviewers

  • krugazul

Poem

🐰 I hopped through styles with gentle paws,
I planted tokens, fixed the laws,
I nudged the scroll by five small ticks,
Tucked arrows in and changed some ticks,
The layout breathes — a tiny cause ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the two main changes: pattern card spacing variables and sticky menu scroll offset adjustments, both of which are prominent in the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

📜 Recent review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2913f62 and 9eef7f2.

📒 Files selected for processing (1)
  • patterns/accommodation-card.php (2 hunks)

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.

@github-actions github-actions bot added the meta:needs-changelog Requires a changelog entry before merge label Dec 18, 2025
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @tibiii, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly refines the user experience by standardizing spacing across pattern cards and improving the precision of the sticky menu's scroll-to-section functionality. It introduces a robust system for managing CSS spacing variables, allowing for greater theme compatibility and reducing reliance on hardcoded values within patterns. The adjustment to the sticky menu ensures smoother and more accurate navigation.

Highlights

  • Standardized Spacing Variables: Introduced a new system for CSS spacing variables (--wp--preset--spacing--10 to --wp--preset--spacing--80) with zero-specificity fallbacks using :where(), ensuring theme values take precedence.
  • Pattern Card Spacing Consistency: Updated accommodation and tour card patterns to utilize these new WordPress spacing presets, replacing previously hardcoded pixel values for improved consistency and theme compatibility.
  • Improved Sticky Menu Scroll Offset: Enhanced the sticky menu's scroll-to-section accuracy by adding a 5-pixel buffer to its scroll offset calculation.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-project-automation github-project-automation bot moved this to Needs Triage in Tour Operator Dec 18, 2025
@tibiii tibiii added this to the v2.1.0 milestone Dec 18, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces new CSS custom properties for spacing (--wp--preset--spacing-10 through --wp--preset--spacing-80) with low-specificity fallbacks using the :where() selector, allowing themes to easily override these values. These new spacing variables are then applied to various block patterns, including accommodation-card.php and tour-card.php, replacing hardcoded rem values for padding and block gaps. The sticky menu's scroll-to-section functionality was adjusted by adding a -5 pixel offset for more accurate scrolling, and the positioning of slick slider navigation arrows was changed from -4rem to -2rem. Review comments suggest reintroducing a fixed width for info labels in block patterns to prevent misalignment and updating block pattern JSON to reflect the removal of inline padding styles for consistency. Additionally, the -5 pixel scroll offset was identified as a 'magic number' and a named constant was recommended for clarity.

Copy link
Contributor

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

Caution

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

⚠️ Outside diff range comments (1)
patterns/tour-card.php (1)

40-73: Add fallback values to CSS variables in inline styles.

The file correctly uses var:preset|spacing|XX format in JSON block attributes and var(--wp--preset--spacing--XX) syntax in inline styles. However, per coding guidelines, all CSS variables in inline style attributes should include fallback values. Update lines 34, 40, and 76 to use format: var(--wp--preset--spacing--20, 32px) with appropriate pixel fallbacks based on preset definitions (e.g., spacing-20≈32px, spacing-30≈48px).

📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a468fbd and f6d7fce.

📒 Files selected for processing (11)
  • build/blocks/sticky-menu/view.asset.php (1 hunks)
  • build/blocks/sticky-menu/view.js (1 hunks)
  • build/style-rtl.css (1 hunks)
  • build/style.css (1 hunks)
  • changelog.md (1 hunks)
  • patterns/accommodation-card.php (1 hunks)
  • patterns/tour-card.php (2 hunks)
  • src/blocks/sticky-menu/view.js (1 hunks)
  • src/css/_slider.scss (1 hunks)
  • src/css/_variables.scss (1 hunks)
  • src/css/index.scss (1 hunks)
🧰 Additional context used
📓 Path-based instructions (18)
**/*.{js,jsx,ts,tsx,php,scss,css}

📄 CodeRabbit inference engine (GEMINI.md)

Use camelCase for variable and function names, kebab-case for CSS classes, and snake_case for PHP variable names per WordPress Coding Standards

Files:

  • src/css/_variables.scss
  • src/css/_slider.scss
  • build/style-rtl.css
  • patterns/tour-card.php
  • src/css/index.scss
  • src/blocks/sticky-menu/view.js
  • build/blocks/sticky-menu/view.asset.php
  • patterns/accommodation-card.php
  • build/blocks/sticky-menu/view.js
  • build/style.css
**/*.{js,jsx,ts,tsx,scss,css}

📄 CodeRabbit inference engine (GEMINI.md)

For performance optimization, implement code splitting, lazy loading, and minimize CSS/JavaScript bundle sizes in block components

Files:

  • src/css/_variables.scss
  • src/css/_slider.scss
  • build/style-rtl.css
  • src/css/index.scss
  • src/blocks/sticky-menu/view.js
  • build/blocks/sticky-menu/view.js
  • build/style.css
**/*.{php,js,jsx,ts,tsx,json}

📄 CodeRabbit inference engine (GEMINI.md)

Follow WordPress Coding Standards including proper namespacing, security practices (sanitization/escaping), and code organization

Files:

  • patterns/tour-card.php
  • src/blocks/sticky-menu/view.js
  • build/blocks/sticky-menu/view.asset.php
  • patterns/accommodation-card.php
  • build/blocks/sticky-menu/view.js
**/*.{js,jsx,ts,tsx,php}

📄 CodeRabbit inference engine (GEMINI.md)

Implement accessibility features following WCAG 2.2 AA standards in all block components and patterns

Files:

  • patterns/tour-card.php
  • src/blocks/sticky-menu/view.js
  • build/blocks/sticky-menu/view.asset.php
  • patterns/accommodation-card.php
  • build/blocks/sticky-menu/view.js
**/*.{php,js,jsx,ts,tsx}

📄 CodeRabbit inference engine (GEMINI.md)

Validate generated code against WordPress standards, test thoroughly, check security implications, and review for proper sanitization/escaping

Files:

  • patterns/tour-card.php
  • src/blocks/sticky-menu/view.js
  • build/blocks/sticky-menu/view.asset.php
  • patterns/accommodation-card.php
  • build/blocks/sticky-menu/view.js
**/*tour*.{php,jsx,tsx}

📄 CodeRabbit inference engine (GEMINI.md)

Include all meta tags, schema.org markup, and SEO-related data in tour listing and detail components for proper search engine indexing

Files:

  • patterns/tour-card.php
**/*.php

📄 CodeRabbit inference engine (AGENTS.md)

Follow WordPress Coding Standards (WPCS) for all WordPress code

**/*.php: Store block patterns in the /patterns/ directory at the root of the plugin (WordPress standard for plugins), not in /includes/patterns/
Use text domain 'tour-operator' for all localization strings in the plugin

Files:

  • patterns/tour-card.php
  • build/blocks/sticky-menu/view.asset.php
  • patterns/accommodation-card.php
**/patterns/*.php

📄 CodeRabbit inference engine (.github/instructions/figma-to-wordpress-pattern-extraction.instructions.md)

**/patterns/*.php: WordPress pattern PHP files must be located in /patterns/[pattern-slug].php at root level with required metadata in PHP DocBlock
Use plugin constants like LSX_TO_URL for asset paths in pattern files, not theme functions like get_template_directory_uri()
Always use 'tour-operator' as the text domain for internationalization functions in WordPress pattern files
Wrap all user-facing text in internationalization functions (esc_html_e(), (), esc_attr()) in WordPress pattern files
Preserve Figma layer names in WordPress blocks using the metadata attribute with 'name' property
Use block binding source 'lsx/post-meta' for custom data connections in WordPress block patterns
Use self-closing block syntax for dynamic/static blocks (e.g., lsx-tour-operator/icons, post-featured-image) that render via PHP
Do not embed SVG markup directly in icon block patterns; use self-closing icon block syntax to allow dynamic rendering
Include absolute fallback values (hex colors, rem sizes) for all CSS variables in inline styles within WordPress patterns
Use WordPress preset slug format in JSON block attributes (var:preset|color|slug format) separately from inline CSS fallback syntax
Add PHP DocBlock metadata with title, slug (tour-operator/pattern-name format), description, categories, keywords, block types, and post types to WordPress pattern files
Use LSX_TO_URL constant to reference plugin assets instead of theme asset functions in pattern content strings
Include the phpcs:ignoreFile comment for PluginCheck.CodeAnalysis.ImageFunctions.NonEnqueuedImage at the top of WordPress pattern PHP files
Use available icon block attributes (iconType: 'outline'|'solid', iconName from icon library) in lsx-tour-operator/icons blocks within patterns

**/patterns/*.php: Use PHP array return format for plugin patterns instead of file header comments (unlike themes where patterns auto-register from /patterns/ using file headers)
Include required pattern properties: 'title' and e...

Files:

  • patterns/tour-card.php
  • patterns/accommodation-card.php
**/*.{php,html}

📄 CodeRabbit inference engine (.github/instructions/patterns-templates-refactoring.instructions.md)

**/*.{php,html}: Always use LSX_TO_URL and LSX_TO_PATH constants for asset paths in plugin files
Include CSS variable fallbacks with absolute hex values in inline styles for plugin compatibility with any theme
Use CSS variable format var(--wp--preset--[type]--[name], fallback_value) in inline styles, not var:preset|[type]|[name] format
Use var:preset|[type]|[name] format only within JSON block attributes, not in inline styles
Use the correct spacing preset names: 'tiny' (10px), 'small' (16px), 'medium' (32px), 'large' (48px), and 'x-small' (8px)

Files:

  • patterns/tour-card.php
  • build/blocks/sticky-menu/view.asset.php
  • patterns/accommodation-card.php
**/{patterns,templates,parts}/*.{php,html}

📄 CodeRabbit inference engine (.github/instructions/patterns-templates-refactoring.instructions.md)

**/{patterns,templates,parts}/*.{php,html}: For icon blocks, use self-closing syntax and never embed HTML content inside icon block markup to prevent validation errors
Use primary color preset for buttons, borders, and main brand elements; use 'contrast' preset for text/links; use 'base' for white backgrounds

Files:

  • patterns/tour-card.php
  • patterns/accommodation-card.php
**/{templates,patterns,parts}/*.{php,html}

📄 CodeRabbit inference engine (.github/instructions/patterns-templates-refactoring.instructions.md)

Use wide alignment constraint for main content containers in single templates and align-full for full-width sections like breadcrumbs

Files:

  • patterns/tour-card.php
  • patterns/accommodation-card.php
**/*.{php,twig}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Do not generate .php, .twig, or legacy CMS files

Files:

  • patterns/tour-card.php
  • build/blocks/sticky-menu/view.asset.php
  • patterns/accommodation-card.php
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Use semicolons to terminate statements in JavaScript block code

Ensure all generated code follows ESLint rules and WordPress Coding Standards before deployment

Files:

  • src/blocks/sticky-menu/view.js
  • build/blocks/sticky-menu/view.js
src/blocks/**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use Block API v3 standards when developing blocks

Files:

  • src/blocks/sticky-menu/view.js
{src/blocks/**/*.{js,jsx,ts,tsx},src/**/*.php,inc/**/*.php}

📄 CodeRabbit inference engine (AGENTS.md)

Apply WCAG 2.2 AA accessibility standards to all blocks and UI components

Files:

  • src/blocks/sticky-menu/view.js
**/*.{js,ts,tsx,jsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.{js,ts,tsx,jsx}: Use async/await syntax; avoid .then() chains
Use named exports; avoid default exports unless wrapping a module

Files:

  • src/blocks/sticky-menu/view.js
  • build/blocks/sticky-menu/view.js
src/**/*.{js,ts,tsx,jsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

src/**/*.{js,ts,tsx,jsx}: Document public functions with JSDoc
Do not include any WordPress-related imports, functions, or file structures
Do not reference or assume plugins like WooCommerce or Wetu

Files:

  • src/blocks/sticky-menu/view.js
**/blocks/**/*.php

📄 CodeRabbit inference engine (CLAUDE.md)

PHP render callbacks must be properly documented with descriptions of attributes and return values

Files:

  • build/blocks/sticky-menu/view.asset.php
🧬 Code graph analysis (1)
build/blocks/sticky-menu/view.js (1)
src/js/custom.js (1)
  • lsx_to (8-8)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Summary
🔇 Additional comments (8)
build/blocks/sticky-menu/view.asset.php (1)

1-1: LGTM!

This is an auto-generated build asset file. The version hash update correctly reflects the changes made to the source view.js file.

src/css/_slider.scss (1)

246-250: LGTM!

The slider arrow positioning adjustment from -4rem to -2rem is applied consistently to both .slick-prev and .slick-next. This brings the navigation arrows closer to the slider content edge.

src/css/index.scss (1)

5-5: LGTM!

The variables module is correctly imported before other modules, ensuring CSS spacing variables are available to subsequent imports like slider. Using @use is the modern SCSS approach.

build/style.css (1)

1-1: LGTM!

The compiled CSS correctly includes:

  1. Spacing variable fallbacks using :where(:root) for zero-specificity, ensuring theme definitions take precedence
  2. WordPress-aligned naming (--wp--preset--spacing--10 through --80)
  3. rem-based values which respect user font size preferences for better accessibility
  4. Updated slider arrow positions (-2rem) as modified in the source

The spacing scale progression (0.125rem → 6rem) provides good granularity for layout flexibility.

build/blocks/sticky-menu/view.js (1)

1-1: Approve with note on the scroll offset buffer.

The 5px scroll offset buffer addition (window.pageYOffset+n.top-o-5) addresses the sticky menu scroll positioning improvement mentioned in the PR objectives. This is a build artifact; the magic number 5 should ideally be documented or made configurable in the source file (src/blocks/sticky-menu/view.js) for maintainability.

The implementation correctly:

  • Accounts for admin bar, fixed header, and navigation heights
  • Respects prefers-reduced-motion for accessibility
  • Includes proper ARIA attributes and screen reader announcements

Consider documenting the 5px buffer rationale in the source file:

#!/bin/bash
# Check the source file for comments explaining the 5px offset
rg -n -C3 'pageYOffset.*top.*offset' src/blocks/sticky-menu/view.js
src/blocks/sticky-menu/view.js (1)

65-65: LGTM! Scroll offset buffer improves positioning accuracy.

The additional 5-pixel buffer ensures sticky menu items align more precisely when scrolling to sections, accounting for potential pixel rounding or border widths in the layout.

src/css/_variables.scss (1)

1-35: Excellent implementation of theme-aware spacing tokens.

The use of :where(:root) ensures zero specificity, allowing theme-defined spacing values to take precedence whilst providing sensible rem-based fallbacks. The documentation clearly explains the scale ratios and purpose.

patterns/tour-card.php (1)

45-45: Good improvement to label clarity.

Changing the price label from "Price:" to "From:" better indicates that the displayed price is a starting price, which is common practice for tour pricing.

Copy link
Contributor

@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

♻️ Duplicate comments (3)
patterns/accommodation-card.php (3)

35-35: Add fallback values to CSS variables in inline styles.

The inline style attribute on line 35 uses var(--wp--preset--spacing--30) without fallback values. According to the coding guidelines, all CSS variables in inline styles within WordPress patterns must include absolute fallback values (hex colors, rem sizes) for theme compatibility.

🔎 Apply this diff to add fallback values:
-<div class="wp-block-group" style="padding-right:var(--wp--preset--spacing--30);padding-left:var(--wp--preset--spacing--30)">
+<div class="wp-block-group" style="padding-right:var(--wp--preset--spacing--30, 2rem);padding-left:var(--wp--preset--spacing--30, 2rem)">

As per coding guidelines, inline styles must include fallback values.


84-84: Add fallback values to CSS variables in inline styles.

The inline style attribute on line 84 uses var(--wp--preset--spacing--20) three times without fallback values. According to the coding guidelines, all CSS variables in inline styles within WordPress patterns must include absolute fallback values for theme compatibility.

🔎 Apply this diff to add fallback values:
-<div class="wp-block-group" style="padding-right:var(--wp--preset--spacing--20);padding-bottom:var(--wp--preset--spacing--20);padding-left:var(--wp--preset--spacing--20)">
+<div class="wp-block-group" style="padding-right:var(--wp--preset--spacing--20, 1rem);padding-bottom:var(--wp--preset--spacing--20, 1rem);padding-left:var(--wp--preset--spacing--20, 1rem)">

As per coding guidelines, inline styles must include fallback values.


40-40: Add fallback values to CSS variables in inline styles.

The inline style attribute on line 40 uses var(--wp--preset--spacing--20) four times without fallback values. According to the coding guidelines, all CSS variables in inline styles within WordPress patterns must include absolute fallback values for theme compatibility.

🔎 Apply this diff to add fallback values:
-<div aria-label="' . esc_attr__( 'Accommodation details', 'tour-operator' ) . '" class="wp-block-group lsx-accommodation-info has-medium-font-size" style="border-top-width:1px;border-bottom-width:1px;padding-top:var(--wp--preset--spacing--20);padding-right:var(--wp--preset--spacing--20);padding-bottom:var(--wp--preset--spacing--20);padding-left:var(--wp--preset--spacing--20)">
+<div aria-label="' . esc_attr__( 'Accommodation details', 'tour-operator' ) . '" class="wp-block-group lsx-accommodation-info has-medium-font-size" style="border-top-width:1px;border-bottom-width:1px;padding-top:var(--wp--preset--spacing--20, 1rem);padding-right:var(--wp--preset--spacing--20, 1rem);padding-bottom:var(--wp--preset--spacing--20, 1rem);padding-left:var(--wp--preset--spacing--20, 1rem)">

As per coding guidelines, inline styles must include fallback values.

📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2ce3a46 and 2913f62.

📒 Files selected for processing (2)
  • changelog.md (1 hunks)
  • patterns/accommodation-card.php (2 hunks)
🧰 Additional context used
📓 Path-based instructions (10)
**/*.{php,js,jsx,ts,tsx,json}

📄 CodeRabbit inference engine (GEMINI.md)

Follow WordPress Coding Standards including proper namespacing, security practices (sanitization/escaping), and code organization

Files:

  • patterns/accommodation-card.php
**/*.{js,jsx,ts,tsx,php}

📄 CodeRabbit inference engine (GEMINI.md)

Implement accessibility features following WCAG 2.2 AA standards in all block components and patterns

Files:

  • patterns/accommodation-card.php
**/*.{php,js,jsx,ts,tsx}

📄 CodeRabbit inference engine (GEMINI.md)

Validate generated code against WordPress standards, test thoroughly, check security implications, and review for proper sanitization/escaping

Files:

  • patterns/accommodation-card.php
**/*.{js,jsx,ts,tsx,php,scss,css}

📄 CodeRabbit inference engine (GEMINI.md)

Use camelCase for variable and function names, kebab-case for CSS classes, and snake_case for PHP variable names per WordPress Coding Standards

Files:

  • patterns/accommodation-card.php
**/*.php

📄 CodeRabbit inference engine (AGENTS.md)

Follow WordPress Coding Standards (WPCS) for all WordPress code

**/*.php: Store block patterns in the /patterns/ directory at the root of the plugin (WordPress standard for plugins), not in /includes/patterns/
Use text domain 'tour-operator' for all localization strings in the plugin

Files:

  • patterns/accommodation-card.php
**/patterns/*.php

📄 CodeRabbit inference engine (.github/instructions/figma-to-wordpress-pattern-extraction.instructions.md)

**/patterns/*.php: WordPress pattern PHP files must be located in /patterns/[pattern-slug].php at root level with required metadata in PHP DocBlock
Use plugin constants like LSX_TO_URL for asset paths in pattern files, not theme functions like get_template_directory_uri()
Always use 'tour-operator' as the text domain for internationalization functions in WordPress pattern files
Wrap all user-facing text in internationalization functions (esc_html_e(), (), esc_attr()) in WordPress pattern files
Preserve Figma layer names in WordPress blocks using the metadata attribute with 'name' property
Use block binding source 'lsx/post-meta' for custom data connections in WordPress block patterns
Use self-closing block syntax for dynamic/static blocks (e.g., lsx-tour-operator/icons, post-featured-image) that render via PHP
Do not embed SVG markup directly in icon block patterns; use self-closing icon block syntax to allow dynamic rendering
Include absolute fallback values (hex colors, rem sizes) for all CSS variables in inline styles within WordPress patterns
Use WordPress preset slug format in JSON block attributes (var:preset|color|slug format) separately from inline CSS fallback syntax
Add PHP DocBlock metadata with title, slug (tour-operator/pattern-name format), description, categories, keywords, block types, and post types to WordPress pattern files
Use LSX_TO_URL constant to reference plugin assets instead of theme asset functions in pattern content strings
Include the phpcs:ignoreFile comment for PluginCheck.CodeAnalysis.ImageFunctions.NonEnqueuedImage at the top of WordPress pattern PHP files
Use available icon block attributes (iconType: 'outline'|'solid', iconName from icon library) in lsx-tour-operator/icons blocks within patterns

**/patterns/*.php: Use PHP array return format for plugin patterns instead of file header comments (unlike themes where patterns auto-register from /patterns/ using file headers)
Include required pattern properties: 'title' and e...

Files:

  • patterns/accommodation-card.php
**/*.{php,html}

📄 CodeRabbit inference engine (.github/instructions/patterns-templates-refactoring.instructions.md)

**/*.{php,html}: Always use LSX_TO_URL and LSX_TO_PATH constants for asset paths in plugin files
Include CSS variable fallbacks with absolute hex values in inline styles for plugin compatibility with any theme
Use CSS variable format var(--wp--preset--[type]--[name], fallback_value) in inline styles, not var:preset|[type]|[name] format
Use var:preset|[type]|[name] format only within JSON block attributes, not in inline styles
Use the correct spacing preset names: 'tiny' (10px), 'small' (16px), 'medium' (32px), 'large' (48px), and 'x-small' (8px)

Files:

  • patterns/accommodation-card.php
**/{patterns,templates,parts}/*.{php,html}

📄 CodeRabbit inference engine (.github/instructions/patterns-templates-refactoring.instructions.md)

**/{patterns,templates,parts}/*.{php,html}: For icon blocks, use self-closing syntax and never embed HTML content inside icon block markup to prevent validation errors
Use primary color preset for buttons, borders, and main brand elements; use 'contrast' preset for text/links; use 'base' for white backgrounds

Files:

  • patterns/accommodation-card.php
**/{templates,patterns,parts}/*.{php,html}

📄 CodeRabbit inference engine (.github/instructions/patterns-templates-refactoring.instructions.md)

Use wide alignment constraint for main content containers in single templates and align-full for full-width sections like breadcrumbs

Files:

  • patterns/accommodation-card.php
**/*.{php,twig}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Do not generate .php, .twig, or legacy CMS files

Files:

  • patterns/accommodation-card.php
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Summary
🔇 Additional comments (1)
changelog.md (1)

10-10: LGTM! PR reference added.

The PR reference has been added to maintain consistency with other changelog entries, addressing the previous review feedback.

@tibiii tibiii merged commit 5a192c9 into 2.1-trunk Dec 18, 2025
4 of 7 checks passed
@tibiii tibiii deleted the fix/pattern-cards-spacings branch December 18, 2025 13:13
@github-project-automation github-project-automation bot moved this from Needs Triage to ✅ Done in Tour Operator Dec 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:block-editor area:theme Theme & styles (templates, template parts, FSE) lang:css Stylesheets lang:javascript lang:md Markdown content/docs lang:php PHP code meta:needs-changelog Requires a changelog entry before merge status:needs-review Awaiting code review

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

1 participant