unified

Project: rehypejs/rehype-minify

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

  1. Dependencies: 1·Dependents: 4
  2. hast utility to check if an element is a css link
  1. util 118
  2. utility 114
  3. unist 110
  4. html 110
  5. hast 60
  6. hast-util 40
  7. link 15
  8. css 10

hast-util-is-css-link

Build Coverage Downloads Size Sponsors Backers Chat

Check if an element is a CSS link.

Install

npm:

npm install hast-util-is-css-link

Use

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

ok(h('link', {rel: ['stylesheet', 'author']})) //=> true
ok(h('link', {rel: ['stylesheet'], type: 'text/css'})) //=> true
ok(h('link', {rel: ['stylesheet'], type: 'text/foo'})) //=> false

API

isCSSLink(node)

Return true if node is a <link> element with a rel list that contains 'stylesheet' and 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