resolve_responsive_scalar_style_value( $atts, 'width', 'desktop', 'number' ); $width = null === $width ? 100 : max( 1, min( 100, absint( $width ) ) ); $classes = array( 'stacklar-field', 'stacklar-field--section', 'stacklar-section', 'stacklar-section--' . $divider ); if ( ! empty( $atts['className'] ) ) { $classes[] = sanitize_html_class( $atts['className'] ); } $style_rules = array( '--stacklar-field-width:' . stacklar_sanitize_css_value( $width ) . '%;', ); $padding = isset( $atts['padding'] ) ? $this->css_box_value( $atts['padding'], 'desktop' ) : ''; if ( '' !== $padding ) { $style_rules[] = 'padding:' . stacklar_sanitize_css_value( $padding ) . ';'; } $margin = isset( $atts['margin'] ) ? $this->css_box_value( $atts['margin'], 'desktop' ) : ''; if ( '' !== $margin ) { $style_rules[] = 'margin:' . stacklar_sanitize_css_value( $margin ) . ';'; } $title_rules = array(); $title_color = trim( (string) $this->resolve_responsive_scalar_style_value( $atts, 'titleColor', 'desktop', 'string' ) ); if ( '' !== $title_color ) { $title_rules[] = 'color:' . stacklar_sanitize_css_value( $title_color ) . ';'; } $description_rules = array(); $description_color = trim( (string) $this->resolve_responsive_scalar_style_value( $atts, 'descriptionColor', 'desktop', 'string' ) ); if ( '' !== $description_color ) { $description_rules[] = 'color:' . stacklar_sanitize_css_value( $description_color ) . ';'; } $divider_rules = array(); $divider_color = trim( (string) $this->resolve_responsive_scalar_style_value( $atts, 'dividerColor', 'desktop', 'string' ) ); if ( '' !== $divider_color ) { $divider_rules[] = 'border-color:' . stacklar_sanitize_css_value( $divider_color ) . ';'; } $html = '
build_style_attribute( $style_rules ) . '>'; if ( '' !== $title ) { $html .= '<' . tag_escape( $level ) . ' class="stacklar-section__title"' . $this->build_style_attribute( $title_rules ) . '>' . esc_html( $title ) . ''; } if ( '' !== $description ) { $html .= '

build_style_attribute( $description_rules ) . '>' . esc_html( $description ) . '

'; } if ( 'none' !== $divider ) { $html .= '
build_style_attribute( $divider_rules ) . ' />'; } $html .= '
'; return $html; } }