feat: 完成70%全局样式与可读性优化
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
$root = Split-Path -Parent $PSScriptRoot
|
||||
$sourceFiles = @(
|
||||
(Get-ChildItem -LiteralPath (Join-Path $root 'pages') -Recurse -File -Include *.vue),
|
||||
(Get-ChildItem -LiteralPath (Join-Path $root 'components') -Recurse -File -Include *.vue),
|
||||
(Get-ChildItem -LiteralPath (Join-Path $root 'styles') -Recurse -File -Include *.scss),
|
||||
(Get-Item -LiteralPath (Join-Path $root 'App.vue'))
|
||||
)
|
||||
|
||||
foreach ($file in $sourceFiles) {
|
||||
$content = Get-Content -LiteralPath $file.FullName -Raw -Encoding UTF8
|
||||
if ($content -match 'font-size\s*:\s*\d+rpx') {
|
||||
throw "Fixed rpx font size remains: $($file.FullName)"
|
||||
}
|
||||
if ($content -match 'readable-font|readable-line-height') {
|
||||
throw "Sass typography helper remains: $($file.FullName)"
|
||||
}
|
||||
}
|
||||
|
||||
$allSource = ($sourceFiles | ForEach-Object {
|
||||
Get-Content -LiteralPath $_.FullName -Raw -Encoding UTF8
|
||||
}) -join "`n"
|
||||
if ($allSource -notmatch 'clamp\(\d+px,\s*\d+rpx,\s*\d+px\)') {
|
||||
throw 'Responsive clamp typography rule missing from app source'
|
||||
}
|
||||
|
||||
Write-Output 'READABLE-FONT-CONTRACT PASS'
|
||||
Reference in New Issue
Block a user