mirror of
https://github.com/inventree/InvenTree.git
synced 2025-08-10 05:40:55 +00:00
reformat global state
This commit is contained in:
@@ -1,184 +0,0 @@
|
|||||||
import { createStyles, rem } from '@mantine/core';
|
|
||||||
|
|
||||||
export const InvenTreeStyle = createStyles((theme) => ({
|
|
||||||
layoutHeader: {
|
|
||||||
paddingTop: theme.spacing.sm,
|
|
||||||
backgroundColor:
|
|
||||||
theme.colorScheme === 'dark'
|
|
||||||
? theme.colors.dark[6]
|
|
||||||
: theme.colors.gray[0],
|
|
||||||
borderBottom: `1px solid ${
|
|
||||||
theme.colorScheme === 'dark' ? 'transparent' : theme.colors.gray[2]
|
|
||||||
}`,
|
|
||||||
marginBottom: 10
|
|
||||||
},
|
|
||||||
|
|
||||||
layoutFooter: {
|
|
||||||
marginTop: 10,
|
|
||||||
borderTop: `1px solid ${
|
|
||||||
theme.colorScheme === 'dark' ? theme.colors.dark[5] : theme.colors.gray[2]
|
|
||||||
}`
|
|
||||||
},
|
|
||||||
|
|
||||||
layoutHeaderSection: {
|
|
||||||
paddingBottom: theme.spacing.sm
|
|
||||||
},
|
|
||||||
|
|
||||||
layoutHeaderUser: {
|
|
||||||
color: theme.colorScheme === 'dark' ? theme.colors.dark[0] : theme.black,
|
|
||||||
padding: `${theme.spacing.xs}px ${theme.spacing.sm}px`,
|
|
||||||
borderRadius: theme.defaultRadius,
|
|
||||||
transition: 'background-color 100ms ease',
|
|
||||||
|
|
||||||
[theme.fn.smallerThan('xs')]: {
|
|
||||||
display: 'none'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
headerDropdownFooter: {
|
|
||||||
backgroundColor:
|
|
||||||
theme.colorScheme === 'dark'
|
|
||||||
? theme.colors.dark[7]
|
|
||||||
: theme.colors.gray[0],
|
|
||||||
margin: `calc(${theme.spacing.md} * -1)`,
|
|
||||||
marginTop: theme.spacing.sm,
|
|
||||||
padding: `${theme.spacing.md} calc(${theme.spacing.md} * 2)`,
|
|
||||||
paddingBottom: theme.spacing.xl,
|
|
||||||
borderTop: `${rem(1)} solid ${
|
|
||||||
theme.colorScheme === 'dark' ? theme.colors.dark[5] : theme.colors.gray[1]
|
|
||||||
}`
|
|
||||||
},
|
|
||||||
|
|
||||||
link: {
|
|
||||||
display: 'flex',
|
|
||||||
alignItems: 'center',
|
|
||||||
height: '100%',
|
|
||||||
paddingLeft: theme.spacing.md,
|
|
||||||
paddingRight: theme.spacing.md,
|
|
||||||
textDecoration: 'none',
|
|
||||||
color: theme.colorScheme === 'dark' ? theme.white : theme.black,
|
|
||||||
fontWeight: 500,
|
|
||||||
fontSize: theme.fontSizes.sm,
|
|
||||||
|
|
||||||
[theme.fn.smallerThan('sm')]: {
|
|
||||||
height: rem(42),
|
|
||||||
display: 'flex',
|
|
||||||
alignItems: 'center',
|
|
||||||
width: '100%'
|
|
||||||
},
|
|
||||||
|
|
||||||
...theme.fn.hover({
|
|
||||||
backgroundColor:
|
|
||||||
theme.colorScheme === 'dark'
|
|
||||||
? theme.colors.dark[6]
|
|
||||||
: theme.colors.gray[0]
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
subLink: {
|
|
||||||
width: '100%',
|
|
||||||
padding: `${theme.spacing.xs} ${theme.spacing.md}`,
|
|
||||||
borderRadius: theme.defaultRadius,
|
|
||||||
|
|
||||||
...theme.fn.hover({
|
|
||||||
backgroundColor:
|
|
||||||
theme.colorScheme === 'dark'
|
|
||||||
? theme.colors.dark[7]
|
|
||||||
: theme.colors.gray[0]
|
|
||||||
}),
|
|
||||||
|
|
||||||
'&:active': theme.activeStyles
|
|
||||||
},
|
|
||||||
|
|
||||||
docHover: {
|
|
||||||
border: `1px dashed `
|
|
||||||
},
|
|
||||||
|
|
||||||
layoutContent: {
|
|
||||||
flex: 1,
|
|
||||||
width: '100%'
|
|
||||||
},
|
|
||||||
|
|
||||||
layoutFooterLinks: {
|
|
||||||
[theme.fn.smallerThan('xs')]: {
|
|
||||||
marginTop: theme.spacing.md
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
layoutFooterInner: {
|
|
||||||
display: 'flex',
|
|
||||||
justifyContent: 'space-between',
|
|
||||||
alignItems: 'center',
|
|
||||||
paddingTop: theme.spacing.xl,
|
|
||||||
paddingBottom: theme.spacing.xl,
|
|
||||||
|
|
||||||
[theme.fn.smallerThan('xs')]: {
|
|
||||||
flexDirection: 'column'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
tabs: {
|
|
||||||
[theme.fn.smallerThan('sm')]: {
|
|
||||||
display: 'none'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
tabsList: {
|
|
||||||
borderBottom: '0 !important',
|
|
||||||
'& > button:first-of-type': {
|
|
||||||
paddingLeft: '0 !important'
|
|
||||||
},
|
|
||||||
|
|
||||||
'& > button:last-of-type': {
|
|
||||||
paddingRight: '0 !important'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
tab: {
|
|
||||||
fontWeight: 500,
|
|
||||||
height: 38,
|
|
||||||
backgroundColor: 'transparent',
|
|
||||||
|
|
||||||
'&:hover': {
|
|
||||||
backgroundColor:
|
|
||||||
theme.colorScheme === 'dark'
|
|
||||||
? theme.colors.dark[5]
|
|
||||||
: theme.colors.gray[1]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
signText: {
|
|
||||||
fontSize: 'xl',
|
|
||||||
fontWeight: 700
|
|
||||||
},
|
|
||||||
|
|
||||||
error: {
|
|
||||||
backgroundColor: theme.colors.gray[0],
|
|
||||||
color: theme.colors.red[6]
|
|
||||||
},
|
|
||||||
|
|
||||||
dashboardItemValue: {
|
|
||||||
fontSize: 24,
|
|
||||||
fontWeight: 700,
|
|
||||||
lineHeight: 1
|
|
||||||
},
|
|
||||||
|
|
||||||
dashboardItemTitle: {
|
|
||||||
fontWeight: 700
|
|
||||||
},
|
|
||||||
|
|
||||||
card: {
|
|
||||||
backgroundColor:
|
|
||||||
theme.colorScheme === 'dark' ? theme.colors.dark[7] : theme.white
|
|
||||||
},
|
|
||||||
|
|
||||||
itemTopBorder: {
|
|
||||||
borderTop: `1px solid ${
|
|
||||||
theme.colorScheme === 'dark' ? theme.colors.dark[4] : theme.colors.gray[2]
|
|
||||||
}`
|
|
||||||
},
|
|
||||||
|
|
||||||
navigationDrawer: {
|
|
||||||
padding: 0
|
|
||||||
}
|
|
||||||
}));
|
|
179
src/frontend/src/main.css.ts
Normal file
179
src/frontend/src/main.css.ts
Normal file
@@ -0,0 +1,179 @@
|
|||||||
|
import { rem } from '@mantine/core';
|
||||||
|
import { style } from '@vanilla-extract/css';
|
||||||
|
|
||||||
|
import { vars } from './theme';
|
||||||
|
|
||||||
|
export const layoutHeader = style({
|
||||||
|
paddingTop: vars.spacing.sm,
|
||||||
|
backgroundColor:
|
||||||
|
theme.colorScheme === 'dark' ? vars.colors.dark[6] : vars.colors.gray[0],
|
||||||
|
borderBottom: `1px solid ${
|
||||||
|
theme.colorScheme === 'dark' ? 'transparent' : vars.colors.gray[2]
|
||||||
|
}`,
|
||||||
|
marginBottom: 10
|
||||||
|
});
|
||||||
|
|
||||||
|
export const layoutFooter = style({
|
||||||
|
marginTop: 10,
|
||||||
|
borderTop: `1px solid ${
|
||||||
|
theme.colorScheme === 'dark' ? vars.colors.dark[5] : vars.colors.gray[2]
|
||||||
|
}`
|
||||||
|
});
|
||||||
|
|
||||||
|
export const layoutHeaderSection = style({
|
||||||
|
paddingBottom: vars.spacing.sm
|
||||||
|
});
|
||||||
|
|
||||||
|
export const layoutHeaderUser = style({
|
||||||
|
color: theme.colorScheme === 'dark' ? vars.colors.dark[0] : vars.black,
|
||||||
|
padding: `${vars.spacing.xs}px ${vars.spacing.sm}px`,
|
||||||
|
borderRadius: vars.defaultRadius,
|
||||||
|
transition: 'background-color 100ms ease',
|
||||||
|
|
||||||
|
[vars.smallerThan('xs')]: {
|
||||||
|
display: 'none'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
export const headerDropdownFooter = style({
|
||||||
|
backgroundColor:
|
||||||
|
theme.colorScheme === 'dark' ? vars.colors.dark[7] : vars.colors.gray[0],
|
||||||
|
margin: `calc(${vars.spacing.md} * -1)`,
|
||||||
|
marginTop: vars.spacing.sm,
|
||||||
|
padding: `${vars.spacing.md} calc(${vars.spacing.md} * 2)`,
|
||||||
|
paddingBottom: vars.spacing.xl,
|
||||||
|
borderTop: `${rem(1)} solid ${
|
||||||
|
theme.colorScheme === 'dark' ? vars.colors.dark[5] : vars.colors.gray[1]
|
||||||
|
}`
|
||||||
|
});
|
||||||
|
|
||||||
|
export const link = style({
|
||||||
|
display: 'flex',
|
||||||
|
alignItems: 'center',
|
||||||
|
height: '100%',
|
||||||
|
paddingLeft: vars.spacing.md,
|
||||||
|
paddingRight: vars.spacing.md,
|
||||||
|
textDecoration: 'none',
|
||||||
|
color: light - dark(vars.white, vars.black),
|
||||||
|
fontWeight: 500,
|
||||||
|
fontSize: vars.fontSizes.sm,
|
||||||
|
|
||||||
|
[vars.smallerThan('sm')]: {
|
||||||
|
height: rem(42),
|
||||||
|
display: 'flex',
|
||||||
|
alignItems: 'center',
|
||||||
|
width: '100%'
|
||||||
|
}
|
||||||
|
|
||||||
|
// ...theme.fn.hover({
|
||||||
|
// backgroundColor:
|
||||||
|
// theme.colorScheme === 'dark'
|
||||||
|
// ? vars.colors.dark[6]
|
||||||
|
// : vars.colors.gray[0]
|
||||||
|
// })
|
||||||
|
});
|
||||||
|
|
||||||
|
export const subLink = style({
|
||||||
|
width: '100%',
|
||||||
|
padding: `${vars.spacing.xs} ${vars.spacing.md}`,
|
||||||
|
borderRadius: vars.defaultRadius,
|
||||||
|
|
||||||
|
// ...theme.fn.hover({
|
||||||
|
// backgroundColor:
|
||||||
|
// theme.colorScheme === 'dark'
|
||||||
|
// ? vars.colors.dark[7]
|
||||||
|
// : vars.colors.gray[0]
|
||||||
|
// })
|
||||||
|
|
||||||
|
'&:active': vars.activeStyles
|
||||||
|
});
|
||||||
|
|
||||||
|
export const docHover = style({
|
||||||
|
border: `1px dashed `
|
||||||
|
});
|
||||||
|
|
||||||
|
export const layoutContent = style({
|
||||||
|
flex: 1,
|
||||||
|
width: '100%'
|
||||||
|
});
|
||||||
|
|
||||||
|
export const layoutFooterLinks = style({
|
||||||
|
[vars.smallerThan('xs')]: {
|
||||||
|
marginTop: vars.spacing.md
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
export const layoutFooterInner = style({
|
||||||
|
display: 'flex',
|
||||||
|
justifyContent: 'space-between',
|
||||||
|
alignItems: 'center',
|
||||||
|
paddingTop: vars.spacing.xl,
|
||||||
|
paddingBottom: vars.spacing.xl,
|
||||||
|
|
||||||
|
[vars.smallerThan('xs')]: {
|
||||||
|
flexDirection: 'column'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
export const tabs = style({
|
||||||
|
[vars.smallerThan('sm')]: {
|
||||||
|
display: 'none'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
export const tabsList = style({
|
||||||
|
borderBottom: '0 !important',
|
||||||
|
'& > button:first-of-type': {
|
||||||
|
paddingLeft: '0 !important'
|
||||||
|
},
|
||||||
|
|
||||||
|
'& > button:last-of-type': {
|
||||||
|
paddingRight: '0 !important'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
export const tab = style({
|
||||||
|
fontWeight: 500,
|
||||||
|
height: 38,
|
||||||
|
backgroundColor: 'transparent',
|
||||||
|
|
||||||
|
'&:hover': {
|
||||||
|
backgroundColor:
|
||||||
|
theme.colorScheme === 'dark' ? vars.colors.dark[5] : vars.colors.gray[1]
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
export const signText = style({
|
||||||
|
fontSize: 'xl',
|
||||||
|
fontWeight: 700
|
||||||
|
});
|
||||||
|
|
||||||
|
export const error = style({
|
||||||
|
backgroundColor: vars.colors.gray[0],
|
||||||
|
color: vars.colors.red[6]
|
||||||
|
});
|
||||||
|
|
||||||
|
export const dashboardItemValue = style({
|
||||||
|
fontSize: 24,
|
||||||
|
fontWeight: 700,
|
||||||
|
lineHeight: 1
|
||||||
|
});
|
||||||
|
|
||||||
|
export const dashboardItemTitle = style({
|
||||||
|
fontWeight: 700
|
||||||
|
});
|
||||||
|
|
||||||
|
export const card = style({
|
||||||
|
backgroundColor:
|
||||||
|
theme.colorScheme === 'dark' ? vars.colors.dark[7] : vars.white
|
||||||
|
});
|
||||||
|
|
||||||
|
export const itemTopBorder = style({
|
||||||
|
borderTop: `1px solid ${
|
||||||
|
theme.colorScheme === 'dark' ? vars.colors.dark[4] : vars.colors.gray[2]
|
||||||
|
}`
|
||||||
|
});
|
||||||
|
|
||||||
|
export const navigationDrawer = style({
|
||||||
|
padding: 0
|
||||||
|
});
|
Reference in New Issue
Block a user