mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-11 07:55:52 +01:00
✨ Add new config format
This commit is contained in:
22
src/components/layout/useCardStyles.ts
Normal file
22
src/components/layout/useCardStyles.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { createStyles } from '@mantine/core';
|
||||
import { useConfigContext } from '../../config/provider';
|
||||
|
||||
export const useCardStyles = () => {
|
||||
const { config } = useConfigContext();
|
||||
const appOpacity = config?.settings.customization.appOpacity;
|
||||
return createStyles(({ colorScheme }, _params) => {
|
||||
const opacity = (appOpacity || 100) / 100;
|
||||
return {
|
||||
card: {
|
||||
backgroundColor:
|
||||
colorScheme === 'dark'
|
||||
? `rgba(37, 38, 43, ${opacity}) !important`
|
||||
: `rgba(255, 255, 255, ${opacity}) !important`,
|
||||
borderColor:
|
||||
colorScheme === 'dark'
|
||||
? `rgba(37, 38, 43, ${opacity})`
|
||||
: `rgba(233, 236, 239, ${opacity})`,
|
||||
},
|
||||
};
|
||||
})();
|
||||
};
|
||||
Reference in New Issue
Block a user