简体   繁体   English

如何在 Svelte Material UI 中圆角按钮

[英]How to round button in Svelte Material UI

I need a circle button using sveltemateriaui.我需要一个使用 sveltmateriaui 的圆形按钮。 There isn't any similar example in https://sveltematerialui.com/demo/button but trying to get it using plain css I've got it this: https://svelte.dev/repl/8cc5be4c6b1245e88aa9a12c7fc550dc?version=3.37.0 is not a circle, is an ellipse. There isn't any similar example in https://sveltematerialui.com/demo/button but trying to get it using plain css I've got it this: https://svelte.dev/repl/8cc5be4c6b1245e88aa9a12c7fc550dc?version=3.37. 0不是圆,是椭圆。

The only way that I got it is to set width and height more than 50 px, but in this case, the button is too large.我得到它的唯一方法是设置宽度和高度超过 50 像素,但在这种情况下,按钮太大了。

How can I get a circle button with icon close centered vertically and horizontally?如何获得带有图标关闭的圆形按钮垂直和水平居中?

I think what you're looking for is a floating action button:我认为您正在寻找的是一个浮动操作按钮:

<Fab variant="raised">
    <Icon class="material-icons">close</Icon>
</Fab>

<script>
  import Fab, { Icon } from '@smui/fab';
</script>

Svelte Material UI docs Svelte Material UI 文档
Example REPL 示例 REPL

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM