Skip to content

Instantly share code, notes, and snippets.

@morganfeeney
Last active October 21, 2015 15:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save morganfeeney/f9c63fe78f3b1970b54b to your computer and use it in GitHub Desktop.
Save morganfeeney/f9c63fe78f3b1970b54b to your computer and use it in GitHub Desktop.
Same class, same style-sheet, different font-family.
@glyphiconFont: 'Glyphicons Halflings';
@fontAwesoneFont: 'FontAwesome';
// Glyphicons
@chevron-left: "\e079";
@chevron-right: "\e080";
@plus-sign: "\e081";
@ok-sign: "\e084";
@ok: "\e013";
@triangle-bottom: "\e252";
@menu-right: "\e258";
@icon-close: "\e088";
@map-marker: "\e062";
// Font Awesome
@fa-var-500px: "\f26e";
@fa-var-adjust: "\f042";
@fa-var-adn: "\f170";
@fa-var-align-center: "\f037";
@fa-var-align-justify: "\f039";
@fa-var-align-left: "\f036";
@fa-var-align-right: "\f038";
@fa-var-amazon: "\f270";
// Use to extend Glyphicon font-family
.gl {
font-family: @glyphiconFont;
}
// Use to extend Font Awesome font-family
.fa {
font-family: @fontAwesoneFont;
}
// Use only the icons you want, not the the entire list of variables
@icons1:
chevron-right,
ok,
triangle-bottom;
@icons2:
fa-var-500px,
fa-var-adjust,
fa-var-adn;
// Set 1
.icon {
.-(@i: length(@icons1)) when (@i > 0) {
@name: extract(@icons1, @i);
&-before.@{name}:before,
&-after.@{name}:after {
&:extend(.gl);
content: @@name
}
.-((@i - 1));
} .-;
}
// Set 2
.icon {
.-(@i: length(@icons2)) when (@i > 0) {
@name: extract(@icons2, @i);
&-before.@{name}:before,
&-after.@{name}:after {
&:extend(.fa);
content: @@name
}
.-((@i - 1));
} .-;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment