Skip to content

Commit

Permalink
Tweak: Add flex hero image width control [TMZ-304](#165)
Browse files Browse the repository at this point in the history
  • Loading branch information
mserino authored Jan 14, 2025
1 parent 140e560 commit a0d1293
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion modules/content/widgets/flex-hero.php
Original file line number Diff line number Diff line change
Expand Up @@ -1077,7 +1077,34 @@ protected function add_style_image_section() {
'{{WRAPPER}} .ehp-flex-hero' => '--flex-hero-image-height: {{SIZE}}{{UNIT}};',
],
'condition' => [
'image_stretch' => '',
'image_stretch!' => 'yes',
],
]
);

$this->add_responsive_control(
'image_width',
[
'label' => esc_html__( 'Width', 'hello-plus' ),
'type' => Controls_Manager::SLIDER,
'size_units' => [ 'px', 'em', 'rem', '%', 'custom' ],
'range' => [
'px' => [
'max' => 1500,
],
'%' => [
'max' => 100,
],
],
'default' => [
'size' => 100,
'unit' => '%',
],
'selectors' => [
'{{WRAPPER}} .ehp-flex-hero' => '--flex-hero-image-width: {{SIZE}}{{UNIT}};',
],
'condition' => [
'image_stretch!' => 'yes',
],
]
);
Expand Down

0 comments on commit a0d1293

Please sign in to comment.