From 1b9910165b03560bc189e6387835f87ab6965e93 Mon Sep 17 00:00:00 2001 From: FrankZamora Date: Thu, 27 Nov 2025 21:38:04 -0600 Subject: [PATCH] fix(rail-ads): Position rails fixed at viewport edges MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Changed Rail Ads positioning from container-width-based formula to fixed 15px from viewport edges - Rails no longer move inward when container width is reduced - Fixes overlap issue when layout width setting changes 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .../Infrastructure/Ui/AdsensePlacementRenderer.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Public/AdsensePlacement/Infrastructure/Ui/AdsensePlacementRenderer.php b/Public/AdsensePlacement/Infrastructure/Ui/AdsensePlacementRenderer.php index 399f711f..fc55ab51 100644 --- a/Public/AdsensePlacement/Infrastructure/Ui/AdsensePlacementRenderer.php +++ b/Public/AdsensePlacement/Infrastructure/Ui/AdsensePlacementRenderer.php @@ -322,16 +322,15 @@ final class AdsensePlacementRenderer 'transition' => 'top 0.2s ease-out', ]); - // Posicion rail izquierdo - usar max() para evitar valores negativos - // Usa CSS variable --roi-container-width-numeric de ThemeSettings (fallback 1320px) - // Formula: max(10px, calc((100vw - containerWidth) / 2 - (width + 20)px)) + // Posicion rail izquierdo - FIJO en el borde del viewport + // Los Rails NO dependen del container width, siempre estan a 15px del borde $cssRules[] = $this->cssGenerator->generate('.roi-rail-ad-left', [ - 'left' => 'max(10px, calc((100vw - var(--roi-container-width-numeric, 1320px)) / 2 - ' . ($width + 20) . 'px))', + 'left' => '15px', ]); - // Posicion rail derecho - usar max() para consistencia + // Posicion rail derecho - FIJO en el borde del viewport $cssRules[] = $this->cssGenerator->generate('.roi-rail-ad-right', [ - 'right' => 'max(10px, calc((100vw - var(--roi-container-width-numeric, 1320px)) / 2 - ' . ($width + 20) . 'px))', + 'right' => '15px', ]); // Media query para ocultar en pantallas < 1600px