**Steps to replicate**:
* see [[ https://ar.wikipedia.org/wiki/%D8%A7%D9%84%D9%84%D9%88%D8%AD_%D8%A7%D9%84%D9%85%D8%AD%D9%81%D9%88%D8%B8?useskin=vector-2022 | this Arabic article with vector 2022 skin]].
* go to the table of content on the right hand and find the level 2 heading named "وصف اللوح المحفوظ" and check the arrow before the section title.
* now see [[ https://fa.wikipedia.org/wiki/%D9%87%D9%88%D9%86%D8%AF%D8%A7_%D8%A7%D8%B3%DB%B6%DB%B6%DB%B0?useskin=vector-2022 | this Persian article with the same skin ]].
* again, go to the table of content and find level 2 heading named "بررسی اجمالی" and see the arrow before the title.
* inspect `.sidebar-toc` class for both pages and check the `padding` values (right and left paddings are swapped for Persian Wikipedia using Common.css as explained below).
**description and proposed solution**:
As you can see, in the arwiki, which uses rtl configuration, the arrow before the collapsible section titles (level 2 headings which have level 3 subsections) is incorrectly shown. this issue is present in all rtl wikis such as hewiki ([[https://he.wikipedia.org/wiki/%D7%90%D7%9C%D7%99%D7%A2%D7%96%D7%A8_%D7%91%D7%9F_%D7%A0%D7%AA%D7%9F?useskin=vector-2022 | example]]).
The value entered for right and left padding in `.sidebar-toc` class is the same in all rtl and ltr wikis, while the right and left padding values should be swapped when the direction is different.
We earlier addressed the issue in fawiki (reported [[https://fa.wikipedia.org/wiki/%D9%88%DB%8C%DA%98%D9%87:%D9%BE%DB%8C%D9%88%D9%86%D8%AF_%D8%AF%D8%A7%D8%A6%D9%85%DB%8C/35304102#%D8%A7%D8%B4%DA%A9%D8%A7%D9%84_%D9%86%D9%85%D8%A7%DB%8C%D8%B4%DB%8C_%D8%AF%D8%B1_%D8%B9%D9%84%D8%A7%D9%85%D8%AA_%C2%AB%CB%85%C2%BB_%D8%AF%D8%B1_%D9%81%D9%87%D8%B1%D8%B3%D8%AA_%D9%85%D8%B7%D8%A7%D9%84%D8%A8_%D8%AF%D8%B1_%D9%BE%D9%88%D8%B3%D8%AA%D9%87_%D8%AC%D8%AF%DB%8C%D8%AF|here]]) and implemented a temporary solution at [[ https://fa.wikipedia.org/wiki/%D9%85%D8%AF%DB%8C%D8%A7%D9%88%DB%8C%DA%A9%DB%8C:Common.css#L-11 | w:fa:MediaWiki:Common.css#L-11]]:
```
.sidebar-toc {
padding: 20px calc(15px + 0.75em) 20px 12px;
}
```
The value for **right padding** in **rtl** wikis should be calculated using `calc(15px + 0.75em)`. in **ltr** wikis, this value is considered for **left padding** (for example, inspect `.sidebar-toc` class in [[ https://en.wikipedia.org/wiki/La_familia_Trapisonda?useskin=vector-2022 | this English article]]).
# Developer notes
CSSJanus doesn't seem to flip calc values, so we should either:
1) not use calc
2) Per reporter suggestion add a rule `.rtl .sidebar-toc { 20px 12px 20px calc(15px + 0.75em); }`
== QA asteps
* Test AC1
* Test the Bengali issue
** [[ https://bn.wikipedia.org/wiki/%E0%A6%B6%E0%A7%87%E0%A6%96_%E0%A6%AE%E0%A7%81%E0%A6%9C%E0%A6%BF%E0%A6%AC%E0%A7%81%E0%A6%B0_%E0%A6%B0%E0%A6%B9%E0%A6%AE%E0%A6%BE%E0%A6%A8?uselang=bn&safemode=1 | Go to Bengali Wikipedia ]]
* Uncollapse the collapsible headings in the ToC to see sub-headings
* Test [[https://ar.wikipedia.org/wiki/%D8%AC%D8%AF%D8%A7%D8%A1_%D9%86%D9%82%D8%B7%D9%8A?uselang=ar]]
== QA Results - Beta
| **AC** | **Status** | **Details** |
| ----- | ----- | ----- |
| 1 | ✅ | T314652#8183797 |
== QA Results - Prod
| **AC** | **Status** | **Details** |
| ----- | ----- | ----- |
| 1 | ✅ | T314652#8187278 |