entity-sass

1.0.0 • Public • Published

Entity

A (revamped) Sass function that will output properly encoded entities.

Why 🤔

No clue. I came across https://dev.w3.org/html5/html-author/charref and thought it would be fun. I ran a Node script that output the file then wrote some tests.

Usage

The entity function accepts the actual character, the HTML name without the ampersand and semi-colon or the decimal number.

body {
  &:after {
    content: entity('');
  }
}

or

body {
  &:after {
    content: entity('euro');
  }
}

will output

body:after {
  content: "\20AC";
}

Package Sidebar

Install

npm i entity-sass

Weekly Downloads

2

Version

1.0.0

License

MIT

Last publish

Collaborators

  • jeremy-green