diff options
author | zeripath <art27@cantab.net> | 2019-03-18 12:49:01 +0000 |
---|---|---|
committer | techknowlogick <matti@mdranta.net> | 2019-03-18 08:49:01 -0400 |
commit | d78bb1d56487c38f05f3bc194ccb18aaad1f21c0 (patch) | |
tree | ea3ba4e49f3a02a6e5341d8b161d1348351f81c7 /public/less | |
parent | cd8cdbd9d29b2c8c49102f30a0af98378af43777 (diff) | |
download | gitea-d78bb1d56487c38f05f3bc194ccb18aaad1f21c0.tar.gz gitea-d78bb1d56487c38f05f3bc194ccb18aaad1f21c0.zip |
Add lang specific font stacks for CJK (#6007)
* Add lang specific font stacks
* Force font changes
Signed-off-by: Andrew Thornton <art27@cantab.net>
* Fix icons
Signed-off-by: Andrew Thornton <art27@cantab.net>
* Fix octicons and icons
Signed-off-by: Andrew Thornton <art27@cantab.net>
* Just override the semantic ui fonts only
Signed-off-by: Andrew Thornton <art27@cantab.net>
* Missed the headers... override them too
* Missed some more semantic ui stuff
* Fix PT Sans
Signed-off-by: Andrew Thornton <art27@cantab.net>
* More changes
Signed-off-by: Andrew Thornton <art27@cantab.net>
* Squashed commit of the following:
commit 7d1679e9079541359869c9e677ba7412bfcc59f3
Author: Mike L <cl.jeremy@qq.com>
Date: Wed Mar 13 13:53:49 2019 +0100
Remove missed YaHei leftover from _home.less
commit 0079121ea91860a323ed4e5cc1a9c0d490d9cefd
Author: Mike L <cl.jeremy@qq.com>
Date: Wed Mar 13 12:03:54 2019 +0100
Fix overdone fixes (inherit, :lang)
commit 62c919915928ec1db4731d547e95885f91a0618d
Author: Mike L <cl.jeremy@qq.com>
Date: Wed Mar 13 02:29:10 2019 +0100
Fix elements w/ explicit lang (language chooser)
commit b3117587aa2eb8570d60bed583a11ee5565418be
Author: Mike L <cl.jeremy@qq.com>
Date: Tue Mar 12 20:17:26 2019 +0100
Fix textarea also (to match body)
commit 81cedf2c3012c4dd05a7680782b4a98e1b947f67
Author: Mike L <cl.jeremy@qq.com>
Date: Tue Mar 12 19:41:39 2019 +0100
Revert css temporarily to fix conflict
commit 80ff82797f3203cbeaf866f22e961334e137df89
Author: Mike L <cl.jeremy@qq.com>
Date: Tue Mar 12 19:15:30 2019 +0100
Tweak CJK, fix Yu Gothic, more monospace inherits
commit 581dceb9a869646c2c486dabb925c88c2680d70c
Author: Mike L <cl.jeremy@qq.com>
Date: Mon Mar 11 13:09:26 2019 +0100
Add Lato for latin extd. & cyrillic, improve CJK
* update stylesheet
Diffstat (limited to 'public/less')
-rw-r--r-- | public/less/_base.less | 130 | ||||
-rw-r--r-- | public/less/_dashboard.less | 2 | ||||
-rw-r--r-- | public/less/_editor.less | 2 | ||||
-rw-r--r-- | public/less/_form.less | 2 | ||||
-rw-r--r-- | public/less/_home.less | 3 | ||||
-rw-r--r-- | public/less/_markdown.less | 1 | ||||
-rw-r--r-- | public/less/_repository.less | 10 | ||||
-rw-r--r-- | public/less/_review.less | 2 |
8 files changed, 135 insertions, 17 deletions
diff --git a/public/less/_base.less b/public/less/_base.less index 68761f4ede..09f6556167 100644 --- a/public/less/_base.less +++ b/public/less/_base.less @@ -1,11 +1,133 @@ + +@font-face { + font-family: 'Lato'; + src: url('../vendor/assets/lato-fonts/lato-regular.eot'); + src: url('../vendor/assets/lato-fonts/lato-regular.eot?#iefix') format('embedded-opentype'), url('../vendor/assets/lato-fonts/lato-regular.woff2') format('woff2'), url('../vendor/assets/lato-fonts/lato-regular.woff') format('woff'), url('../vendor/assets/lato-fonts/lato-regular.ttf') format('truetype'); + font-weight: 400; + font-style: normal; +} + +@font-face { + font-family: 'Lato'; + src: url('../vendor/assets/lato-fonts/lato-italic.eot'); + src: url('../vendor/assets/lato-fonts/lato-italic.eot?#iefix') format('embedded-opentype'), url('../vendor/assets/lato-fonts/lato-italic.woff2') format('woff2'), url('../vendor/assets/lato-fonts/lato-italic.woff') format('woff'), url('../vendor/assets/lato-fonts/lato-italic.ttf') format('truetype'); + font-weight: 400; + font-style: italic; +} + +@font-face { + font-family: 'Lato'; + src: url('../vendor/assets/lato-fonts/lato-bold.eot'); + src: url('../vendor/assets/lato-fonts/lato-bold.eot?#iefix') format('embedded-opentype'), url('../vendor/assets/lato-fonts/lato-bold.woff2') format('woff2'), url('../vendor/assets/lato-fonts/lato-bold.woff') format('woff'), url('../vendor/assets/lato-fonts/lato-bold.ttf') format('truetype'); + font-weight: 700; + font-style: normal; +} + +@font-face { + font-family: 'Lato'; + src: url('../vendor/assets/lato-fonts/lato-bolditalic.eot'); + src: url('../vendor/assets/lato-fonts/lato-bolditalic.eot?#iefix') format('embedded-opentype'), url('../vendor/assets/lato-fonts/lato-bolditalic.woff2') format('woff2'), url('../vendor/assets/lato-fonts/lato-bolditalic.woff') format('woff'), url('../vendor/assets/lato-fonts/lato-bolditalic.ttf') format('truetype'); + font-weight: 700; + font-style: italic; +} + +@font-face { + font-family: 'Yu Gothic'; + src: local('Yu Gothic Medium'); + font-weight: 400; +} + +@font-face { + font-family: 'Yu Gothic'; + src: local('Yu Gothic Bold'); + font-weight: 700; +} + +@default-fonts: -apple-system, BlinkMacSystemFont, system-ui, 'Segoe UI', Roboto, Helvetica, Arial; +@monospaced-fonts: 'SF Mono', Consolas, Menlo, 'Liberation Mono', Monaco, 'Lucida Console'; + +.override-fonts(@fonts) { + textarea { + font-family: @fonts, sans-serif; + } + + .markdown:not(code) { + font-family: @fonts, sans-serif; + } + + /* We're going to just override the semantic fonts here */ + h1, h2, h3, h4, h5 { + font-family: Lato, @fonts, sans-serif; + } + + .home .hero h1, .home .hero h2 { + font-family: 'PT Sans Narrow', Lato, @fonts, sans-serif; + } + + .ui.accordion .title:not(.ui), + .ui.button, + .ui.card > .content > .header.ui.card > .content > .header, + .ui.category.search > .results .category > .name, + .ui.form input:not([type]), .ui.form input[type=date], .ui.form input[type=datetime-local], .ui.form input[type=email], .ui.form input[type=file], .ui.form input[type=number], .ui.form input[type=password], .ui.form input[type=search], .ui.form input[type=tel], .ui.form input[type=text], .ui.form input[type=time], .ui.form input[type=url], + .ui.header, + .ui.items > .item > .content > .header, + .ui.list .list > .item .header, + .ui.list > .item .header, + .ui.menu, + .ui.message .header, + .ui.modal > .header, + .ui.popup > .header, + .ui.search > .results .result .title, + .ui.search > .results > .message .header, + body, + .ui.input>input, .ui.input input, + .ui.statistics .statistic > .value, + .ui.statistic > .value, + .ui.statistics .statistic > .label, + .ui.statistic > .label, + .ui.steps .step .title, + .ui.text.container, + .ui.language > .menu > .item& + { + font-family: Lato, @fonts, sans-serif; + } +} + +.override-fonts(@default-fonts); + body { - font-family: "Lato", "Segoe UI", "Microsoft YaHei", Arial, Helvetica, sans-serif !important; background-color: #fff; overflow-y: auto; -webkit-font-smoothing: antialiased; display: flex; flex-direction: column; } + +@ja-fonts: 'Hiragino Kaku Gothic ProN', 'Yu Gothic', 'Source Han Sans JP', 'Noto Sans CJK JP', 'Droid Sans Japanese', 'Meiryo', 'MS PGothic'; +:lang(ja) { + .override-fonts(@default-fonts, @ja-fonts;); +} + +@zh-CN-fonts: 'PingFang SC', 'Hiragino Sans GB', 'Source Han Sans CN', 'Source Han Sans SC', 'Noto Sans CJK SC', 'Microsoft YaHei', 'Heiti SC', SimHei; +:lang(zh-CN) { + .override-fonts(@default-fonts, @zh-CN-fonts;); +} + +@zh-TW-fonts: 'PingFang TC', 'Hiragino Sans TC', 'Source Han Sans TW', 'Source Han Sans TC', 'Noto Sans CJK TC', 'Microsoft JhengHei', 'Heiti TC', PMingLiU; +:lang(zh-TW) { + .override-fonts(@default-fonts, @zh-TW-fonts;); +} + +@zh-HK-fonts: 'PingFang HK', 'Hiragino Sans TC', 'Source Han Sans HK', 'Source Han Sans TC', 'Noto Sans CJK TC', 'Microsoft JhengHei', 'Heiti TC', PMingLiU_HKSCS, PMingLiU; +:lang(zh-HK) { + .override-fonts(@default-fonts, @zh-HK-fonts;); +} + +@ko-fonts: 'Apple SD Gothic Neo', 'NanumBarunGothic', 'Malgun Gothic', 'Gulim', 'Dotum', 'Nanum Gothic', 'Source Han Sans KR', 'Noto Sans CJK KR'; +:lang(ko) { + .override-fonts(@default-fonts, @ko-fonts;); +} + img { border-radius: 3px; } @@ -19,7 +141,7 @@ a { border-radius: .28571429rem !important; } pre, code { - font: 12px Consolas, "Liberation Mono", Menlo, Courier, monospace; + font: 12px @monospaced-fonts, monospace; &.raw { padding: 7px 12px; margin: 10px 0; @@ -337,7 +459,7 @@ pre, code { } .sha.label { - font-family: Consolas, Menlo, Monaco, "Lucida Console", monospace; + font-family: @monospaced-fonts, monospace; font-size: 13px; padding: 6px 10px 4px 10px; font-weight: normal; @@ -391,7 +513,7 @@ pre, code { } .file-comment { - font: 12px Consolas,"Liberation Mono",Menlo,Courier,monospace; + font: 12px @monospaced-fonts, monospace; color: rgba(0,0,0,.87); } diff --git a/public/less/_dashboard.less b/public/less/_dashboard.less index f65007512e..b24fd3135f 100644 --- a/public/less/_dashboard.less +++ b/public/less/_dashboard.less @@ -99,7 +99,7 @@ } } .commit-id { - font-family: Consolas, monospace; + font-family: @monospaced-fonts, monospace; } code { padding: 1px; diff --git a/public/less/_editor.less b/public/less/_editor.less index 2c87d902f7..0457cf1483 100644 --- a/public/less/_editor.less +++ b/public/less/_editor.less @@ -1,5 +1,5 @@ .CodeMirror { - font: 14px Consolas, "Liberation Mono", Menlo, Courier, monospace; + font: 14px @monospaced-fonts, monospace; &.cm-s-default { border-radius: 3px; padding: 0 !important; diff --git a/public/less/_form.less b/public/less/_form.less index bdbea7a620..1f7708a6e5 100644 --- a/public/less/_form.less +++ b/public/less/_form.less @@ -192,7 +192,7 @@ .githook { textarea { - font-family: monospace; + font-family: @monospaced-fonts, monospace; } } diff --git a/public/less/_home.less b/public/less/_home.less index ace6102596..93c7dd82ea 100644 --- a/public/less/_home.less +++ b/public/less/_home.less @@ -3,9 +3,6 @@ max-width: 220px; } .hero { - h1, h2 { - font-family: 'PT Sans Narrow', sans-serif, 'Microsoft YaHei'; - } @media only screen and (max-width: 767px) { h1 { font-size: 3.5em; diff --git a/public/less/_markdown.less b/public/less/_markdown.less index aafc66e6ab..445bf75b62 100644 --- a/public/less/_markdown.less +++ b/public/less/_markdown.less @@ -1,6 +1,5 @@ .markdown:not(code) { overflow: hidden; - font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, freesans, sans-serif; font-size: 16px; line-height: 1.6 !important; word-wrap: break-word; diff --git a/public/less/_repository.less b/public/less/_repository.less index a5c30403e3..d2e6fdd2fc 100644 --- a/public/less/_repository.less +++ b/public/less/_repository.less @@ -330,7 +330,7 @@ .code-view { * { font-size: 12px; - font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; + font-family: @monospaced-fonts, monospace; line-height: 20px; } @@ -430,7 +430,7 @@ .branch-name { display: inline-block; padding: 3px 6px; - font: 12px Consolas, "Liberation Mono", Menlo, Courier, monospace; + font: 12px @monospaced-fonts, monospace; color: rgba(0,0,0,0.65); background-color: rgba(209,227,237,0.45); border-radius: 3px; @@ -699,7 +699,7 @@ } textarea { height: 200px; - font-family: "Consolas", monospace; + font-family: @monospaced-fonts, monospace; } } @@ -802,7 +802,7 @@ } textarea { height: 200px; - font-family: "Consolas", monospace; + font-family: @monospaced-fonts, monospace; } } } @@ -1346,7 +1346,7 @@ &.new { .CodeMirror { .CodeMirror-code { - font-family: "Consolas", monospace; + font-family: @monospaced-fonts, monospace; .cm-comment { background: inherit; } diff --git a/public/less/_review.less b/public/less/_review.less index abc0284ca5..bb2e85b155 100644 --- a/public/less/_review.less +++ b/public/less/_review.less @@ -109,6 +109,6 @@ } .file-comment { - font: 12px Consolas,"Liberation Mono",Menlo,Courier,monospace; + font: 12px @monospaced-fonts, monospace; color: rgba(0,0,0,.87); } |