From d041ee7df378c527072eced6deaf3d3a85d306ed Mon Sep 17 00:00:00 2001 From: lingbopro Date: Sun, 29 Dec 2024 11:51:50 +0800 Subject: [PATCH] feat(button): add start & end slot support --- demos/components/button.html | 20 ++++++++++++++++++++ src/components/button/button.css | 11 +++++++++++ src/components/button/button.html | 2 ++ 3 files changed, 33 insertions(+) diff --git a/demos/components/button.html b/demos/components/button.html index a549fc3..b91700b 100644 --- a/demos/components/button.html +++ b/demos/components/button.html @@ -9,6 +9,7 @@ @@ -22,6 +23,25 @@

Button

Outlined button Text button +
+ + + + + + + With icon in slot + + + + + + +
diff --git a/src/components/button/button.css b/src/components/button/button.css index 6066fa4..dbde42d 100644 --- a/src/components/button/button.css +++ b/src/components/button/button.css @@ -45,3 +45,14 @@ background-color: initial; padding: 10px 14px; } +::slotted(mm-icon) { + width: 18px; +} +::slotted([slot='start']) { + margin-left: -8px; + margin-right: 8px; +} +::slotted([slot='end']) { + margin-left: 8px; + margin-right: -8px; +} diff --git a/src/components/button/button.html b/src/components/button/button.html index 9b4fa0a..c0d4e03 100644 --- a/src/components/button/button.html +++ b/src/components/button/button.html @@ -1,2 +1,4 @@ + +