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/_base.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/_base.less')
-rw-r--r-- | public/less/_base.less | 130 |
1 files changed, 126 insertions, 4 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); } |