首页 > 解决方案 > 旋转标签 - 材质 UI 按钮

问题描述

我有一个像这样的按钮(material-ui):

//theme.js
export const XButtonTop = withStyles({
  root: {
    borderColor: medium_col,
    borderRadius: 1,
    borderTopLeftRadius: 16,
    borderTopRightRadius: 16,
    height: 28
  },
  label: {
    textTransform: "uppercase",
    fontSize: "10px"
  }
})(Button);

//App.js
import {
  XButtonTop
} from "../theme";

const Selector = state => {
return (
<div>
  <XButtonTop fullWidth size="small" disableElevation>
  )
  </XButtonTop>
</div>
)
}

我需要旋转标签(90 度)。

有人能帮助我吗?谢谢

标签: javascriptmaterial-ui

解决方案


label: {
    textTransform: 'capitalize',
    transform: 'rotate(-90deg)',
  }

然后你可能也想改变按钮的高度。像这样的根:

height: 120,
width: 30

推荐阅读