Skip to content

feat(advanced-accordion): add Image Fit & Position controls for Media Accordion image - #855

Open
nahidthenh wants to merge 3 commits into
dev-prfrom
84095-media-image-fit
Open

nahidthenh wants to merge 3 commits into
dev-prfrom
84095-media-image-fit

Conversation

@nahidthenh

Copy link
Copy Markdown
Member

Summary

Adds built-in Image Fit (object-fit) and Image Position (object-position) controls for the Media Accordion image in the Advanced Accordion widget, so users can control how the tab image adapts to its container without writing custom CSS.

Card: https://projects.startise.com//fbs-84095
Help Scout: 286173

Problem

The Media Accordion image was locked to object-fit: cover (hard-coded in Pro's advanced-accordion.scss), so tall/wide images were always cropped to fill. The only workaround was custom CSS.

Changes

  • New Image Fit responsive SELECT: Cover · Contain · Fill · Scale Down · None (Original Size)
  • New Image Position responsive SELECT (9 anchor points), shown when Fit is cover/contain/scale-down/none
  • Both live in the existing Media image style section (next to Height / Border Radius), conditioned on eael_adv_accordion_type = accordion_media

Why this placement

The sibling media-image style controls (Height, Border Radius) already live in Lite and are inert unless the Pro Media Accordion type is active, so no Pro↔Lite bridge hook is needed. Selector specificity cleanly overrides the base SCSS object-fit: cover (which has no !important).

Backwards compatibility

Default is cover → existing widgets render identically. Purely additive, no regression.

Testing

  • Media Accordion → Style → set Image Fit = Contain → image no longer cropped (editor + frontend); Fill/None behave as expected
  • Image Position shifts the visible crop region when Fit = Cover
  • Responsive per-breakpoint values apply correctly
  • Applies to video tabs too (shared .eael-accordion_media-image class)
  • Existing Media Accordions unchanged (default cover)

Notes

  • PHP-only change (no src/ assets touched) → no rebuild / compiled-asset churn
  • php -l clean

🤖 Generated with Claude Code

@nahidthenh nahidthenh self-assigned this Aug 4, 2026
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