Skip to content

Commit

Permalink
Added the css selector to add icons after
Browse files Browse the repository at this point in the history
  • Loading branch information
Gilberto Tomasone authored and Gilberto Tomasone committed Mar 9, 2020
1 parent f56619d commit fa0ac40
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,22 @@ $ npm install multifonts-loader
<span class="[FONT_CLASS_PREFIX]-[FONT_FILE_NAME]"></span>

<span class="[ICON_BASE_SELECTOR] [ICON_CLASS_PREFIX]-[SVG_FILE_NAME]"></span>

<span class="[ICON_BASE_SELECTOR] [ICON_CLASS_PREFIX]-[SVG_FILE_NAME]-after"></span>
```

`NOTE:` You can specify the position of the icon by appending the word `'-after'`
to its default selector.
By default the icon will be added `before`.

*Example:*

```html
<span class="font-Roboto-ThinItalic"></span>

<span class="icon icon-arrow"></span>

<span class="icon icon-arrow-after"></span>
```

#### Options
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "multifonts-loader",
"version": "3.0.7",
"version": "3.1.7",
"description": "A webpack loader to generate all your fontfaces and iconfonts in one go.",
"main": "./index.js",
"scripts": {
Expand Down
10 changes: 10 additions & 0 deletions templates/css.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,18 @@
vertical-align: top;
}

.{{baseSelector}}:after {
font-family: {{fontName}} !important;
font-style: normal;
font-weight: normal !important;
vertical-align: top;
}

{{#each codepoints}}
.{{../classPrefix}}{{@key}}:before {
content: "\\{{this}}";
}
.{{../classPrefix}}{{@key}}-after:after {
content: "\\{{this}}";
}
{{/each}}

0 comments on commit fa0ac40

Please sign in to comment.