Skip to content

Commit

Permalink
Move theming to top and remove duplicate theming
Browse files Browse the repository at this point in the history
  • Loading branch information
cagataycivici committed Aug 26, 2023
1 parent 758e3c0 commit 421d275
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 385 deletions.
16 changes: 4 additions & 12 deletions pages/_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,9 @@ export default function MyApp({ Component }) {
}
}, []);

/*useEffect(() => {
DomHandler.addClass(document.body, dark ? 'layout-dark' : 'layout-light');
return () => {
DomHandler.removeMultipleClasses(document.body, 'layout-dark layout-light');
};
}, [dark]);*/
useEffect(() => {
document.documentElement.dataset.pfTheme = dark ? 'primeone-dark' : 'primeone-light';
}, [dark]);

let content;

Expand All @@ -76,9 +72,5 @@ export default function MyApp({ Component }) {
);
}

return (
<div className={classNames('app', { 'app-news-active': props.newsActive })} data-pf-theme={theme}>
{content}
</div>
);
return <div className={classNames('app', { 'app-news-active': props.newsActive })}>{content}</div>;
}
22 changes: 20 additions & 2 deletions styles/layout/_docsearch.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
transition: border-color 0.3s;
height: 3rem;
padding: 0 0.75rem;
font-family: var(--font-family);
font-family: Inter;

&:hover {
border-color: var(--primary-color);
Expand Down Expand Up @@ -39,7 +39,7 @@
top: 0;
border-radius: 0;
height: auto;
font-family: var(--font-family);
font-family: Inter;
width: auto;

&:first-child {
Expand Down Expand Up @@ -125,3 +125,21 @@
.DocSearch-Prefill {
color: var(--primary-color);
}

:root {
--docsearch-searchbox-focus-background: var(--surface-card);
--docsearch-text-color: var(--text-color);
--docsearch-muted-color: var(--text-color);
--docsearch-searchbox-background: var(--surface-card);
--docsearch-text-color: var(--text-color);
--docsearch-modal-background: var(--surface-overlay);
--docsearch-key-gradient: var(--surface-ground);
--docsearch-key-shadow: none;
--docsearch-container-background: var(--maskbg);
--docsearch-hit-background: var(--surface-overlay);
--docsearch-hit-shadow: none;
--docsearch-spacing: 1rem;
--docsearch-hit-color: var(--text-color);
--docsearch-highlight-color: var(--primary-color);
--docsearch-hit-active-color: var(--primary-color-text);
}
184 changes: 0 additions & 184 deletions styles/layout/_layout_dark.scss

This file was deleted.

Loading

0 comments on commit 421d275

Please sign in to comment.