-
I want to add toggle button in table of contents. when user click on button or heading then toc will toggle and show the contents of table. and when user again click on heading then again table will toggle and all toc contents will be hide.
I have try this below code but its not working properly in generatepress theme
.wp-block-rank-math-toc-block {
position: relative;
}.wp-block-rank-math-toc-block h2 {
background: #f7dab7;
padding: 10px 12px 10px 18px;
cursor: pointer;
font-size: 18px !important;
font-weight: normal !important;
position: relative;
margin-bottom: 0;
}.wp-block-rank-math-toc-block h2:before {
display: inline-block;
content: "";
width: 0;
height: 0;
border-style: solid;
border-width: 6px 0px 6px 12px;
border-color: transparent transparent transparent #000000;
margin-right: 8px;
transition: all linear .3s;
}.wp-block-rank-math-toc-block h2.active:before {
transform: rotate(90deg);
}.wp-block-rank-math-toc-block nav {
padding: 10px 10px 0px 10px;
max-height: 0;
overflow: hidden;
transition: all linear .3s;
}.wp-block-rank-math-toc-block input:checked + h2 ~ nav {
max-height: 100vh;
overflow: visible;
}
The ticket ‘Rankmath Table Of Contents Style’ is closed to new replies.