Add colors to the website and calculate text color for background colors
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
---
|
||||
import '@/styles/global.css';
|
||||
import { getSettings } from "@/content/settings/settings";
|
||||
import { getTextColor } from '@/lib/colors';
|
||||
|
||||
interface Props {
|
||||
settings: BlogLayoutProps;
|
||||
@@ -11,7 +12,11 @@ const settings = await getSettings();
|
||||
|
||||
const css = {
|
||||
"--ptc": settings.website.colors.primary,
|
||||
"--stc": settings.website.colors.secondary ?? settings.website.colors.primary
|
||||
"--stc": settings.website.colors.secondary ?? settings.website.colors.primary,
|
||||
"--ptt": getTextColor(settings.website.colors.primary),
|
||||
"--stt": settings.website.colors.secondary
|
||||
? getTextColor(settings.website.colors.secondary)
|
||||
: getTextColor(settings.website.colors.primary)
|
||||
};
|
||||
---
|
||||
|
||||
@@ -72,7 +77,7 @@ const css = {
|
||||
|
||||
<!-- Scripts and Style -->
|
||||
</head>
|
||||
<body style={ css }>
|
||||
<body style={ css } class="bg-[#fcfcfc]">
|
||||
<slot name="content" />
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,6 +1,7 @@
|
||||
---
|
||||
import '@/styles/global.css';
|
||||
import { getSettings } from "@/content/settings/settings";
|
||||
import { getTextColor } from '@/lib/colors';
|
||||
|
||||
interface Props {
|
||||
settings: BlogLayoutProps;
|
||||
@@ -11,7 +12,11 @@ const settings = await getSettings();
|
||||
|
||||
const css = {
|
||||
"--ptc": settings.website.colors.primary,
|
||||
"--stc": settings.website.colors.secondary ?? settings.website.colors.primary
|
||||
"--stc": settings.website.colors.secondary ?? settings.website.colors.primary,
|
||||
"--ptt": getTextColor(settings.website.colors.primary),
|
||||
"--stt": settings.website.colors.secondary
|
||||
? getTextColor(settings.website.colors.secondary)
|
||||
: getTextColor(settings.website.colors.primary)
|
||||
};
|
||||
---
|
||||
|
||||
@@ -72,7 +77,7 @@ const css = {
|
||||
|
||||
<!-- Scripts and Style -->
|
||||
</head>
|
||||
<body style={ css }>
|
||||
<body style={ css } class="bg-[#fcfcfc]">
|
||||
<slot name="content" />
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,6 +1,7 @@
|
||||
---
|
||||
import '@/styles/global.css';
|
||||
import { getSettings } from "@/content/settings/settings";
|
||||
import { getTextColor } from '@/lib/colors';
|
||||
|
||||
interface Props {
|
||||
settings: WebpageLayoutProps;
|
||||
@@ -11,7 +12,11 @@ const settings = await getSettings();
|
||||
|
||||
const css = {
|
||||
"--ptc": settings.website.colors.primary,
|
||||
"--stc": settings.website.colors.secondary ?? settings.website.colors.primary
|
||||
"--stc": settings.website.colors.secondary ?? settings.website.colors.primary,
|
||||
"--ptt": getTextColor(settings.website.colors.primary),
|
||||
"--stt": settings.website.colors.secondary
|
||||
? getTextColor(settings.website.colors.secondary)
|
||||
: getTextColor(settings.website.colors.primary)
|
||||
};
|
||||
---
|
||||
|
||||
@@ -69,7 +74,7 @@ const css = {
|
||||
|
||||
<!-- Scripts and Style -->
|
||||
</head>
|
||||
<body style={ css }>
|
||||
<body style={ css } class="bg-[#fcfcfc]">
|
||||
<slot name="content" />
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user