From c27c1a59b9d68bf0a5d020ce0611e818ba461c4a Mon Sep 17 00:00:00 2001 From: Geremia Taglialatela Date: Sun, 28 Dec 2014 15:27:45 +0100 Subject: [PATCH] Added a variable to customise base font size Closes #5128 --- less/core.less | 3 ++- less/mixins.less | 3 ++- less/variables.less | 1 + scss/_core.scss | 3 ++- scss/_mixins.scss | 3 ++- scss/_variables.scss | 1 + src/_includes/code/{core.css => core.less} | 4 ++-- src/_includes/code/core.scss | 6 ++++++ src/assets/font-awesome/less/core.less | 2 +- src/assets/font-awesome/less/mixins.less | 2 +- src/assets/font-awesome/less/variables.less | 1 + src/assets/font-awesome/scss/_core.scss | 2 +- src/assets/font-awesome/scss/_mixins.scss | 2 +- src/assets/font-awesome/scss/_variables.scss | 1 + 14 files changed, 24 insertions(+), 10 deletions(-) rename src/_includes/code/{core.css => core.less} (62%) create mode 100644 src/_includes/code/core.scss diff --git a/less/core.less b/less/core.less index 01d1910f7..71103b7ac 100644 --- a/less/core.less +++ b/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; + } diff --git a/less/mixins.less b/less/mixins.less index b7bfadc79..b5e0702fc 100644 --- a/less/mixins.less +++ b/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) { diff --git a/less/variables.less b/less/variables.less index c37d4f060..3ad986c52 100644 --- a/less/variables.less +++ b/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"; diff --git a/scss/_core.scss b/scss/_core.scss index ca46d3712..217739f97 100644 --- a/scss/_core.scss +++ b/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; + } diff --git a/scss/_mixins.scss b/scss/_mixins.scss index a139dfb30..a7ad15052 100644 --- a/scss/_mixins.scss +++ b/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) { diff --git a/scss/_variables.scss b/scss/_variables.scss index d31294ecb..b5d4e5e06 100644 --- a/scss/_variables.scss +++ b/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; diff --git a/src/_includes/code/core.css b/src/_includes/code/core.less similarity index 62% rename from src/_includes/code/core.css rename to src/_includes/code/core.less index 5294d52e8..7b5414eff 100644 --- a/src/_includes/code/core.css +++ b/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; \ No newline at end of file + -moz-osx-font-smoothing: grayscale; diff --git a/src/_includes/code/core.scss b/src/_includes/code/core.scss new file mode 100644 index 000000000..bb01e0b7f --- /dev/null +++ b/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; diff --git a/src/assets/font-awesome/less/core.less b/src/assets/font-awesome/less/core.less index c13c937ef..d299d0d03 100644 --- a/src/assets/font-awesome/less/core.less +++ b/src/assets/font-awesome/less/core.less @@ -5,5 +5,5 @@ // ------------------------- .@{fa-css-prefix} { -{% include code/core.css %} +{% include code/core.less %} } diff --git a/src/assets/font-awesome/less/mixins.less b/src/assets/font-awesome/less/mixins.less index c61bb5b44..064f6bc0b 100644 --- a/src/assets/font-awesome/less/mixins.less +++ b/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) { diff --git a/src/assets/font-awesome/less/variables.less b/src/assets/font-awesome/less/variables.less index 349e6323f..a5cf5de25 100644 --- a/src/assets/font-awesome/less/variables.less +++ b/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 }}"; diff --git a/src/assets/font-awesome/scss/_core.scss b/src/assets/font-awesome/scss/_core.scss index 1de151546..45e548bac 100644 --- a/src/assets/font-awesome/scss/_core.scss +++ b/src/assets/font-awesome/scss/_core.scss @@ -5,5 +5,5 @@ // ------------------------- .#{$fa-css-prefix} { -{% include code/core.css %} +{% include code/core.scss %} } diff --git a/src/assets/font-awesome/scss/_mixins.scss b/src/assets/font-awesome/scss/_mixins.scss index 0f84bb9ee..500659b7b 100644 --- a/src/assets/font-awesome/scss/_mixins.scss +++ b/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) { diff --git a/src/assets/font-awesome/scss/_variables.scss b/src/assets/font-awesome/scss/_variables.scss index 53b0a6f4b..0d483d116 100644 --- a/src/assets/font-awesome/scss/_variables.scss +++ b/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;