Select all node that match the style object passed as parameter
Name | Type | Description | Status | Default |
---|---|---|---|---|
selector | { String } | The css selector to use as base filter | required | |
style | { Object } | The style that has to match | required | |
settings | { Object } | A setting object | optional | {} |
Return { [Array] } An array of HTMLElement that matches the style object
import querySelectorAllWithStyle from 'coffeekraken-sugar/js/dom/querySelectorAllWithStyle'
querySelectorAllWithStyle('*', {
backgroundImage: true
})
// style object can contains either:
const style = {
backgroundImage: true, // has to have the background-image style
backgroundPosition: false, // has to not have the background-position style
backgroundSize: /cover|contain/, // has to have the background-size set to cover or contain
background: 'none' // has to have to background set to "none"
}
Author : Olivier Bossel [email protected] https://olivierbossel.com
Here's the list of available setting(s).
The root node used to select the the elements within
Type : { HTMLElement }
Default : document