Skip to content

feat(CodeBlock): add line wrapping to codeblock [wip]#949

Draft
d3m1d0v wants to merge 3 commits intomainfrom
codeblock-linewrapping
Draft

feat(CodeBlock): add line wrapping to codeblock [wip]#949
d3m1d0v wants to merge 3 commits intomainfrom
codeblock-linewrapping

Conversation

@d3m1d0v
Copy link
Member

@d3m1d0v d3m1d0v commented Feb 10, 2026

Changes in CodeBlock:

  • Text wrapping is disabled by default.
  • Floating toolbar for code block has been redesigned:
    • Move PlainText to first position in the language select list.
    • Replace the "line numbers" checkbox with a toggle button
    • Add a copy button
    • Change the remove button theme to danger
  • Add button to the floating toolbar to toggle text wrapping - it will only affect the current code block and only during current editing session for current user

Toolbar:

  • add danger theme to single button

Also added a new example story where you can configure a code block.

image

@gravity-ui
Copy link

gravity-ui bot commented Feb 10, 2026

Storybook Deployed

@gravity-ui
Copy link

gravity-ui bot commented Feb 10, 2026

🎭 Playwright Report

@makhnatkin
Copy link
Collaborator

@d3m1d0v I suggest using negative margin for the first element and padding for the container

.yfm-line-number {
    margin-left: -2rem;
}
.hljs > div {
    padding-left: 2rem
}
Screenshot 2026-02-10 at 16 18 34 Screenshot 2026-02-10 at 16 18 44

@d3m1d0v d3m1d0v force-pushed the codeblock-linewrapping branch from b424303 to cc6391f Compare February 11, 2026 20:26
@d3m1d0v d3m1d0v force-pushed the codeblock-linewrapping branch from 7b31530 to 46e48ed Compare February 12, 2026 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants