import { Theme, css } from 'antd-style'; import { rgba } from 'polished'; import { isDesktop } from '@/const/version'; // fix ios input keyboard // overflow: hidden; // ref: https://zhuanlan.zhihu.com/p/113855026 export default ({ token }: { prefixCls: string; token: Theme }) => css` html, body, #__next { position: relative; overscroll-behavior: none; height: 100%; min-height: 100dvh; max-height: 100dvh; background: ${token.colorBgLayout}; @media (min-device-width: 576px) { overflow: hidden; } } html { background: ${isDesktop ? 'none' : token.colorBgLayout}; } body { /* 提高合成层级,强制硬件加速,否则会有渲染黑边出现 */ will-change: opacity; transform: translateZ(0); background: ${isDesktop ? rgba(token.colorBgLayout, 0.66) : token.colorBgLayout}; } * { scrollbar-color: ${token.colorFill} transparent; scrollbar-width: thin; ::-webkit-scrollbar { width: 0.75em; height: 0.75em; } ::-webkit-scrollbar-thumb { border-radius: 10px; } :hover::-webkit-scrollbar-thumb { border: 3px solid transparent; background-color: ${token.colorText}; background-clip: content-box; } ::-webkit-scrollbar-track { background-color: transparent; } } `;