Astra_Dynamic_CSS::astra_sticky_sidebar_css()

Dynamic CSS to make Sidebar Sticky.


Description


Return

(string) Sticky Sidebar CSS.


Source

File: inc/class-astra-dynamic-css.php

		public static function astra_sticky_sidebar_css() {
			$css = '';
			if ( astra_get_option( 'site-sticky-sidebar', false ) ) {
				$sidebar_sticky_css        = array(
					'.ast-sticky-sidebar .sidebar-main' => array(
						'top'        => '50px',
						'position'   => 'sticky',
						'overflow-y' => 'auto',
					),
				);
				$sidebar_webkit_sticky_css = array(
					'.ast-sticky-sidebar .sidebar-main' => array(
						'position' => '-webkit-sticky',
					),
				);

				$css .= astra_parse_css(
					$sidebar_sticky_css,
					astra_get_tablet_breakpoint( '', 1 )
				);

				$css .= astra_parse_css(
					$sidebar_webkit_sticky_css,
					astra_get_tablet_breakpoint( '', 1 )
				);
			}
			return $css;
		}

Changelog

Changelog
Version Description
4.4.0 Introduced.


User Contributed Notes

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