github-actions
released this
10 May 09:38
·
534 commits
to main
since this release
Minor Changes
-
b796c3f: Removes
LineHighlights
component in favor of simpler CSS approach for highlighting lines. -
cccf278: Renames
CodeBlock
lineHighlights
prop tohighlightedLines
.Breaking Changes
CodeBlock
lineHighlights
prop has been renamed tohighlightedLines
.
-
044d1ca: Renames
CodeBlock
toolbar
prop toshowToolbar
.Breaking Changes
CodeBlock
toolbar
prop has been renamed toshowToolbar
.
-
dfa9384: Fixes
CodeBlock
accessibility and markup by swappingdiv
s withspan
s and using acode
element around tokens. -
564806a: Renames
CodeBlock
lineNumbers
prop toshowLineNumbers
.Breaking Changes
CodeBlock
lineNumbers
prop has been renamed toshowLineNumbers
.
-
bd646c4: Adds
focusedLines
andunfocusedLinesOpacity
props to theCodeBlock
component to control focusing a set of lines and dimming the other lines. It uses an image mask to dim out the lines which can be controlled usingunfocusedLinesOpacity
:```tsx focusedLines="3-4" const a = 1; const b = 2; const result = a + b; console.log(result); // 3 ```
<CodeBlock value={`const a = 1;\nconst b = 2;\n\nconst add = a + b\nconst subtract = a - b`} focusedLines="2, 4" />
Patch Changes
- a02b1d8: Fixes copy button overlapping
CodeBlock
content by only showing the button when hovering the code block. The button now also sticks to the top right of the code block when scrolling.