迁移A04为自适应文档流
This commit is contained in:
@@ -87,10 +87,36 @@ foreach ($required in @(
|
||||
|
||||
$contentRule = [regex]::Match($register, '(?ms)^\.register-content\s*\{(?<Body>.*?)^\}')
|
||||
if (-not $contentRule.Success) { throw 'A04 register content rule is missing.' }
|
||||
foreach ($required in @('display: flex;', 'flex: 1;', 'flex-direction: column;', 'max-width: 480px;', 'margin: 0 auto;')) {
|
||||
foreach ($required in @('display: flex;', 'flex: 1;', 'flex-direction: column;', 'justify-content: flex-start;', 'max-width: 480px;', 'margin: 0 auto;')) {
|
||||
Assert-Contains -Content $contentRule.Groups['Body'].Value -Expected $required -Message "A04 register content must use document flow: $required"
|
||||
}
|
||||
|
||||
$headingRule = [regex]::Match($register, '(?ms)^\.page-heading\s*\{(?<Body>.*?)^\}')
|
||||
if (-not $headingRule.Success) { throw 'A04 page heading rule is missing.' }
|
||||
Assert-Contains -Content $headingRule.Groups['Body'].Value -Expected 'grid-template-columns: minmax(0, 1fr);' -Message 'A04 heading must center against the full content width.'
|
||||
foreach ($selector in @('page-title', 'page-subtitle', 'register-divider')) {
|
||||
$rule = [regex]::Match($register, "(?ms)^\.$selector\s*\{(?<Body>.*?)^\}")
|
||||
if (-not $rule.Success) { throw "A04 heading child rule is missing: $selector" }
|
||||
Assert-Contains -Content $rule.Groups['Body'].Value -Expected 'grid-column: 1;' -Message "A04 heading child must remain in the full-width grid column: $selector"
|
||||
}
|
||||
|
||||
foreach ($ruleContract in @(
|
||||
@{ Selector = 'register-submit__content'; Expected = 'font-size: 36rpx;' },
|
||||
@{ Selector = 'agreement-row'; Expected = 'font-size: 24rpx;' },
|
||||
@{ Selector = 'agreement-row'; Expected = 'color: #493323;' },
|
||||
@{ Selector = 'input-label'; Expected = 'font-size: 30rpx;' },
|
||||
@{ Selector = 'auth-input'; Expected = 'font-size: 30rpx;' },
|
||||
@{ Selector = 'auth-input'; Expected = 'color: #493323;' },
|
||||
@{ Selector = 'placeholder'; Expected = 'color: #9f968d;' },
|
||||
@{ Selector = 'login-entry'; Expected = 'font-size: 28rpx;' },
|
||||
@{ Selector = 'login-entry'; Expected = 'color: #493323;' },
|
||||
@{ Selector = 'login-entry'; Expected = 'margin-top: auto;' }
|
||||
)) {
|
||||
$rule = [regex]::Match($register, "(?ms)^\.$($ruleContract.Selector)\s*\{(?<Body>.*?)^\}")
|
||||
if (-not $rule.Success) { throw "A04 style rule is missing: $($ruleContract.Selector)" }
|
||||
Assert-Contains -Content $rule.Groups['Body'].Value -Expected $ruleContract.Expected -Message "A04 typography must match A01: $($ruleContract.Selector) $($ruleContract.Expected)"
|
||||
}
|
||||
|
||||
foreach ($forbidden in @(
|
||||
'(?s)\.register-panel\s*\{[^}]*\bborder\s*:',
|
||||
'(?s)\.register-panel\s*\{[^}]*\bbackground\s*:',
|
||||
|
||||
Reference in New Issue
Block a user