我正在使用MUI中CSS的makestyle方法,现在我想要一些如果其他条件为暗和光模式的
const useStyles =makeStyles(主题=> ({
titleNew: {
color: theme.palette.text.primary,
marginBottom: '8px',
fontSize:"14px"
// if mode is light then font size 14px if modeis dark then fontsize 18px
},
subtitleNew: {
我按照教程为我的表添加页面分页,现在浏览器中出现了以下错误:
Uncaught TypeError: Cannot read property 'main' of undefined
at ButtonRoot.ownerState.ownerState (Button.js:80)
at transformedStyleArg (createStyled.js:189)
at handleInterpolation (emotion-serialize.browser.esm.js:137)
at serializeStyles (emo
我试图升级材料v5(来自v4)。根据,建议使用样式或sx,但我想使用makeStyles方法,就像在v4中一样。即使在v5中不推荐使用它,但也可以使用它(按照)。但是我无法在makeStyles回调函数中获得主题变量,导致无法访问未定义的属性(例如。theme.breakpoints.between...)
import makeStyles from '@mui/styles/makeStyles';
const useStyles = makeStyles((theme) => ({
// here theme variable is undefined
a
我正在从MUI导入Card组件,但该组件没有任何样式。 import * as React from "react";
import Box from "@mui/material/Box";
import Card from "@mui/material/Card";
import CardActions from "@mui/material/CardActions";
import CardContent from "@mui/material/CardContent";
import Button fro
我有一个自定义的MUI 5组件库NPM包,它导出一些用MUI 5构建的基本组件,导出主题文件,并将主题提供程序封装到可重用组件中,如下所示:
import { ThemeProvider } from 'styled-components';
import { StyledEngineProvider } from '@mui/material/styles';
import { theme as defaultTheme } from './theme';
function CustomThemeProvider(props: {
the
我正在使用react应用程序和使用资料-ui v5,我被困在这个错误上,theme.spacing不起作用。
import { makeStyles } from "@material-ui/styles";
import React from "react";
import Drawer from "@mui/material/Drawer";
import Typography from "@mui/material/Typography";
import List from "@mui/material/List