feat: unify project responsive layouts
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$root = Split-Path -Parent $PSScriptRoot
|
||||
$dialog = Get-Content -LiteralPath (Join-Path $root 'components/AppDialog.vue') -Raw -Encoding UTF8
|
||||
|
||||
foreach ($token in @(
|
||||
'compactActions: { type: Boolean, default: false }',
|
||||
'class="app-dialog__copy"',
|
||||
':compact="compactActions && showCancel"',
|
||||
'@use "../styles/adaptive-frame-profiles.scss" as adaptive;',
|
||||
'@include adaptive.adaptive-auth-dialog;',
|
||||
'max-height: calc(var(--app-viewport-height, 100vh) - 160rpx);',
|
||||
'margin-top: 26rpx;'
|
||||
)) {
|
||||
if (-not $dialog.Contains($token)) { throw "AppDialog responsive contract missing: $token" }
|
||||
}
|
||||
|
||||
foreach ($forbidden in @(
|
||||
'min-height: 520rpx;',
|
||||
'center / contain no-repeat',
|
||||
'margin-top: auto;'
|
||||
)) {
|
||||
if ($dialog.Contains($forbidden)) { throw "AppDialog responsive contract forbids: $forbidden" }
|
||||
}
|
||||
|
||||
foreach ($rule in @(
|
||||
'(?s)\.app-dialog__copy\s*\{[^}]*display:\s*flex;[^}]*width:\s*100%;[^}]*flex-direction:\s*column;',
|
||||
'(?s)\.app-dialog__title,\s*\.app-dialog__message\s*\{[^}]*display:\s*block;[^}]*width:\s*100%;'
|
||||
)) {
|
||||
if ($dialog -notmatch $rule) { throw "AppDialog responsive layout rule missing: $rule" }
|
||||
}
|
||||
|
||||
Write-Output 'APP-DIALOG-RESPONSIVE-CONTENT-CONTRACT PASS'
|
||||
Reference in New Issue
Block a user