Bladeren bron

Added a variable to customise base font size
Closes #5128

Geremia Taglialatela 10 jaren geleden
bovenliggende
commit
c27c1a59b9

+ 2 - 1
less/core.less

@@ -3,9 +3,10 @@
 
 .@{fa-css-prefix} {
   display: inline-block;
-  font: normal normal normal 14px/1 FontAwesome; // shortening font declaration
+  font: normal normal normal @fa-font-size-base/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;
+
 }

+ 2 - 1
less/mixins.less

@@ -3,11 +3,12 @@
 
 .fa-icon() {
   display: inline-block;
-  font: normal normal normal 14px/1 FontAwesome; // shortening font declaration
+  font: normal normal normal @fa-font-size-base/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) {

+ 1 - 0
less/variables.less

@@ -2,6 +2,7 @@
 // --------------------------
 
 @fa-font-path:        "../fonts";
+@fa-font-size-base:   14px;
 //@fa-font-path:        "//netdna.bootstrapcdn.com/font-awesome/4.3.0/fonts"; // for referencing Bootstrap CDN font files directly
 @fa-css-prefix:       fa;
 @fa-version:          "4.3.0";

+ 2 - 1
scss/_core.scss

@@ -3,9 +3,10 @@
 
 .#{$fa-css-prefix} {
   display: inline-block;
-  font: normal normal normal 14px/1 FontAwesome; // shortening font declaration
+  font: normal normal normal #{$fa-font-size-base}/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;
+
 }

+ 2 - 1
scss/_mixins.scss

@@ -3,11 +3,12 @@
 
 @mixin fa-icon() {
   display: inline-block;
-  font: normal normal normal 14px/1 FontAwesome; // shortening font declaration
+  font: normal normal normal #{$fa-font-size-base}/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) {

+ 1 - 0
scss/_variables.scss

@@ -2,6 +2,7 @@
 // --------------------------
 
 $fa-font-path:        "../fonts" !default;
+$fa-font-size-base:   14px !default;
 //$fa-font-path:        "//netdna.bootstrapcdn.com/font-awesome/4.3.0/fonts" !default; // for referencing Bootstrap CDN font files directly
 $fa-css-prefix:       fa !default;
 $fa-version:          "4.3.0" !default;

+ 2 - 2
src/_includes/code/core.css → src/_includes/code/core.less

@@ -1,6 +1,6 @@
   display: inline-block;
-  font: normal normal normal 14px/1 FontAwesome; // shortening font declaration
+  font: normal normal normal @fa-font-size-base/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;
+  -moz-osx-font-smoothing: grayscale;

+ 6 - 0
src/_includes/code/core.scss

@@ -0,0 +1,6 @@
+  display: inline-block;
+  font: normal normal normal #{$fa-font-size-base}/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;

+ 1 - 1
src/assets/font-awesome/less/core.less

@@ -5,5 +5,5 @@
 // -------------------------
 
 .@{fa-css-prefix} {
-{% include code/core.css %}
+{% include code/core.less %}
 }

+ 1 - 1
src/assets/font-awesome/less/mixins.less

@@ -4,7 +4,7 @@
 // --------------------------
 
 .fa-icon() {
-{% include code/core.css %}
+{% include code/core.less %}
 }
 
 .fa-icon-rotate(@degrees, @rotation) {

+ 1 - 0
src/assets/font-awesome/less/variables.less

@@ -4,6 +4,7 @@
 // --------------------------
 
 @fa-font-path:        "../fonts";
+@fa-font-size-base:   14px;
 //@fa-font-path:        "//netdna.bootstrapcdn.com/font-awesome/{{site.fontawesome.version}}/fonts"; // for referencing Bootstrap CDN font files directly
 @fa-css-prefix:       {{ site.fontawesome.css_prefix }};
 @fa-version:          "{{ site.fontawesome.version }}";

+ 1 - 1
src/assets/font-awesome/scss/_core.scss

@@ -5,5 +5,5 @@
 // -------------------------
 
 .#{$fa-css-prefix} {
-{% include code/core.css %}
+{% include code/core.scss %}
 }

+ 1 - 1
src/assets/font-awesome/scss/_mixins.scss

@@ -4,7 +4,7 @@
 // --------------------------
 
 @mixin fa-icon() {
-{% include code/core.css %}
+{% include code/core.scss %}
 }
 
 @mixin fa-icon-rotate($degrees, $rotation) {

+ 1 - 0
src/assets/font-awesome/scss/_variables.scss

@@ -4,6 +4,7 @@
 // --------------------------
 
 $fa-font-path:        "../fonts" !default;
+$fa-font-size-base:   14px !default;
 //$fa-font-path:        "//netdna.bootstrapcdn.com/font-awesome/{{site.fontawesome.version}}/fonts" !default; // for referencing Bootstrap CDN font files directly
 $fa-css-prefix:       {{ site.fontawesome.css_prefix }} !default;
 $fa-version:          "{{ site.fontawesome.version }}" !default;