Skip to content

Instantly share code, notes, and snippets.

@amirhp-com
Created April 24, 2025 09:06
Show Gist options
  • Save amirhp-com/8d259ada28af270d45ea45e795b3c563 to your computer and use it in GitHub Desktop.
Save amirhp-com/8d259ada28af270d45ea45e795b3c563 to your computer and use it in GitHub Desktop.
Notion RTL Style Injector
/**
* Notion RTL Style Injector
*
* This JavaScript snippet injects RTL (Right-to-Left) styling and a custom Persian font
* into the Notion web app. It applies IranYekanXVF to all text content and ensures proper
* direction for common block types like lists and text blocks.
*
* Usage:
* - Paste this code into your browser console while using Notion.
* - Alternatively, embed it into a userscript extension or a custom Electron wrapper.
* - It enhances readability for Persian users by aligning the layout to RTL standards.
*
* Developed by: amirhp-com
* Website: https://amirhp.com
*
* Disclaimer:
* - This code is provided "as is", without warranty of any kind.
* - You are free to use, modify, and distribute this script for personal or commercial use.
* - The developer is not responsible for any issues caused by injecting this script.
*/
const style = document.createElement("style");
style.innerHTML = `
.layout-content,
[contenteditable],
div#notion-app div {
font-family: "IranYekanXVF";
}
.notion-numbered_list-block,
.notion-to_do-block,
.notion-bulleted_list-block,
.notion-page-content .notion-text-block [contenteditable] {
direction: rtl;
}`;
document.head.appendChild(style);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment