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::extractImportAndCharsetRules( string $css )
Extracts @import and @charset rules from the supplied CSS. These rules must not be preceded by any other rules, or they will be ignored. (From the CSS 2.1 specification: “CSS 2.1 user agents must ignore any ‘@import’ rule that occurs inside a block or after any non-ignored statement other than an @charset or an @import rule.” Note also that @charset is case sensitive whereas @import is not.)
Description Description
Parameters Parameters
- $css
-
(Required) CSS with comments removed
Return Return
(string[]) The first element is the CSS with the valid @import and @charset rules removed. The second element contains a concatenation of the valid @import rules, each followed by whatever whitespace followed it in the original CSS (so that either unminified or minified formatting is preserved); if there were no @import rules, it will be an empty string. The (valid) @charset rules are discarded.
Source Source
File: vendor/pelago/emogrifier/src/Emogrifier/CssInliner.php