Skip to content

Add lang specific font stacks for CJK #6007

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
Mar 18, 2019
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
d9cff8b
Add lang specific font stacks
zeripath Feb 8, 2019
7733808
Force font changes
zeripath Feb 9, 2019
1dc2afd
Merge branch 'master' into issue-4173-alternative-fix
zeripath Feb 9, 2019
5d13c8b
Fix icons
zeripath Feb 9, 2019
0fc334a
Merge branch 'master' into issue-4173-alternative-fix
zeripath Feb 9, 2019
9e652eb
Fix octicons and icons
zeripath Feb 10, 2019
755983e
Just override the semantic ui fonts only
zeripath Feb 10, 2019
2c55257
Missed the headers... override them too
zeripath Feb 10, 2019
645a79d
Missed some more semantic ui stuff
zeripath Feb 10, 2019
5a0c8f3
Fix PT Sans
zeripath Feb 10, 2019
1264f90
Merge branch 'master' into issue-4173-alternative-fix
zeripath Feb 12, 2019
d014ae5
More changes
zeripath Feb 12, 2019
f3f23bf
Merge branch 'master' into issue-4173-alternative-fix
zeripath Feb 16, 2019
0b219ce
Merge branch 'master' into issue-4173-alternative-fix
zeripath Feb 17, 2019
e851f00
Merge branch 'master' into issue-4173-alternative-fix
zeripath Feb 20, 2019
81a7a7f
Merge branch 'master' into issue-4173-alternative-fix
zeripath Feb 23, 2019
0948dba
Merge branch 'master' into issue-4173-alternative-fix
zeripath Mar 3, 2019
489eed6
Merge branch 'master' into issue-4173-alternative-fix
zeripath Mar 13, 2019
47f323b
Squashed commit of the following:
CL-Jeremy Mar 13, 2019
d9b45ec
Merge pull request #1 from CL-Jeremy/issue-4173-patch
zeripath Mar 13, 2019
3034e23
update stylesheet
zeripath Mar 13, 2019
ca5fd1d
Merge branch 'master' into issue-4173-alternative-fix
lunny Mar 18, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions modules/context/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,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
Expand Down
22 changes: 7 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion public/css/index.css

Large diffs are not rendered by default.

78 changes: 76 additions & 2 deletions public/less/_base.less
Original file line number Diff line number Diff line change
@@ -1,11 +1,85 @@
@footer-margin: 40px;

@default-fonts: "Segoe UI", "Microsoft YaHei", Arial, Helvetica, sans-serif;

.override-fonts(@fonts) {
body {
font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, @fonts;
}

.markdown:not(code) {
font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, @fonts;
}

/* We're going to just override the semantic fonts here */
h1, h2, h3, h4, h5 {
font-family: "Lato", @fonts;
}

.home .hero h1, .home .hero h2 {
font-family: 'PT Sans Narrow', "Lato", @fonts;
}

.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
{
font-family: "Lato", @fonts;
}
}

body {
font-family: "Lato", "Segoe UI", "Microsoft YaHei", Arial, Helvetica, sans-serif !important;
.override-fonts(@default-fonts);
background-color: #fff;
overflow-y: scroll;
-webkit-font-smoothing: antialiased;
}

@ja-fonts: "Segoe UI", "ヒラギノ角ゴ Pro W3", "Hiragino Kaku Gothic Pro", "メイリオ", Meiryo, "MS Pゴシック", "MS PGothic", Roboto, Noto, "Noto Sans CJK JP", Arial, Helvetica, sans-serif;
:lang(ja) {
.override-fonts(@ja-fonts);
}

@zh-CN-fonts: "Segoe UI", "Microsoft YaHei New", "Microsoft Yahei", "微软雅黑", "方体", "PingFang SC", "黑体", "Heiti SC", STXihei, "华文细黑", Roboto, Noto, "Noto Sans CJK SC", Arial, Helvetica, sans-serif;
:lang(zh-CN) {
.override-fonts(@zh-CN-fonts);
}

@zh-TW-fonts: "Segoe UI", "方體", "PingFang TC", "黑體", "Heiti TC", "Microsoft JhengHei New", "Microsoft JhengHei", "微軟正黑體", "宋体", MingLiu, Roboto, Noto, "Noto Sans CJK TC", Arial, Helvetica, sans-serif;
:lang(zh-TW) {
.override-fonts(@zh-TW-fonts);
}

@zh-HK-fonts: "Segoe UI", "方體", "PingFang HK", "方體", "PingFang TC", "黑體", "Heiti TC", "Microsoft JhengHei New", "Microsoft JhengHei", "微軟正黑體", "宋体", MingLiu, Roboto, Noto, "Noto Sans CJK TC", Arial, Helvetica, sans-serif;
:lang(zh-HK) {
.override-fonts(@zh-HK-fonts);
}

@ko-fonts: "Segoe UI", 'Apple SD Gothic Neo', 'NanumBarunGothic', '맑은 고딕', 'Malgun Gothic', '굴림', 'Gulim', '돋움', 'Dotum', "Nanum Gothic", "Apple SD Gothic Neo", "Malgun Gothic", Roboto, Noto, "Noto Sans CJK KR", 'Helvetica Neue', 'Helvetica', Arial, sans-serif;
:lang(ko) {
.override-fonts(@ko-fonts);
}

img {
border-radius: 3px;
}
Expand Down Expand Up @@ -338,7 +412,7 @@ pre, code {
}

.sha.label {
font-family: Consolas, Menlo, Monaco, "Lucida Console", monospace;
font-family: Consolas, Menlo, Monaco, "Lucida Console", monospace, inherit;
font-size: 13px;
padding: 6px 10px 4px 10px;
font-weight: normal;
Expand Down
2 changes: 1 addition & 1 deletion public/less/_dashboard.less
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
}
}
.commit-id {
font-family: Consolas, monospace;
font-family: Consolas, monospace, inherit;
}
code {
padding: 1px;
Expand Down
2 changes: 1 addition & 1 deletion public/less/_form.less
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@

.githook {
textarea {
font-family: monospace;
font-family: monospace, inherit;
}
}

Expand Down
1 change: 0 additions & 1 deletion public/less/_markdown.less
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
8 changes: 4 additions & 4 deletions public/less/_repository.less
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@
.code-view {
* {
font-size: 12px;
font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace, inherit;
line-height: 20px;
}

Expand Down Expand Up @@ -700,7 +700,7 @@
}
textarea {
height: 200px;
font-family: "Consolas", monospace;
font-family: "Consolas", monospace, inherit;
}
}

Expand Down Expand Up @@ -803,7 +803,7 @@
}
textarea {
height: 200px;
font-family: "Consolas", monospace;
font-family: "Consolas", monospace, inherit;
}
}
}
Expand Down Expand Up @@ -1347,7 +1347,7 @@
&.new {
.CodeMirror {
.CodeMirror-code {
font-family: "Consolas", monospace;
font-family: "Consolas", monospace, inherit;
.cm-comment {
background: inherit;
}
Expand Down
2 changes: 1 addition & 1 deletion templates/base/footer_content.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion templates/base/head.tmpl
Original file line number Diff line number Diff line change
@@ -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">
Expand Down