Skip to content
This repository has been archived by the owner on Sep 13, 2024. It is now read-only.

Commit

Permalink
feat: move classic theme fix to css
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasguillot committed Jun 26, 2024
1 parent a0fc682 commit 841b71a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
1 change: 0 additions & 1 deletion assets/css/frontend/components/tabs.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

.tab-list {
display: flex;
flex-wrap: wrap;
font-family: var(--newspack-ui-font-family, system-ui, sans-serif);
font-size: var(--newspack-ui-font-size-s, 16px);
font-weight: 600;
Expand Down
6 changes: 0 additions & 6 deletions includes/blocks/block-editor/tabs/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,6 @@ const TabsEdit = (props) => {
if (tabHeader && tabHeaderButton) {
tabHeader.style.left = `${tabHeaderButton.offsetLeft}px`;
tabHeader.style.top = `-${tabHeader.offsetHeight + 24}px`;

// For some reason with the Classic Theme, if tabHeader is empty we're 4px off.
if ( document.body.classList.contains('theme-newspack-theme/newspack-theme') && tabHeader.querySelector( 'span' ) ) {
tabHeader.style.top = `-${tabHeader.offsetHeight + 28}px`;
}

}
});
});
Expand Down
10 changes: 10 additions & 0 deletions includes/blocks/block-editor/tabs/editor.css
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,14 @@

.wp-block[data-type="newspack/tabs-item"] + .block-list-appender {
display: none !important;
}

body[class*="theme-newspack-theme/newspack-theme"] {
& .wp-block[data-type="newspack/tabs"] {
& .tab-header {
& .rich-text:has( span ) {
top: -4px;
}
}
}
}

0 comments on commit 841b71a

Please sign in to comment.