Function __global->filter_css
Definitions
sources/mail.php
- Filter out any CSS selector blocks from the given CSS if they definitely do not affect the given (X)HTML.While this is a clever algorithm, it isn't so clever as to actually try and match each selector against a DOM tree. If any segment of a compound selector matches, match is assumed.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: string
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $c | ID_TEXT | No | No | required parameter | N/A | N/A | CSS file |
| $theme | ?ID_TEXT | No | No | required parameter | N/A | N/A | Theme (null: default) |
| $context | string | No | No | required parameter | N/A | N/A | (X) HTML context under which CSS is filtered |
Returns
- Filtered CSS
- Type: string
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Filter out any CSS selector blocks from the given CSS if they definitely do not affect the given (X)HTML.While this is a clever algorithm, it isn't so clever as to actually try and match each selector against a DOM tree. If any segment of a compound selector matches, match is assumed.
*
* @param ID_TEXT $c CSS file
* @param ?ID_TEXT $theme Theme (null: default)
* @param string $context (X) HTML context under which CSS is filtered
* @return string Filtered CSS
*/
function filter_css(string $c, ?string $theme, string $context) : string
* Filter out any CSS selector blocks from the given CSS if they definitely do not affect the given (X)HTML.While this is a clever algorithm, it isn't so clever as to actually try and match each selector against a DOM tree. If any segment of a compound selector matches, match is assumed.
*
* @param ID_TEXT $c CSS file
* @param ?ID_TEXT $theme Theme (null: default)
* @param string $context (X) HTML context under which CSS is filtered
* @return string Filtered CSS
*/
function filter_css(string $c, ?string $theme, string $context) : string

