Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

CssInliner::splitCssAndMediaQuery( string $css )

Splits input CSS code into an array of parts for different media queries, in order.


Description Description

Each part is an array where:

  • key "css" will contain clean CSS code (for @media rules this will be the group rule body within "{…}")
  • key "media" will contain "@media " followed by the media query list, for all allowed media queries, or an empty string for CSS not within a media query

Example:

The CSS code

"@import "file.css"; h1 { color:red; } @media { h1 {}} @media tv { h1 {}}"

will be parsed into the following array:

0 => [ "css" => "h1 { color:red; }", "media" => "" ], 1 => [ "css" => " h1 {}", "media" => "@media " ]


Parameters Parameters

$css

(Required)


Top ↑

Return Return

(string[][])


Top ↑

Source Source

File: vendor/pelago/emogrifier/src/Emogrifier/CssInliner.php


			


Top ↑

User Contributed Notes User Contributed Notes

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