hide-if-contains-and-matches-style
The hide-if-contains-and-matches-style snippet hides any HTML element (or its ancestors) that matches a CSS selector if the element's text content contains a given string and, optionally, if the element's computed style contains a given string.
Parameters
|
Name |
Description |
Mandatory |
|---|---|---|
|
search |
The string to look for in HTML elements. Enclose in |
Yes |
|
selector |
The CSS selector that an HTML element must match to be hidden. |
Yes |
|
|
CSS selector for elements containing the string. Defaults to |
No |
|
style |
The string that the computed style of the matching element must contain. |
No |
|
|
The string the computed style of |
No |
|
|
Delay until given state is reached (loading, interactive, complete, load, or event name). |
No |
|
|
Disable if window.innerWidth is smaller than this value. |
No |
|
|
Disable if window.innerWidth is greater than this value. |
No |
Filter examples
|
Filter |
Result |
|---|---|
|
|
Hides any |
|
|
Hides |
|
|
Hides |
|
|
Hides |