Skip to content

Latest commit

 

History

History
46 lines (30 loc) · 1.71 KB

querySelectorAllWithStyle.md

File metadata and controls

46 lines (30 loc) · 1.71 KB

querySelectorAllWithStyle

Select all node that match the style object passed as parameter

Parameters

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

Example

	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

Settings

Here's the list of available setting(s).

settings.rootNode

The root node used to select the the elements within

Type : { HTMLElement }

Default : document