hide-if-has-and-matches-style
The hide-if-has-and-matches-style snippet hides any HTML element (or its ancestors) that matches a CSS selector if a descendant matches a given CSS selector and, optionally, if the element's computed style contains a given string.
Parameters
|
Name |
Description |
Mandatory |
|---|---|---|
|
search |
The CSS selector against which to match descendants. |
Yes |
|
selector |
The CSS selector that an HTML element must match to be hidden. |
Yes |
|
|
CSS selector for elements containing the specified descendants. Defaults to |
No |
|
style |
The string the computed style of the matching element must contain. |
No |
|
|
The string the computed style of |
No |
|
|
Delay until given state. |
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 any |
|
|
Hides the div with |