From 27a691d9db9cb2f8ba170f935aadb1bed78ea96e Mon Sep 17 00:00:00 2001 From: Chuan-Heng Hsiao Date: Wed, 27 Dec 2023 15:05:24 -0500 Subject: [PATCH] improving font-weight for double-color --- src/components/InitConsts.tsx | 6 +++--- src/components/cells/ContentRenderer.module.css | 12 ++++++------ src/index.css | 1 + 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/components/InitConsts.tsx b/src/components/InitConsts.tsx index 95ba0f3..49fd493 100644 --- a/src/components/InitConsts.tsx +++ b/src/components/InitConsts.tsx @@ -34,11 +34,11 @@ export default (props: Props) => { let rect = ref.current.getBoundingClientRect() let theStyle = getComputedStyle(ref.current) - console.log('InitConsts: width:', rect.width, 'height:', rect.height, 'fontSize:', theStyle.fontSize, 'fontFamily:', theStyle.fontFamily) - InitCONSTS(windowWidth, rect.height, isMobile, fontSize, scale, screenWidth) + let lineHeight = rect.height - 0.5 + console.log('InitConsts: width:', rect.width, 'height:', rect.height, 'windowWidth:', windowWidth, 'lineHeight:', lineHeight, 'fontSize:', theStyle.fontSize, 'fontFamily:', theStyle.fontFamily) + InitCONSTS(windowWidth, lineHeight, isMobile, fontSize, scale, screenWidth) setIsInitConsts(true) }, [ref.current, isInitConsts]) - return () } \ No newline at end of file diff --git a/src/components/cells/ContentRenderer.module.css b/src/components/cells/ContentRenderer.module.css index baef158..b3bcdae 100644 --- a/src/components/cells/ContentRenderer.module.css +++ b/src/components/cells/ContentRenderer.module.css @@ -114,6 +114,12 @@ z-index: -2; /* Draw below the selectable text */ } +.halves-group { /* Container for a .halves rune group */ + /* Prevent .halves elements from being drawn below the background */ + position: relative; + z-index: 1; +} + .rune { white-space: pre; height: 100%; @@ -127,12 +133,6 @@ width: 100%; } -.halves-group { /* Container for a .halves rune group */ - /* Prevent .halves elements from being drawn below the background */ - position: relative; - z-index: 2; -} - .calc { color: rgba(0, 0, 0, 0); background-color: rgba(0, 0, 0, 0); diff --git a/src/index.css b/src/index.css index f2201c7..e974b55 100644 --- a/src/index.css +++ b/src/index.css @@ -6,6 +6,7 @@ body { line-height: 1; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; + font-weight: 500; } code {