1.0.0 • Published 8 years ago

entity-sass v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
8 years ago

Entity

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

Why :thinking:

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";
}