astra_color_responsive_css( array $setting, string $css_property, string $selector )

Astra Responsive Colors


Description


Parameters

$setting

(array) (Required) Responsive colors.

$css_property

(string) (Required) CSS property.

$selector

(string) (Required) CSS selector.


Return

(string) Dynamic responsive CSS.


Source

File: classes/astra-common-functions.php

	function astra_color_responsive_css( $setting, $css_property, $selector ) {
		$css = '';
		if ( isset( $setting['desktop'] ) && ! empty( $setting['desktop'] ) ) {
			$css .= $selector . '{' . $css_property . ':' . esc_attr( $setting['desktop'] ) . ';}';
		}
		if ( isset( $setting['tablet'] ) && ! empty( $setting['tablet'] ) ) {
			$css .= '@media (max-width:' . astra_addon_get_tablet_breakpoint() . 'px) {' . $selector . '{' . $css_property . ':' . esc_attr( $setting['tablet'] ) . ';} }';
		}
		if ( isset( $setting['mobile'] ) && ! empty( $setting['mobile'] ) ) {
			$css .= '@media (max-width:' . astra_addon_get_mobile_breakpoint() . 'px) {' . $selector . '{' . $css_property . ':' . esc_attr( $setting['mobile'] ) . ';} }';
		}
		return $css;
	}


User Contributed Notes

You must log in before being able to contribute a note or feedback.