-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial commit for the project settings feature
- Loading branch information
Showing
4 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
packages/volto-light-theme/src/components/Theming/Theming.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import React from 'react'; | ||
import BodyClass from '@plone/volto/helpers/BodyClass/BodyClass'; | ||
import Helmet from '@plone/volto/helpers/Helmet/Helmet'; | ||
import config from '@plone/volto/registry'; | ||
|
||
const Theming = ({ content }) => { | ||
const theme = content.theme || true; | ||
const color1 = content.color1 || 'red'; | ||
const color2 = content.color2; | ||
const color3 = content.color3; | ||
const color4 = content.color4; | ||
|
||
return ( | ||
<> | ||
{theme ? ( | ||
<> | ||
{/* <BodyClass className={isSubsite ? 'is-subsite' : null}></BodyClass> */} | ||
<BodyClass className={theme ? `theme--${theme}` : null}></BodyClass> | ||
|
||
{theme && ( | ||
<Helmet> | ||
<style>{` | ||
:root { | ||
--custom-theme-color1: ${color1}; | ||
--custom-theme-color2: ${color2}; | ||
--custom-theme-color3: ${color3}; | ||
--custom-theme-color4: ${color4}; | ||
} | ||
`}</style> | ||
</Helmet> | ||
)} | ||
</> | ||
) : null} | ||
</> | ||
); | ||
}; | ||
|
||
export default Theming; |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import type { ConfigType } from '@plone/registry'; | ||
import Theming from '../components/Theming/Theming'; | ||
|
||
export default function install(config: ConfigType) { | ||
config.registerSlotComponent({ | ||
slot: 'aboveContent', | ||
name: 'Theming', | ||
component: Theming, | ||
}); | ||
|
||
return config; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters