:root { --td-cell-group-title-padding-left: 32px; } html, body, #root { --td-swiper-border-radius: 0; height: 100%; min-height: 100vh; } html { color-scheme: light; background: #F5F5F8; } html.theme-dark { // TDesign 的深色变量挂在 :root[theme-mode='dark'] 上,项目用的是 html.theme-dark, // 两者不匹配会让组件和页面骨架一直停在浅色,这里补齐基础色做桥接 --td-bg-color-page: #10161f; --td-bg-color-container: #1a2230; --td-bg-color-container-hover: #222c3c; --td-component-border: rgba(255, 255, 255, .12); --td-text-color-primary: rgba(255, 255, 255, .9); --td-text-color-secondary: rgba(255, 255, 255, .55); --td-text-color-placeholder: rgba(255, 255, 255, .35); // 导航激活项在深色下需要压深,否则浅色胶囊压在深底上太刺眼 --tui-rail-active-background: rgba(15, 118, 110, .22); --tui-tabbar-active-background: rgba(15, 118, 110, .22); color-scheme: dark; background: #10161f; } body { margin: 0; color: #111827; background: #F5F5F8; font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; transition: background .2s ease, color .2s ease; } html.theme-dark body { color: #f3f4f6; background: #10161f; } * { box-sizing: border-box; } /** * 页面骨架(tui-page-layout / tui-page-content / tui-navbar / tui-tabbar)由 * timi-tdesign-mobile 的 page-layout.less 提供,这里只保留业务侧约定。 */ .tui-page-layout, .main-layout { .tui-page-content { .filters { --td-search-bg-color: var(--tui-white); --td-search-square-radius: 1rem; top: -1rem; margin: -1rem 0 1rem 0; padding: 1rem 1rem 0 1rem; z-index: 10; position: sticky; .t-input, [class*="__input-box"] { --td-button-border-radius: 99rem; border: 1px solid var(--td-component-border); height: 2.25rem; padding: .25rem .25rem .25rem .75rem; z-index: 2; position: relative; border-radius: 1rem; } .tabs { --td-tab-item-height: 32px; } .menus { --td-spacer-1: 6px; width: 100%; border: 1px solid rgba(148, 163, 184, .18); overflow: hidden; z-index: 1; margin-top: -1rem; border-top: none; padding-top: .8rem; border-radius: 0 0 1rem 1rem; } } // 列表页的滚动容器:外层分栏只管宽度,滚动交给它 .pull-refresh { flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 1rem); -webkit-overflow-scrolling: touch; .t-pull-down-refresh__track { height: auto; min-height: 100%; } &.has-dropdown-menu-navbar { .t-pull-down-refresh__track { // 覆盖 TDesign 展开菜单时写入的 overflow:hidden,避免 track 成为 sticky 的滚动容器。 overflow: visible !important; } } } } /** * 列表页的顶部间距必须落在真正的滚动容器上,内容才能穿进导航栏的毛玻璃层。 * 这类"业务语义"的约定放在项目侧,库只提供骨架和变量。 * * 不要求 .scroll:分栏形态下内容区不滚动,滚动的是主栏里的列表容器, * 但间距的落点一样,所以两种形态共用这一条。 */ &.tui-navbar .tui-page-content { &.notice { padding-top: var(--tui-nav-height); } &.list { padding-top: 0; padding-bottom: 0; .pull-refresh { padding-top: calc(var(--tui-nav-height) + 1rem); } } } } /** * Tab 页的内容宽度约束。 * * 手机上内容本来就占满宽度,平板/横屏起限制最大宽度并居中, * 避免入口卡片、设置列表、图表被拉成整屏宽的长条。 * 各页用 --tab-body-max 覆盖默认宽度(1rem = 16px)。 */ .tab-body { width: 100%; max-width: var(--tab-body-max, 60rem); margin: 0 auto; } .loading { margin: 1rem auto; } .cell-button { --td-button-border-radius: 1rem; width: calc(100% - 2rem); margin: 0 1rem; } .content-margin { margin: 0 1rem; } .form-tips { color: var(--td-text-color-secondary); font-size: .8125rem; line-height: 1.5; } .empty-cell-title-margin { --td-spacer-2: .25rem; } .t-input--password { letter-spacing: 0; } .t-form__label { color: var(--td-gray-color-9); flex: none; min-width: unset; white-space: nowrap; text-overflow: unset; } .t-cell { .t-cell__title { .t-cell__title-text { min-width: unset; white-space: nowrap; text-overflow: unset; } } } .t-dialog { --td-spacer-3: .75rem; .t-dialog__footer { --td-button-border-radius: 1rem; } } .t-pull-down-refresh { height: auto; overflow: visible; } .t-dropdown-menu { &:after { display: none !important; } :deep(.t-dropdown-menu__item) { min-width: 0; } :deep(.t-dropdown-menu__title) { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } } .avatar { flex: none; display: block; border-radius: .875rem !important; &.fallback { color: #FFF; display: flex; font-size: 1.25rem; background: var(--td-brand-color); align-items: center; font-weight: 600; justify-content: center; } } .t-popover { .t-popover__content { border-radius: 1rem; } } .fix-last-cell-line .item:last-child .t-cell:after { display: none; } .fix-cell-title-clip { .t-cell__title { flex: 1 1 0; min-width: 0; overflow: hidden; } } .glass-header, .filters.glass { &::after { content: ""; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; position: absolute; mask: linear-gradient(to top, transparent 0%, #000 60%); -webkit-mask: linear-gradient(to top, transparent 0%, #000 60%); backdrop-filter: blur(var(--tui-backdrop-blur, 10px)); -webkit-backdrop-filter: blur(var(--tui-backdrop-blur, 10px)); } } .glass-bottom { &::after { content: ""; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; position: absolute; mask: linear-gradient(to bottom, transparent 0%, #000 60%); -webkit-mask: linear-gradient(to bottom, transparent 0%, #000 60%); backdrop-filter: blur(var(--tui-backdrop-blur, 10px)); -webkit-backdrop-filter: blur(var(--tui-backdrop-blur, 10px)); } } .entrance-fade-up-enter-active { transition: opacity .4s ease, transform .4s ease; transition-delay: var(--entrance-delay, 0ms); } .entrance-fade-up-enter-from { opacity: 0; transform: translate3d(0, 1rem, 0); } .entrance-fade-up-enter-to { opacity: 1; transform: translate3d(0, 0, 0); }