Skip to content

jeremy-green/entity-sass

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published