import css from 'bianco.css'
Set any css property on a single node or a list of DOM nodes.
els
(HTMLElement | NodeList | Array) DOM node/s to parsename
(string | Object) either the name of the property to set or a list of properties as object key - valuevalue
string the new value of the property (optional)
import { set } from 'bianco.css'
const img = document.createElement('img')
set(img, 'width', 100)
// or also
set(img, {
width: 300,
height: 300
})
Returns (HTMLElement | NodeList | Array) the original array of elements passed to this function.
Get any property from a single node or a list of DOM nodes.
els
(HTMLElement | NodeList | Array) DOM node/s to parsenames
(string | Array) name or list of properties to get
import { get } from 'bianco.css'
const img = document.createElement('img')
get(img, 'width') // => '200'
// or also
get(img, ['width', 'height']) // => {width: '200', height: '300'}
// or also
get([img1, img2], ['width', 'height']) // => [{width: '200', height: '300'}, {width: '500', height: '200'}]
Returns (Array | string) list of the properties found.
Remove any css property from a single node or a list of DOM nodes.
els
(HTMLElement | NodeList | Array) DOM node/s to parsenames
(string | Array) name or list of properties to remove
import { remove } from 'bianco.css'
remove(img, 'width') // remove the width property
// or also
remove(img, ['width', 'height']) // remove the width and the height property
// or also
remove([img1, img2], ['width', 'height']) // remove the width and the height property from both images
Returns (HTMLElement | NodeList | Array) the original array of elements passed to this function.