瀏覽代碼

adding .fa-icon mixin #2305 #2454

Dave Gandy 10 年之前
父節點
當前提交
03f71ba901
共有 4 個文件被更改,包括 26 次插入0 次删除
  1. 9 0
      less/mixins.less
  2. 9 0
      scss/_mixins.scss
  3. 4 0
      src/assets/font-awesome/less/mixins.less
  4. 4 0
      src/assets/font-awesome/scss/_mixins.scss

+ 9 - 0
less/mixins.less

@@ -1,6 +1,15 @@
 // Mixins
 // --------------------------
 
+.fa-icon() {
+  display: inline-block;
+  font: normal normal normal 14px/1 FontAwesome; // shortening font declaration
+  font-size: inherit; // can't have font-size inherit on line above, so need to override
+  text-rendering: auto; // optimizelegibility throws things off #1094
+  -webkit-font-smoothing: antialiased;
+  -moz-osx-font-smoothing: grayscale;
+}
+
 .fa-icon-rotate(@degrees, @rotation) {
   filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=@rotation);
   -webkit-transform: rotate(@degrees);

+ 9 - 0
scss/_mixins.scss

@@ -1,6 +1,15 @@
 // Mixins
 // --------------------------
 
+@mixin fa-icon() {
+  display: inline-block;
+  font: normal normal normal 14px/1 FontAwesome; // shortening font declaration
+  font-size: inherit; // can't have font-size inherit on line above, so need to override
+  text-rendering: auto; // optimizelegibility throws things off #1094
+  -webkit-font-smoothing: antialiased;
+  -moz-osx-font-smoothing: grayscale;
+}
+
 @mixin fa-icon-rotate($degrees, $rotation) {
   filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=#{$rotation});
   -webkit-transform: rotate($degrees);

+ 4 - 0
src/assets/font-awesome/less/mixins.less

@@ -3,6 +3,10 @@
 // Mixins
 // --------------------------
 
+.fa-icon() {
+{% include code/core.css %}
+}
+
 .fa-icon-rotate(@degrees, @rotation) {
   filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=@rotation);
   -webkit-transform: rotate(@degrees);

+ 4 - 0
src/assets/font-awesome/scss/_mixins.scss

@@ -3,6 +3,10 @@
 // Mixins
 // --------------------------
 
+@mixin fa-icon() {
+{% include code/core.css %}
+}
+
 @mixin fa-icon-rotate($degrees, $rotation) {
   filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=#{$rotation});
   -webkit-transform: rotate($degrees);