mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-11 16:05:47 +01:00
✨ Add option for custom CSS to Customization Settings
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { TextInput, Button, Stack } from '@mantine/core';
|
import { TextInput, Button, Stack, Textarea } from '@mantine/core';
|
||||||
import { useForm } from '@mantine/form';
|
import { useForm } from '@mantine/form';
|
||||||
import { useTranslation } from 'next-i18next';
|
import { useTranslation } from 'next-i18next';
|
||||||
import { useConfig } from '../../tools/state';
|
import { useConfig } from '../../tools/state';
|
||||||
@@ -25,6 +25,7 @@ export default function TitleChanger() {
|
|||||||
logo?: string;
|
logo?: string;
|
||||||
favicon?: string;
|
favicon?: string;
|
||||||
background?: string;
|
background?: string;
|
||||||
|
customCSS?: string;
|
||||||
}) => {
|
}) => {
|
||||||
setConfig({
|
setConfig({
|
||||||
...config,
|
...config,
|
||||||
@@ -34,6 +35,7 @@ export default function TitleChanger() {
|
|||||||
logo: values.logo,
|
logo: values.logo,
|
||||||
favicon: values.favicon,
|
favicon: values.favicon,
|
||||||
background: values.background,
|
background: values.background,
|
||||||
|
customCSS: values.customCSS,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -62,6 +64,12 @@ export default function TitleChanger() {
|
|||||||
placeholder={t('background.placeholder')}
|
placeholder={t('background.placeholder')}
|
||||||
{...form.getInputProps('background')}
|
{...form.getInputProps('background')}
|
||||||
/>
|
/>
|
||||||
|
<Textarea
|
||||||
|
minRows={5}
|
||||||
|
label="Custom CSS"
|
||||||
|
placeholder="Your CSS will be executed last"
|
||||||
|
{...form.getInputProps('customCSS')}
|
||||||
|
/>
|
||||||
<Button type="submit">{t('buttons.submit')}</Button>
|
<Button type="submit">{t('buttons.submit')}</Button>
|
||||||
</Stack>
|
</Stack>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -34,6 +34,9 @@ export default function Layout({ children, style }: any) {
|
|||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</main>
|
</main>
|
||||||
|
<style>
|
||||||
|
{cx(config.settings.customCSS)}
|
||||||
|
</style>
|
||||||
</AppShell>
|
</AppShell>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ export interface Settings {
|
|||||||
secondaryColor?: MantineTheme['primaryColor'];
|
secondaryColor?: MantineTheme['primaryColor'];
|
||||||
primaryShade?: MantineTheme['primaryShade'];
|
primaryShade?: MantineTheme['primaryShade'];
|
||||||
background?: string;
|
background?: string;
|
||||||
|
customCSS?: string,
|
||||||
appOpacity?: number;
|
appOpacity?: number;
|
||||||
widgetPosition?: string;
|
widgetPosition?: string;
|
||||||
appCardWidth?: number;
|
appCardWidth?: number;
|
||||||
|
|||||||
Reference in New Issue
Block a user