]> cat aescling's git repositories - mastodon.git/commitdiff
Fix font-weight of <strong> element for CJK fonts (#5914)
authorSerCom_KC <SerCom-KC@users.noreply.github.com>
Thu, 7 Dec 2017 15:01:52 +0000 (23:01 +0800)
committerEugen Rochko <eugen@zeonfederated.com>
Thu, 7 Dec 2017 15:01:52 +0000 (16:01 +0100)
* Fix font-weight for CJK fonts

* Use `font-weight: 700;` for mobile support

* Fix indentation

* Remove trailing whitespace

* Remove trailing whitespace

app/javascript/styles/mastodon/about.scss
app/javascript/styles/mastodon/accounts.scss
app/javascript/styles/mastodon/admin.scss
app/javascript/styles/mastodon/components.scss
app/javascript/styles/mastodon/forms.scss
app/javascript/styles/mastodon/landing_strip.scss
app/javascript/styles/mastodon/stream_entries.scss
app/javascript/styles/mastodon/tables.scss
app/javascript/styles/mastodon/variables.scss

index 358d86eecc68ffa2d7e36daf347f56bb381d6f14..56b4dcfb96f3a37bf889915af78aae0c0dac9781 100644 (file)
         font-weight: 500;
         font-size: 32px;
         line-height: 48px;
+
+        @each $lang in $cjk-langs {
+          &:lang(#{$lang}) {
+            font-weight: 700;
+          }
+        }
       }
     }
 
index 23e20a36687a3e87039ff7ada304ebcdfe3a2894..9015d04cb390549c8fae0cf8c61b648a7065d6c9 100644 (file)
       strong {
         font-weight: 500;
         color: $ui-base-color;
+
+        @each $lang in $cjk-langs {
+          &:lang(#{$lang}) {
+            font-weight: 700;
+          }
+        }
       }
 
       span {
index 7f078470e24289140eca61fbc234389d236a023d..bddea557b76700dd136555091c6371b6f4596b17 100644 (file)
       strong {
         color: $primary-text-color;
         font-weight: 500;
+
+        @each $lang in $cjk-langs {
+          &:lang(#{$lang}) {
+            font-weight: 700;
+          }
+        }
       }
     }
 
       font-weight: 500;
       text-transform: uppercase;
       font-size: 12px;
+
+      @each $lang in $cjk-langs {
+        &:lang(#{$lang}) {
+          font-weight: 700;
+        }
+      }
     }
 
     a {
     font-size: 14px;
     line-height: 18px;
     color: $ui-secondary-color;
+
+    @each $lang in $cjk-langs {
+      &:lang(#{$lang}) {
+        font-weight: 700;
+      }
+    }
   }
 
   .account-card {
index d72f53f36650ab7383b90213f45d5641dd704c0d..928b0536aedb1a1697b2c0e2b93bb5d5e7736eb5 100644 (file)
   strong {
     color: darken($ui-secondary-color, 65%);
     font-weight: 500;
+
+    @each $lang in $cjk-langs {
+      &:lang(#{$lang}) {
+        font-weight: 700;
+      }
+    }
   }
 
   a {
 
   strong {
     font-weight: 500;
+
+    @each $lang in $cjk-langs {
+      &:lang(#{$lang}) {
+        font-weight: 700;
+      }
+    }
   }
 
   a {
     font-size: 15px;
     font-weight: 500;
     color: $primary-text-color;
+
+    @each $lang in $cjk-langs {
+      &:lang(#{$lang}) {
+        font-weight: 700;
+      }
+    }
   }
 
   abbr {
@@ -2980,6 +2998,12 @@ button.icon-button.active i.fa-retweet {
     font-weight: 500;
     display: block;
     color: $ui-base-color;
+
+    @each $lang in $cjk-langs {
+      &:lang(#{$lang}) {
+        font-weight: 700;
+      }
+    }
   }
 }
 
@@ -3414,6 +3438,12 @@ button.icon-button.active i.fa-retweet {
       border-radius: 4px;
       font-size: 14px;
       padding: 3px 6px;
+
+      @each $lang in $cjk-langs {
+        &:lang(#{$lang}) {
+          font-weight: 700;
+        }
+      }
     }
   }
 }
@@ -3744,6 +3774,12 @@ button.icon-button.active i.fa-retweet {
 
   strong {
     font-weight: 500;
+
+    @each $lang in $cjk-langs {
+      &:lang(#{$lang}) {
+        font-weight: 700;
+      }
+    }
   }
 }
 
index 61fcf286ff4c7b30a6b3986df8b54d319132bd55..2bef53cff780b7fd8b89bc9e518298d3cb34269f 100644 (file)
@@ -56,6 +56,12 @@ code {
 
   strong {
     font-weight: 500;
+
+    @each $lang in $cjk-langs {
+      &:lang(#{$lang}) {
+        font-weight: 700;
+      }
+    }
   }
 
   .label_input {
@@ -395,6 +401,12 @@ code {
 
   strong {
     font-weight: 500;
+
+    @each $lang in $cjk-langs {
+      &:lang(#{$lang}) {
+        font-weight: 700;
+      }
+    }
   }
 
   @media screen and (max-width: 740px) and (min-width: 441px) {
@@ -430,6 +442,12 @@ code {
   strong {
     color: $ui-secondary-color;
     font-weight: 500;
+
+    @each $lang in $cjk-langs {
+      &:lang(#{$lang}) {
+        font-weight: 700;
+      }
+    }
   }
 
   @media screen and (max-width: 740px) and (min-width: 441px) {
@@ -474,6 +492,12 @@ code {
 
     strong {
       font-weight: 500;
+
+      @each $lang in $cjk-langs {
+        &:lang(#{$lang}) {
+          font-weight: 700;
+        }
+      }
     }
   }
 }
@@ -506,6 +530,12 @@ code {
       display: block;
       margin-bottom: 5px;
 
+      @each $lang in $cjk-langs {
+        &:lang(#{$lang}) {
+          font-weight: 700;
+        }
+      }
+
       .fa {
         font-weight: 400;
       }
index 2f7c98d54ddab2879fe03ac9d15da02aeccf42b5..ffa1e149dad91a16c7ffcb09599ebe45343c86d9 100644 (file)
   strong,
   a {
     font-weight: 500;
+
+    @each $lang in $cjk-langs {
+      &:lang(#{$lang}) {
+        font-weight: 700;
+      }
+    }
   }
 
   a {
   strong,
   a {
     font-weight: 500;
+
+    @each $lang in $cjk-langs {
+      &:lang(#{$lang}) {
+        font-weight: 700;
+      }
+    }
   }
 
   a {
index 4f323a378700d2f01e56d36626b47ddc4dbbe442..a35bbee7957642d83ff205f621f448832768769b 100644 (file)
       strong {
         font-weight: 500;
         color: $ui-base-color;
+
+        @each $lang in $cjk-langs {
+          &:lang(#{$lang}) {
+            font-weight: 700;
+          }
+        }
       }
 
       span {
         strong {
           font-weight: 500;
           color: $ui-base-color;
+
+          @each $lang in $cjk-langs {
+            &:lang(#{$lang}) {
+              font-weight: 700;
+            }
+          }
         }
 
         span {
index ad46f5f9f50a99fe1fb4b7c1f16f0b80f08f2386..92870e67900e06a36fd5a831bec50dfe6d3eb399 100644 (file)
 
   strong {
     font-weight: 500;
+
+    @each $lang in $cjk-langs {
+      &:lang(#{$lang}) {
+        font-weight: 700;
+      }
+    }
   }
 
   &.inline-table > tbody > tr:nth-child(odd) > td,
index 52c8cd1cf5c45619ebff148c51430aa4b74c0e2a..0abb8d5eae228122f516c384959d4d4d5e10db4d 100644 (file)
@@ -27,3 +27,6 @@ $ui-base-lighter-color: lighten($ui-base-color, 26%) !default; // Lighter darkes
 $ui-primary-color: $classic-primary-color !default;            // Lighter
 $ui-secondary-color: $classic-secondary-color !default;        // Lightest
 $ui-highlight-color: $classic-highlight-color !default;        // Vibrant
+
+// Language codes that uses CJK fonts
+$cjk-langs: zh-CN, zh-HK, zh-TW;