Skip to content

Commit

Permalink
Adding class
Browse files Browse the repository at this point in the history
  • Loading branch information
benazeer-ben committed Jan 21, 2025
1 parent 0c5f70d commit 46873a0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
10 changes: 7 additions & 3 deletions packages/block-library/src/table-of-contents/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,14 @@ export default function TableOfContentsEdit( {
>
<ToolsPanelItem
hasValue={ () => !! title }
label={ __( 'Title' ) }
label={ __( 'HEADING TEXT' ) }
onDeselect={ () => setAttributes( { title: '' } ) }
isShownByDefault
>
<TextControl
__next40pxDefaultSize
__nextHasNoMarginBottom
label={ __( 'Title' ) }
label={ __( 'HEADING TEXT' ) }
value={ title }
help={ __(
'Set the heading text of the block. Default value: Table of Contents'
Expand Down Expand Up @@ -193,7 +193,11 @@ export default function TableOfContentsEdit( {
return (
<>
<nav { ...blockProps }>
{ title && <h2>{ title }</h2> }
{ title && (
<h2 className="wp-block-table-of-contents__title">
{ title }
</h2>
) }
<ol>
<TableOfContentsList
nestedHeadingList={ headingTree }
Expand Down
4 changes: 3 additions & 1 deletion packages/block-library/src/table-of-contents/save.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ export default function save( { attributes: { headings = [], title } } ) {
}
return (
<nav { ...useBlockProps.save() }>
{ title && <h2>{ title }</h2> }
{ title && (
<h2 className="wp-block-table-of-contents__title">{ title }</h2>
) }
<ol>
<TableOfContentsList
nestedHeadingList={ linearToNestedHeadingList( headings ) }
Expand Down

0 comments on commit 46873a0

Please sign in to comment.