support tablet
This commit is contained in:
@@ -17,6 +17,20 @@ html {
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -38,40 +52,14 @@ html.theme-dark body {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.page-layout,
|
||||
/**
|
||||
* 页面骨架(tui-page-layout / tui-page-content / tui-navbar / tui-tabbar)由
|
||||
* timi-tdesign-mobile 的 page-layout.less 提供,这里只保留业务侧约定。
|
||||
*/
|
||||
.tui-page-layout,
|
||||
.main-layout {
|
||||
color: var(--td-text-color-primary);
|
||||
background: var(--td-bg-color-page);
|
||||
min-height: 100vh;
|
||||
box-sizing: border-box;
|
||||
|
||||
.page-content {
|
||||
flex: 1;
|
||||
inset: 0;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
overflow: hidden;
|
||||
position: absolute;
|
||||
min-height: 0;
|
||||
padding-top: calc(env(safe-area-inset-top, 0px) + 48px + 1rem);
|
||||
box-sizing: border-box;
|
||||
padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 1rem);
|
||||
flex-direction: column;
|
||||
|
||||
&.scroll {
|
||||
overflow: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
&.column {
|
||||
gap: 1rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
&.scroll > * {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
}
|
||||
.tui-page-content {
|
||||
|
||||
.filters {
|
||||
--td-search-bg-color: var(--tui-white);
|
||||
@@ -113,6 +101,7 @@ html.theme-dark body {
|
||||
}
|
||||
}
|
||||
|
||||
// 列表页的滚动容器:外层分栏只管宽度,滚动交给它
|
||||
.pull-refresh {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
@@ -136,40 +125,25 @@ html.theme-dark body {
|
||||
}
|
||||
}
|
||||
|
||||
&.navbar {
|
||||
--app-nav-height: calc(env(safe-area-inset-top, 0px) + 48px);
|
||||
/**
|
||||
* 列表页的顶部间距必须落在真正的滚动容器上,内容才能穿进导航栏的毛玻璃层。
|
||||
* 这类"业务语义"的约定放在项目侧,库只提供骨架和变量。
|
||||
*
|
||||
* 不要求 .scroll:分栏形态下内容区不滚动,滚动的是主栏里的列表容器,
|
||||
* 但间距的落点一样,所以两种形态共用这一条。
|
||||
*/
|
||||
&.tui-navbar .tui-page-content {
|
||||
|
||||
.t-navbar__content {
|
||||
color: var(--tui-black, #000);
|
||||
overflow: visible;
|
||||
box-shadow: 0 3px 8px rgba(0, 0, 0, .1);
|
||||
background: rgba(250, 250, 250, .8);
|
||||
backdrop-filter: blur(10px);
|
||||
-webkit-backdrop-filter: blur(10px);
|
||||
&.notice {
|
||||
padding-top: var(--tui-nav-height);
|
||||
}
|
||||
|
||||
&.tabbar {
|
||||
&.list {
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
|
||||
.page-content.scroll,
|
||||
.page-content.column {
|
||||
padding-bottom: 6rem;
|
||||
}
|
||||
}
|
||||
|
||||
.page-content.scroll {
|
||||
|
||||
&.notice {
|
||||
padding-top: var(--app-nav-height);
|
||||
}
|
||||
|
||||
&.list {
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
|
||||
.pull-refresh {
|
||||
padding-top: calc(var(--app-nav-height) + 1rem);
|
||||
padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 1rem);
|
||||
}
|
||||
.pull-refresh {
|
||||
padding-top: calc(var(--tui-nav-height) + 1rem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user