From 3e73c1b4bc0eb5a5bae56d26dbc6dce083697279 Mon Sep 17 00:00:00 2001 From: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> Date: Tue, 10 Jun 2025 00:53:04 +0530 Subject: [PATCH] feat: Add RTL support in public help center (#11692) # Pull Request Template ## Description This PR adds RTL support in public help center. Fixes https://linear.app/chatwoot/issue/CW-4459/support-for-rtl-in-public-help-center ## Type of change - [x] New feature (non-breaking change which adds functionality) ## How Has This Been Tested? ### Loom video https://www.loom.com/share/d48a26ec80e04545addca825882b4d79?sid=aa7a6b37-33bc-4f63-b1cc-54b27a7733cf ## Checklist: - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my code - [ ] I have commented on my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged and published in downstream modules --- app/javascript/portal/application.scss | 17 ++++++++++++++++- .../portal/components/TableOfContents.vue | 12 +++++++----- app/javascript/portal/portalHelpers.js | 10 ++++++++++ .../public/api/v1/portals/_authors.html.erb | 8 ++++---- .../public/api/v1/portals/_header.html.erb | 6 +++--- 5 files changed, 40 insertions(+), 13 deletions(-) diff --git a/app/javascript/portal/application.scss b/app/javascript/portal/application.scss index bdb7bd1d4..4aaf36191 100644 --- a/app/javascript/portal/application.scss +++ b/app/javascript/portal/application.scss @@ -1,3 +1,4 @@ +// scss-lint:disable SpaceAfterPropertyColon @import 'tailwindcss/base'; @import 'tailwindcss/components'; @import 'tailwindcss/utilities'; @@ -7,7 +8,21 @@ html, body { - font-family: 'InterDisplay', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji; + font-family: + 'InterDisplay', + -apple-system, + system-ui, + BlinkMacSystemFont, + 'Segoe UI', + Roboto, + 'Helvetica Neue', + Tahoma, + Arial, + sans-serif, + 'Noto Sans', + 'Apple Color Emoji', + 'Segoe UI Emoji', + 'Noto Color Emoji'; -moz-osx-font-smoothing: grayscale; -webkit-font-smoothing: antialiased; height: 100%; diff --git a/app/javascript/portal/components/TableOfContents.vue b/app/javascript/portal/components/TableOfContents.vue index ec7ccd895..3cb140018 100644 --- a/app/javascript/portal/components/TableOfContents.vue +++ b/app/javascript/portal/components/TableOfContents.vue @@ -37,7 +37,7 @@ export default { } if (el.tag === 'h2') { if (this.h1Count > 0) { - return 'ml-2'; + return 'ltr:ml-2 rtl:mr-2'; } return ''; } @@ -46,7 +46,7 @@ export default { if (!this.h1Count && !this.h2Count) { return ''; } - return 'ml-5'; + return 'ltr:ml-5 rtl:mr-5'; } return ''; @@ -94,17 +94,19 @@ export default {