feat(miniprogram): add safe-area CSS vars style builder

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
wuzilongandCursor committed 2026-09-12 18:48:57 +08:00
1 parent 0599b7a3a9
commit cfe0f94467
3 files changed
+31

No files matched your search

+8
View File
@@ -1,3 +1,7 @@
import { buildSafeAreaCssVarsStyle } from './safeAreaCss.js'
export { buildSafeAreaCssVarsStyle }
const DEFAULT_NAV_CONTENT_HEIGHT = 44
const DEFAULT_GAP = 8
const DEFAULT_HORIZONTAL_PADDING = 8
@@ -79,3 +83,7 @@ export function getGlobalSafeArea() {
const app = getApp?.()
return app?.globalData?.safeArea || computeSafeAreaMetrics()
}
export function getSafeAreaStyle() {
return buildSafeAreaCssVarsStyle(getGlobalSafeArea())
}