Skip to content

Commit 50c1661

Browse files
Add CI lint for physical directional CSS classes
Prevents reintroduction of physical directional Tailwind classes (pl/pr, ml/mr, left/right, text-left/text-right, border-l/border-r, float-left/float-right). Lines with rtl: variants are excluded. Also fixes two missed physical classes: border-r on table cells and left-0 on lock icon positioning. Ref: #2195
1 parent f509a50 commit 50c1661

2 files changed

Lines changed: 21 additions & 2 deletions

File tree

.github/workflows/test.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,22 @@ jobs:
4040
- name: Validate RSS feed
4141
run: xmllint --noout public/feed.xml
4242
# - run: npm run test:html5validate
43+
- name: Lint for physical directional CSS classes
44+
run: |
45+
VIOLATIONS=$(grep -rn \
46+
-e '\bpl-\|\bpr-' \
47+
-e '\bml-\|\bmr-' \
48+
-e '\b-ml-\|\b-mr-' \
49+
-e '\bleft-\|\bright-' \
50+
-e '\btext-left\b\|\btext-right\b' \
51+
-e '\bborder-l\b\|\bborder-r\b' \
52+
-e '\bfloat-left\b\|\bfloat-right\b' \
53+
themes/le-2025/layouts/ themes/le-2025/assets/css/ \
54+
--include='*.html' --include='*.css' \
55+
| grep -v 'rtl:' \
56+
| grep -v 'direction: ltr' || true)
57+
if [ -n "$VIOLATIONS" ]; then
58+
echo "::error::Physical directional CSS classes found. Use logical equivalents (ps/pe, ms/me, start/end, text-start/text-end, border-s/border-e). See PR #2195."
59+
echo "$VIOLATIONS"
60+
exit 1
61+
fi

themes/le-2025/assets/css/le-2025-theme-input.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@
140140
}
141141

142142
& td:not(:last-child) {
143-
@apply border-r border-[#e8e8e8];
143+
@apply border-e border-[#e8e8e8];
144144
}
145145

146146
& tr:last-child td {
@@ -321,7 +321,7 @@
321321

322322
& li::before {
323323
content: '';
324-
@apply absolute left-0 top-1/2 transform -translate-y-1/2 w-[40px] h-[43px] bg-no-repeat bg-contain;
324+
@apply absolute start-0 top-1/2 transform -translate-y-1/2 w-[40px] h-[43px] bg-no-repeat bg-contain;
325325
background-image: url('/images/le-logo-lockonly-black-cropped.svg');
326326
}
327327
}

0 commit comments

Comments
 (0)