Skip to content

Commit

Permalink
Merge pull request #27 from backflip/feature/scss-optimizations
Browse files Browse the repository at this point in the history
Issue #15: Fix scss template to work with media queries
  • Loading branch information
backflip committed Aug 2, 2015
2 parents 068c088 + a9e248c commit efc434b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
14 changes: 11 additions & 3 deletions templates/_icons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
url('<%= fontPath %><%= fontName %>.svg#<%= fontName %>') format('svg');
}

%icon {
@mixin icon-styles {
font-family: "<%= fontName %>";
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
Expand All @@ -19,6 +19,10 @@
text-transform: none;
}

%icon {
@include icon-styles;
}

@function icon-char($filename) {
$char: "";
<% _.each(glyphs, function(glyph) { %>
Expand All @@ -29,9 +33,13 @@
@return $char;
}

@mixin icon($filename, $insert: before) {
@mixin icon($filename, $insert: before, $extend: true) {
&:#{$insert} {
@extend %icon;
@if $extend {
@extend %icon;
} @else {
@include icon-styles;
}
content: icon-char($filename);
}
}
Expand Down
14 changes: 11 additions & 3 deletions test/expected/_icons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
url('./Icons.svg#Icons') format('svg');
}

%icon {
@mixin icon-styles {
font-family: "Icons";
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
Expand All @@ -19,6 +19,10 @@
text-transform: none;
}

%icon {
@include icon-styles;
}

@function icon-char($filename) {
$char: "";

Expand All @@ -32,9 +36,13 @@
@return $char;
}

@mixin icon($filename, $insert: before) {
@mixin icon($filename, $insert: before, $extend: true) {
&:#{$insert} {
@extend %icon;
@if $extend {
@extend %icon;
} @else {
@include icon-styles;
}
content: icon-char($filename);
}
}
Expand Down

0 comments on commit efc434b

Please sign in to comment.