feat: Add RTL/LTR support with one-click toggle#38
Open
rafaumeu wants to merge 1 commit into
Open
Conversation
- Add RTL/LTR toggle button in header (Alpine.js + localStorage) - Add 'rtl' state to x-data across all 17 HTML pages - Set dir attribute on <html> via x-init + - Convert directional classes to Tailwind v4 logical properties (ml-/mr- -> ms-/me-, pl- -> ps-, left/right -> start/end) - Sidebar: translate-x direction flips based on rtl state - Notification dropdown: ltr:/rtl: variant prefixes for positioning - Add RTL documentation section to README - Run prettier (npm run sort) for consistent formatting Closes TailAdmin#27
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR adds full Right-to-Left (RTL) language support to TailAdmin, addressing issue #27.
Changes
RTL Toggle Button
rtlstate, persisted inlocalStorage(same pattern as existing Dark Mode toggle)dir="rtl"ordir="ltr"on the<html>element viax-initand ``Tailwind v4 Logical Properties
ml-/mr-→ms-/me-(margin-inline-start/end)pl-→ps-(padding-inline-start)left-/right-→start-/end-(inset-inline-start/end)dirattributeSidebar
translate-x-fullvs-translate-x-full)border-r→rtl:border-l)Notification Dropdown
ltr:andrtl:variant prefixes for correct alignmentDocumentation
Pages Modified
All 17 HTML pages + partials (header, sidebar, etc.)
Testing
npm run buildpasses without errors[dir="rtl"]and[dir="ltr"]selectors (8 each)npm run sort(Prettier) for consistent formattingCloses #27