旋转标签-材质UI按钮

时间:2020-03-03 09:24:25

标签: javascript material-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度)。

有人可以帮我吗?谢谢

1 个答案:

答案 0 :(得分:1)

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

然后,您可能还想更改按钮的高度。对于根来说是这样的:

height: 120,
width: 30