全局设置鸿蒙黑体字体

- 集中定义深圳自然博物馆品牌字体栈
- 全局覆盖 H5 与 uni-app 根节点字体
- 基础视图、文本、表单元素统一继承字体

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
lyf
2026-06-29 15:09:19 +08:00
parent 04c908b9e7
commit ba59642bc7
2 changed files with 27 additions and 3 deletions

View File

@@ -6,7 +6,9 @@ onLaunch(() => {
})
</script>
<style>
<style lang="scss">
@import './styles/variables.scss';
/* 设计系统 CSS 变量 */
:root {
/* 主色调 */
@@ -60,14 +62,33 @@ onLaunch(() => {
}
/* 全局样式重置 */
page {
page,
body,
#app,
uni-app,
uni-page,
uni-page-body {
background-color: var(--museum-bg-light);
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
font-family: var(--museum-font-family);
font-size: 14px;
color: var(--museum-text-primary);
line-height: 1.5;
}
view,
text,
button,
input,
textarea,
uni-view,
uni-text,
uni-button,
uni-input,
uni-textarea,
:where(#app, uni-app, uni-page, uni-page-body) * {
font-family: inherit;
}
/* 通用工具类 */
.flex {
display: flex;

View File

@@ -1,5 +1,8 @@
/* CSS 变量定义 */
:root {
/* 字体 */
--museum-font-family: 'HarmonyOS Sans SC', 'HarmonyOS Sans', '鸿蒙黑体', 'Microsoft YaHei', 'PingFang SC', 'Noto Sans CJK SC', Arial, sans-serif;
/* 主色调 */
--museum-accent: #E0DF00;
--museum-accent-dark: #C2C600;