unified

Project: rehypejs/rehype-minify

Package: hast-util-is-css-style@1.0.4

  1. Dependencies: 1·Dependents: 6
  2. hast utility to check if an element is a css style
  1. util 106
  2. html 106
  3. utility 104
  4. unist 97
  5. hast 59
  6. hast-util 40
  7. css 10
  8. style 10

hast-util-is-css-style

Build Coverage Downloads Size Sponsors Backers Chat

Check if an element is a CSS <style> element.

Install

npm:

npm install hast-util-is-css-style

Use

var h = require('hastscript')
var ok = require('hast-util-is-css-style')

ok(h('style')) //=> true
ok(h('style', {type: ' TEXT/CSS '})) //=> true
ok(h('style', {type: 'text/foo'})) //=> false

API

isCSSStyle(node)

Return true if node is a <style> element that has no type, an empty type, or 'text/css' as its type.

Contribute

See contributing.md in rehypejs/.github for ways to get started. See support.md for ways to get help.

This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.

License

MIT © Titus Wormer