@mui/material/styles#Theme TypeScript Examples
The following examples show how to use
@mui/material/styles#Theme.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AppBar.tsx From react-component-library with BSD 3-Clause "New" or "Revised" License | 6 votes |
useStyles = makeStyles((theme: Theme) =>
createStyles({
root: {
overflow: 'hidden',
transition: (props: AppBarProps): string =>
theme.transitions.create(['height'], {
duration: props.animationDuration || theme.transitions.duration.standard,
easing: theme.transitions.easing.easeInOut,
}),
},
background: {
position: 'absolute',
zIndex: -1,
width: '100%',
backgroundSize: 'cover',
height: '100%',
opacity: 0.3,
backgroundPosition: 'center bottom',
backgroundImage: (props: AppBarProps): string => `url(${props.backgroundImage})`,
transition: (props: AppBarProps): string =>
theme.transitions.create(['all'], {
duration: props.animationDuration || theme.transitions.duration.standard,
easing: theme.transitions.easing.easeInOut,
}),
},
expanded: {},
collapsed: {},
expandedBackground: {},
})
)
Example #2
Source File: index.tsx From houston with MIT License | 6 votes |
Header = React.memo(() => {
const { currentStep, title, stepCounter, steps, size, handleClose } = useShowcaseContext();
const classes = useStyles({ size });
const isMobile = useMediaQuery<Theme>(theme => theme.breakpoints.down('xs'));
if (!title) return null;
return (
<Typography className={classes.header} size='xs'>
<span className='header-title'>{title.children}</span>
{size !== 'small' && !isMobile && stepCounter && (
<span>
{currentStep}/{steps.length}
</span>
)}
{(size === 'small' || isMobile) && (
<ButtonIcon id='modal-default-close' onClick={handleClose} size='small'>
<CancelIcon className='close-icon' size={18} />
</ButtonIcon>
)}
</Typography>
);
})
Example #3
Source File: BackLink.tsx From console with GNU Affero General Public License v3.0 | 6 votes |
styles = (theme: Theme) =>
createStyles({
label: {
lineHeight: 1,
alignItems: "center",
paddingTop: 1,
fontSize: "14px",
fontWeight: 600,
color: theme.palette.primary.light,
marginRight: "10px",
},
})