make weekday font smaller for Chinese locale (#2535) (#2571)

* make weekday font smaller for Chinese locale (#2535)

* add item to contributor list
This commit is contained in:
mmjang 2023-07-12 18:44:25 +08:00 committed by GitHub
parent ae6d79fd7e
commit ed332966d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -126,6 +126,7 @@ Joel Koen <mail@joelkoen.com>
Christopher Woggon <christopher.woggon@gmail.com>
Kavel Rao <github.com/kavelrao>
Ben Yip <github.com/bennyyip>
mmjang <752515918@qq.com>
********************

View File

@ -21,6 +21,7 @@ import {
timeYear,
} from "d3";
import { firstLanguage } from "../lib/i18n/bundles";
import type { GraphBounds, SearchDispatch } from "./graph-helpers";
import { RevlogRange, setDataAvailable } from "./graph-helpers";
import { clickableClass } from "./graph-styles";
@ -154,6 +155,8 @@ export function renderCalendar(
const height = bounds.height / 10;
const emptyColour = nightMode ? "#333" : "#ddd";
const firstLang = firstLanguage();
svg.select("g.weekdays")
.selectAll("text")
.data(sourceData.weekdayLabels)
@ -166,7 +169,7 @@ export function renderCalendar(
.attr("fill", nightMode ? "#ddd" : "black")
.attr("dominant-baseline", "hanging")
.attr("text-anchor", "end")
.attr("font-size", "small")
.attr("font-size", firstLang.includes("zh") ? "xx-small" : "small")
.attr("font-family", "monospace")
.attr("direction", "ltr")
.style("user-select", "none")