Browse Source

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 7d1679e907
Author: Mike L <cl.jeremy@qq.com>
Date:   Wed Mar 13 13:53:49 2019 +0100

    Remove missed YaHei leftover from _home.less

commit 0079121ea9
Author: Mike L <cl.jeremy@qq.com>
Date:   Wed Mar 13 12:03:54 2019 +0100

    Fix overdone fixes (inherit, :lang)

commit 62c9199159
Author: Mike L <cl.jeremy@qq.com>
Date:   Wed Mar 13 02:29:10 2019 +0100

    Fix elements w/ explicit lang (language chooser)

commit b3117587aa
Author: Mike L <cl.jeremy@qq.com>
Date:   Tue Mar 12 20:17:26 2019 +0100

    Fix textarea also (to match body)

commit 81cedf2c30
Author: Mike L <cl.jeremy@qq.com>
Date:   Tue Mar 12 19:41:39 2019 +0100

    Revert css temporarily to fix conflict

commit 80ff82797f
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 581dceb9a8
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
for-closed-social
zeripath 5 years ago
committed by techknowlogick
parent
commit
d78bb1d564
24 changed files with 139 additions and 20 deletions
  1. +1
    -0
      modules/context/context.go
  2. +1
    -1
      public/css/index.css
  3. +126
    -4
      public/less/_base.less
  4. +1
    -1
      public/less/_dashboard.less
  5. +1
    -1
      public/less/_editor.less
  6. +1
    -1
      public/less/_form.less
  7. +0
    -3
      public/less/_home.less
  8. +0
    -1
      public/less/_markdown.less
  9. +5
    -5
      public/less/_repository.less
  10. +1
    -1
      public/less/_review.less
  11. BIN
     
  12. BIN
     
  13. BIN
     
  14. BIN
     
  15. BIN
     
  16. BIN
     
  17. BIN
     
  18. BIN
     
  19. BIN
     
  20. BIN
     
  21. BIN
     
  22. BIN
     
  23. +1
    -1
      templates/base/footer_content.tmpl
  24. +1
    -1
      templates/base/head.tmpl

+ 1
- 0
modules/context/context.go View File

@ -194,6 +194,7 @@ func Contexter() macaron.Handler {
},
Org: &Organization{},
}
ctx.Data["Language"] = ctx.Locale.Language()
c.Data["Link"] = ctx.Link
ctx.Data["PageStartTime"] = time.Now()
// Quick responses appropriate go-get meta with status 200

+ 1
- 1
public/css/index.css
File diff suppressed because it is too large
View File


+ 126
- 4
public/less/_base.less View File

@ -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);
}

+ 1
- 1
public/less/_dashboard.less View File

@ -99,7 +99,7 @@
}
}
.commit-id {
font-family: Consolas, monospace;
font-family: @monospaced-fonts, monospace;
}
code {
padding: 1px;

+ 1
- 1
public/less/_editor.less View File

@ -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;

+ 1
- 1
public/less/_form.less View File

@ -192,7 +192,7 @@
.githook {
textarea {
font-family: monospace;
font-family: @monospaced-fonts, monospace;
}
}

+ 0
- 3
public/less/_home.less View File

@ -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;

+ 0
- 1
public/less/_markdown.less View File

@ -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;

+ 5
- 5
public/less/_repository.less View File

@ -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;
}

+ 1
- 1
public/less/_review.less View File

@ -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);
}

BIN
View File


BIN
View File


BIN
View File


BIN
View File


BIN
View File


BIN
View File


BIN
View File


BIN
View File


BIN
View File


BIN
View File


BIN
View File


BIN
View File


+ 1
- 1
templates/base/footer_content.tmpl View File

@ -12,7 +12,7 @@
<div class="text">{{.LangName}}</div>
<div class="menu">
{{range .AllLangs}}
<a class="item {{if eq $.Lang .Lang}}active selected{{end}}" href="{{if eq $.Lang .Lang}}#{{else}}{{$.Link}}?lang={{.Lang}}{{end}}">{{.Name}}</a>
<a lang="{{.Lang}}" class="item {{if eq $.Lang .Lang}}active selected{{end}}" href="{{if eq $.Lang .Lang}}#{{else}}{{$.Link}}?lang={{.Lang}}{{end}}">{{.Name}}</a>
{{end}}
</div>
</div>

+ 1
- 1
templates/base/head.tmpl View File

@ -1,5 +1,5 @@
<!DOCTYPE html>
<html>
<html lang="{{.Language}}">
<head data-suburl="{{AppSubUrl}}">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">

Loading…
Cancel
Save