Skip to content

Commit af3bc69

Browse files
authored
Merge pull request #71 from nics-tw/migrate/style-and-i18n-fixes
migrate: 修正 SCSS、i18n 文字內容與語言切換顯示
2 parents 30c0b3a + eeeaeaf commit af3bc69

File tree

8 files changed

+32
-32
lines changed

8 files changed

+32
-32
lines changed

assets/css/components/carousel.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,13 @@ img.reload {
5959
font-weight: 600;
6060

6161
&:hover {
62-
background-color: rgb(0, 0, 0);
62+
background-color: rgba(0, 0, 0, 1);
6363
}
6464

6565
&:focus {
6666
padding: 4px;
6767
border: 2px solid #fff;
68-
background-color: rgb(0, 0, 0);
68+
background-color: rgba(0, 0, 0, 1);
6969
outline: none;
7070
color: #fff;
7171
}
@@ -80,7 +80,7 @@ img.reload {
8080
border: 0 solid transparent;
8181

8282
&:hover {
83-
background-color: rgb(0, 0, 0);
83+
background-color: rgba(0, 0, 0, 1);
8484
}
8585
}
8686

assets/css/reset.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
*:not(article) {
66
> h1, > h2, > h3, > h4, > h5, > h6 {
7+
margin: 0;
78

89
&:not(article &) {
910
font-size: inherit;
1011
}
11-
margin: 0;
1212
}
1313
}
1414

assets/css/typography.scss

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,6 @@
11
@import 'utilities/px-to-rem';
22

33
:root {
4-
&:lang(zh) {
5-
--body-font-family: helvetica, 'Noto Sans TC', system-ui, sans-serif;
6-
}
7-
&:lang(en) {
8-
--body-font-family: helvetica, system-ui, sans-serif;
9-
}
10-
&:lang(ja) {
11-
--body-font-family: helvetica, 'Noto Sans JP', system-ui, sans-serif;
12-
}
13-
&:lang(th) {
14-
--body-font-family: helvetica, 'Noto Sans Thai', system-ui, sans-serif;
15-
}
16-
&:lang(vi) {
17-
--body-font-family: inter, system-ui, sans-serif;
18-
}
19-
204
--body-line-height: 1.7em;
215
--body-font-size: #{px-to-rem(16px)};
226

@@ -44,6 +28,22 @@
4428

4529
--h1-font-size: #{px-to-rem(36px)};
4630
--h1-font-weight: 600;
31+
32+
&:lang(zh) {
33+
--body-font-family: helvetica, 'Noto Sans TC', system-ui, sans-serif;
34+
}
35+
&:lang(en) {
36+
--body-font-family: helvetica, system-ui, sans-serif;
37+
}
38+
&:lang(ja) {
39+
--body-font-family: helvetica, 'Noto Sans JP', system-ui, sans-serif;
40+
}
41+
&:lang(th) {
42+
--body-font-family: helvetica, 'Noto Sans Thai', system-ui, sans-serif;
43+
}
44+
&:lang(vi) {
45+
--body-font-family: inter, system-ui, sans-serif;
46+
}
4747
}
4848

4949
a {

content/components/button-and-link/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ maturity: "alpha"
55

66
### 常見按鈕
77

8-
{{< live-example partial="ctas/button.html" i18n_selector="button" i18n="en-US:Submit,Delete,Cancel;ja:送信,削除,キャンセル;vi:Gửi,Xóa,Hủy;th:ส่ง,ลบ,ยกเลิก" >}}
8+
{{< live-example partial="ctas/button.html" i18n_selector="button" i18n="en-US:Submit,Delete,Next;ja:送信,削除,キャンセル;vi:Gửi,Xóa,Hủy;th:ส่ง,ลบ,ยกเลิก" >}}
99

1010
#### CSS
1111

content/components/form/_index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ maturity: "alpha"
55

66
### 簡易欄位
77

8-
{{< live-example partial="form/form-elements.html" i18n_selector="[for=name],[for=city],[for=desc]" i18n="en-US:Full name,City of residence,Description" >}}
8+
{{< live-example partial="form/form-elements.html" i18n_selector="[for=name],[for=city],[for=desc],[value='select'],[value=taipei],[value=newtaipei],[value=keelung]" i18n="en-US:Full name,City of residence,Description,Select,Taipei,New Taipei,Keelung" >}}
99

1010
#### CSS
1111

@@ -23,7 +23,7 @@ maturity: "alpha"
2323

2424
### 選項欄位
2525

26-
{{< live-example partial="form/form-checkable.html" i18n_selector="[for=id],[for=items]" i18n="en-US:ID type,Lost document replacement" >}}
26+
{{< live-example partial="form/form-checkable.html" i18n_selector="[for=id],[for=items],[for=v-healthid],[for=v-moica],[for=v-phone],[for=check-h-healthid],[for=check-h-moica],[for=check-h-id]" i18n="en-US:ID type,Lost document replacement,NHI Card,Digital Certificate,Cell phone,NHI Card,Digital Certificate,ID Card" >}}
2727

2828
#### CSS
2929

@@ -33,7 +33,7 @@ maturity: "alpha"
3333

3434
### 欄位說明
3535

36-
{{< live-example partial="form/field.html" i18n_selector="label,.field-description li" i18n="en-US:Email,Address must end with @pdis.nat.gov.tw.;" >}}
36+
{{< live-example partial="form/field.html" i18n_selector="label,.field-description li" i18n="en-US:Email,Address must end with @pdis.nat.gov.tw." >}}
3737

3838
#### CSS
3939

@@ -45,7 +45,7 @@ maturity: "alpha"
4545

4646
### 必要欄位
4747

48-
{{< live-example partial="form/field-required.html" i18n_selector="label,.field-required" i18n="en-US:Email,required;" >}}
48+
{{< live-example partial="form/field-required.html" i18n_selector="label,.field-required" i18n="en-US:Email,required" >}}
4949

5050
#### 親和力
5151

layouts/_partials/example.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
}}
99
<select
1010
aria-label="語言選擇"
11-
data-i18n-selector="{{ .i18n_selector }}"
11+
data-i18n-selector="{{ $.i18n_selector }}"
1212
class="field-select absolute nt2 lh-solid pa1 right-0 mr4 top-0 f7 pointer"
1313
>
1414
<option value="default">正體中文</option>
1515
{{ range $i18n }} {{ $parts := split . ":" }}
1616
<option lang="{{ index $parts 0 }}" data-phrases="{{ index $parts 1 }}">
17-
{{ index $.Site.Params.i18n.langs (index $parts 0) }}
17+
{{ index $.context.Site.Params.i18n.langs (index $parts 0) }}
1818
</option>
1919
{{ end }}
2020
</select>

layouts/_partials/form/form-elements.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
<fieldset class="fieldset">
77
<label for="city" class="field-label">居住城市</label>
88
<select class="field-input" id="city">
9-
<option for="select">選擇</option>
10-
<option for="taipei">台北市</option>
11-
<option for="newtaipei">新北市</option>
12-
<option for="keelung">基隆市</option>
9+
<option value="select">選擇</option>
10+
<option value="taipei">台北市</option>
11+
<option value="newtaipei">新北市</option>
12+
<option value="keelung">基隆市</option>
1313
</select>
1414
</fieldset>
1515
<fieldset class="fieldset">

layouts/_shortcodes/live-example.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
{{ if eq $customElement "true" }}{{ $inject_data = $raw_content | base64Encode }}{{ end }}
88
{{ $rendered_content := cond (eq $customElement "true") "" (partial $partial_name .) }}
99
{{ $code_content := cond (eq $customElement "true") $raw_content $rendered_content }}
10-
{{ partial "example.html" (dict "rendered_content" $rendered_content "raw_content" $code_content "inject_html_data" $inject_data "context" .) }}
10+
{{ partial "example.html" (dict "rendered_content" $rendered_content "raw_content" $code_content "inject_html_data" $inject_data "i18n" (.Get "i18n") "i18n_selector" (.Get "i18n_selector") "context" .) }}

0 commit comments

Comments
 (0)