Sync styleguide 2026.05.18.1
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
CSS_FILE="$ROOT_DIR/styleguide.css"
|
||||
|
||||
selectors=(
|
||||
"sg-portal-header"
|
||||
"sg-options-row"
|
||||
"sg-card-list-page-drawer__header"
|
||||
"sg-card-list-page-drawer__content"
|
||||
)
|
||||
|
||||
for selector in "${selectors[@]}"; do
|
||||
block="$(awk -v selector=".$selector" '
|
||||
$0 ~ selector"[[:space:]]*\\{" {in_block=1}
|
||||
in_block {print}
|
||||
in_block && /}/ {exit}
|
||||
' "$CSS_FILE")"
|
||||
|
||||
if [[ -z "$block" ]]; then
|
||||
echo "ERROR: selector .$selector not found in styleguide.css"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if echo "$block" | rg -n "(padding|padding-inline|padding-left|padding-right|inset|inset-inline)([^\n;]*)([0-9]+px)" >/dev/null; then
|
||||
echo "ERROR: hardcoded px inset/padding value found in .$selector"
|
||||
echo "$block"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
echo "OK: no hardcoded px inset values in guarded pattern selectors"
|
||||
Reference in New Issue
Block a user