-
Notifications
You must be signed in to change notification settings - Fork 3k
fix: reduce tab width to 2 spaces in rich text (tldraw #7703) #7705
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: reduce tab width to 2 spaces in rich text (tldraw #7703) #7705
Conversation
- Add --tl-tab-size CSS custom property to .tl-container for theming - Apply tab-size: var(--tl-tab-size, 2) to .tl-text and .tl-rich-text .ProseMirror - Makes tabs render at 2 space widths instead of browser default (8)
|
@sahiee-dev is attempting to deploy a commit to the tldraw Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
Ensures tabs render at 2-space width in SVG exports, matching the CSS behavior in the app.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
Changed from hardcoded '2' to 'var(--tl-tab-size, 2)' to respect user theme customizations, matching the pattern used for textShadow.
|
Sorry @sahiee-dev, we're not accepting pull requests from external contributors at this time. See discussion here. If you'd like to report a bug or suggest a feature, please open an issue instead. |
|
i think this was actually a decent way to address the issue. @sahiee-dev i'm reopening this - sorry we've been closing a bunch of PRs lately to reduce noise from AI-generated PRs. i'll re-examine this one more closely. |
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
looks like @steveruizok is redoing this over in another PR: #7796 |
|
@mimecuvalo Thanks for revisiting this and landing a fix. Appreciate the time. |
Reduce rich text tab width to 2 spaces
This PR reduces the visual width of tab characters (
\t) in text and rich text shapes from the browser default (~8 spaces) to 2 spaces, making indentation more compact and practical for notes and code-like content.What changed
--tl-tab-sizeCSS custom property to.tl-containerfor theming and configurabilitytab-size: var(--tl-tab-size, 2)to:.tl-text(plain text shapes).tl-rich-text .ProseMirror(rich text editor)Before / After
Before (browser default tab width ~8 spaces)

After (tab-size = 2 spaces)

This is a visual-only improvement; text data remains unchanged.
Change type
bugfiximprovementfeatureapiotherTest plan
Tabto insert indentationRelease notes
fixes #7703
Note
Low Risk
Low risk: this is a visual-only styling change affecting how tab characters render in text/rich-text editing and SVG export, with no data-model or behavior changes.
Overview
Tab characters now render with a 2-space width instead of the browser default by introducing
--tl-tab-sizeon.tl-container.This applies
tab-size: var(--tl-tab-size, 2)to.tl-textand.tl-rich-text .ProseMirror, and setstabSizeinRichTextLabel’s SVG export styling so exported rich text matches on-canvas rendering.Written by Cursor Bugbot for commit dea295c. This will update automatically on new commits. Configure here.