- WordPress 6.9.4 (es_ES) with Kadence theme - Homepage: Hero, La Asociación, Pilares, Beneficios, Eventos, Miembros, Hazte Miembro, Contacto - Brand identity: #13294b navy, #a12932 burgundy, #c69c48 gold - Fonts: Raleway (headings) + Source Sans 3 (body) + Lato (UI) - Plugins: Kadence Blocks, Polylang, Contact Form 7 - Custom CSS with full brand styling and responsive layout - HTTPS enforced via wp-config.php proxy detection
54 lines
1.3 KiB
PHP
54 lines
1.3 KiB
PHP
<?php declare( strict_types=1 );
|
|
|
|
namespace KadenceWP\KadenceBlocks\Optimizer\Response;
|
|
|
|
/**
|
|
* Data Transfer Object representing CSS computed style properties for an element.
|
|
*
|
|
* Contains the computed CSS values for width, height, object-fit, and object-position
|
|
* properties as extracted from the browser's computed styles.
|
|
*/
|
|
final class ComputedStyle {
|
|
|
|
public string $width;
|
|
public string $height;
|
|
public string $objectFit;
|
|
public string $objectPosition;
|
|
|
|
private function __construct(
|
|
string $width,
|
|
string $height,
|
|
string $objectFit,
|
|
string $objectPosition
|
|
) {
|
|
$this->width = $width;
|
|
$this->height = $height;
|
|
$this->objectFit = $objectFit;
|
|
$this->objectPosition = $objectPosition;
|
|
}
|
|
|
|
/**
|
|
* @param array{width: string, height: string, objectFit: string, objectPosition: string} $attributes
|
|
*/
|
|
public static function from( array $attributes ): self {
|
|
return new self(
|
|
$attributes['width'],
|
|
$attributes['height'],
|
|
$attributes['objectFit'],
|
|
$attributes['objectPosition']
|
|
);
|
|
}
|
|
|
|
/**
|
|
* @return array{width: string, height: string, objectFit: string, objectPosition: string}
|
|
*/
|
|
public function toArray(): array {
|
|
return [
|
|
'width' => $this->width,
|
|
'height' => $this->height,
|
|
'objectFit' => $this->objectFit,
|
|
'objectPosition' => $this->objectPosition,
|
|
];
|
|
}
|
|
}
|