diff --git a/templates/_icons.less b/templates/_icons.less index 9954fda..46d648b 100644 --- a/templates/_icons.less +++ b/templates/_icons.less @@ -7,7 +7,7 @@ url('<%= fontPath %><%= fontName %>.svg#<%= fontName %>') format('svg'); } -.icon-base:before { +.icon-base-pseudo { font-family: "<%= fontName %>"; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; @@ -25,10 +25,11 @@ content: @@filename; } -.icon(@filename) { +.icon(@filename, @insert: before) { + @pseudo-selector: ~":@{insert}"; - &:before { - &:extend(.icon-base:before); + &@{pseudo-selector} { + &:extend(.icon-base-pseudo); .icon-char(@filename); } } diff --git a/templates/_icons.scss b/templates/_icons.scss index 8bcb5ca..61982cf 100644 --- a/templates/_icons.scss +++ b/templates/_icons.scss @@ -29,8 +29,8 @@ @return $char; } -@mixin icon($filename) { - &:before { +@mixin icon($filename, $insert: before) { + &:#{$insert} { @extend %icon; content: icon-char($filename); } diff --git a/test/expected/_icons.less b/test/expected/_icons.less index e9c4a92..9dc03d0 100644 --- a/test/expected/_icons.less +++ b/test/expected/_icons.less @@ -7,7 +7,7 @@ url('./Icons.svg#Icons') format('svg'); } -.icon-base:before { +.icon-base-pseudo { font-family: "Icons"; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; @@ -26,10 +26,11 @@ content: @@filename; } -.icon(@filename) { +.icon(@filename, @insert: before) { + @pseudo-selector: ~":@{insert}"; - &:before { - &:extend(.icon-base:before); + &@{pseudo-selector} { + &:extend(.icon-base-pseudo); .icon-char(@filename); } } diff --git a/test/expected/_icons.scss b/test/expected/_icons.scss index 4d72b12..85d015a 100644 --- a/test/expected/_icons.scss +++ b/test/expected/_icons.scss @@ -32,8 +32,8 @@ @return $char; } -@mixin icon($filename) { - &:before { +@mixin icon($filename, $insert: before) { + &:#{$insert} { @extend %icon; content: icon-char($filename); }