serialize_breakpoint_block( $breakpoint, $decl ); } public function serialize_nested_block( string $breakpoint, string $selector, string $css ): string { $inner = '&' . $selector . ' { ' . trim( $css ) . ' }'; return $this->serialize_breakpoint_block( $breakpoint, $inner ); } public function serialize_breakpoint_block( string $breakpoint, string $css ): string { $css = trim( $css ); if ( '' === $css ) { return ''; } if ( Responsive_Key_Resolver::BASE_BREAKPOINT === $breakpoint ) { return $css; } return '@media(--' . $breakpoint . ') { ' . $css . ' }'; } /** * @param string[] $parts */ public function join( array $parts ): string { $parts = array_values( array_filter( array_map( 'trim', $parts ) ) ); return implode( ' ', $parts ); } }