FEATURE: Add "smallest" option to user text size preferences

FEATURE: Add “smallest” option to user text size preferences

diff --git a/app/assets/javascripts/discourse/app/controllers/preferences/interface.js b/app/assets/javascripts/discourse/app/controllers/preferences/interface.js
index c9fb194..2dc3fa4 100644
--- a/app/assets/javascripts/discourse/app/controllers/preferences/interface.js
+++ b/app/assets/javascripts/discourse/app/controllers/preferences/interface.js
@@ -21,7 +21,7 @@ const USER_HOMES = {
   5: "top"
 };
 
-const TEXT_SIZES = ["smaller", "normal", "larger", "largest"];
+const TEXT_SIZES = ["smallest", "smaller", "normal", "larger", "largest"];
 const TITLE_COUNT_MODES = ["notifications", "contextual"];
 
 export default Controller.extend({
diff --git a/app/assets/stylesheets/common/foundation/base.scss b/app/assets/stylesheets/common/foundation/base.scss
index 0ff1089..44ecdde 100644
--- a/app/assets/stylesheets/common/foundation/base.scss
+++ b/app/assets/stylesheets/common/foundation/base.scss
@@ -14,6 +14,10 @@ html {
   overflow-y: scroll;
   direction: ltr;
 
+  &.text-size-smallest {
+    font-size: $base-font-size-smallest;
+  }
+
   &.text-size-smaller {
     font-size: $base-font-size-smaller;
   }
diff --git a/app/assets/stylesheets/common/foundation/variables.scss b/app/assets/stylesheets/common/foundation/variables.scss
index 961a7f1..c5d1fab 100644
--- a/app/assets/stylesheets/common/foundation/variables.scss
+++ b/app/assets/stylesheets/common/foundation/variables.scss
@@ -35,6 +35,7 @@ $bronze: #cd7f32 !default;
 // Fonts
 // --------------------------------------------------
 
+$base-font-size-smallest: 0.815em !default; // eq. to 13px
 $base-font-size-smaller: 0.875em !default; // eq. to 14px
 $base-font-size: 0.938em !default; // eq. to 15px
 $base-font-size-larger: 1.063em !default; // eq. to 17px
diff --git a/app/models/user_option.rb b/app/models/user_option.rb
index 17bd684..f5db5c3 100644
--- a/app/models/user_option.rb
+++ b/app/models/user_option.rb
@@ -28,7 +28,7 @@ class UserOption < ActiveRecord::Base
   end
 
   def self.text_sizes
-    @text_sizes ||= Enum.new(normal: 0, larger: 1, largest: 2, smaller: 3)
+    @text_sizes ||= Enum.new(normal: 0, larger: 1, largest: 2, smaller: 3, smallest: 4)
   end
 
   def self.title_count_modes
diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml
index 7e999c9..21805a1 100644
--- a/config/locales/client.en.yml
+++ b/config/locales/client.en.yml
@@ -1216,6 +1216,7 @@ en:
 
       text_size:
         title: "Text Size"
+        smallest: "Smallest"
         smaller: "Smaller"
         normal: "Normal"
         larger: "Larger"
diff --git a/test/javascripts/components/select-kit/single-select-test.js b/test/javascripts/components/select-kit/single-select-test.js
index 4378167..e23d0c2 100644
--- a/test/javascripts/components/select-kit/single-select-test.js
+++ b/test/javascripts/components/select-kit/single-select-test.js
@@ -142,6 +142,7 @@ componentTest("valueAttribute (deprecated)", {
     this.set("value", "normal");
 
     const content = [
+      { name: "Smallest", value: "smallest" },
       { name: "Smaller", value: "smaller" },
       { name: "Normal", value: "normal" },
       { name: "Larger", value: "larger" },

GitHub sha: 66257ca8

This commit has been mentioned on Discourse Meta. There might be relevant details there:

https://meta.discourse.org/t/how-come-everything-is-suddently-bigger-zoomed/156057/8