feat: add safe area paddings

This commit is contained in:
kunish 2023-09-05 02:12:10 +08:00
parent f0fbe09838
commit 9840141bce
No known key found for this signature in database
GPG Key ID: 647A12B4F782C430
5 changed files with 18 additions and 3 deletions

View File

@ -4,7 +4,7 @@
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta <meta
name="viewport" name="viewport"
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover"
/> />
<meta name="theme-color" content="#000000" /> <meta name="theme-color" content="#000000" />
<link rel="shortcut icon" type="image/svg" href="/src/assets/favicon.svg" /> <link rel="shortcut icon" type="image/svg" href="/src/assets/favicon.svg" />

View File

@ -57,6 +57,7 @@
"sort-package-json": "^2.5.1", "sort-package-json": "^2.5.1",
"tailwind-merge": "^1.14.0", "tailwind-merge": "^1.14.0",
"tailwindcss": "^3.3.3", "tailwindcss": "^3.3.3",
"tailwindcss-safe-area": "^0.4.0",
"typescript": "^5.2.2", "typescript": "^5.2.2",
"uuid": "^9.0.0", "uuid": "^9.0.0",
"vite": "^4.4.9", "vite": "^4.4.9",

View File

@ -143,6 +143,9 @@ dependencies:
tailwindcss: tailwindcss:
specifier: ^3.3.3 specifier: ^3.3.3
version: 3.3.3(ts-node@10.9.1) version: 3.3.3(ts-node@10.9.1)
tailwindcss-safe-area:
specifier: ^0.4.0
version: 0.4.0
typescript: typescript:
specifier: ^5.2.2 specifier: ^5.2.2
version: 5.2.2 version: 5.2.2
@ -7557,6 +7560,14 @@ packages:
} }
dev: false dev: false
/tailwindcss-safe-area@0.4.0:
resolution:
{
integrity: sha512-V6UFT+LCYJOg9780fcQwA4k0RDCmyjRab7G8fwdeoasT9NOCpmXdCV1q79PSI9AK/KtimTIzGeQfeRH583lH5A==,
}
engines: { node: '>=16' }
dev: false
/tailwindcss@3.3.3(ts-node@10.9.1): /tailwindcss@3.3.3(ts-node@10.9.1):
resolution: resolution:
{ {

View File

@ -39,7 +39,7 @@ export const App = () => {
return ( return (
<div <div
class="relative flex h-screen flex-col subpixel-antialiased" class="relative flex h-screen flex-col subpixel-antialiased p-safe"
data-theme={curTheme()} data-theme={curTheme()}
> >
<Header /> <Header />

View File

@ -1,8 +1,11 @@
import daisyui from 'daisyui' import daisyui from 'daisyui'
import { Config } from 'tailwindcss' import { Config } from 'tailwindcss'
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
import safeArea from 'tailwindcss-safe-area'
export default { export default {
content: ['./src/**/*.{css,tsx}'], content: ['./src/**/*.{css,tsx}'],
plugins: [daisyui], plugins: [daisyui, safeArea],
daisyui: { themes: true }, daisyui: { themes: true },
} as Config } as Config