From 2fcb30ac20064b28aab941039e404b3db06b07d8 Mon Sep 17 00:00:00 2001 From: Ricco Xie Date: Tue, 7 Mar 2023 18:08:16 +0800 Subject: [PATCH] feat: button component add light variant style. --- apps/experiments/src/index.html | 12 +++++++++++- apps/website/pages/docs/components/button.en.mdx | 15 +++++++++++++++ apps/website/pages/docs/components/button.zh.mdx | 15 +++++++++++++++ packages/tailwind/src/style/components/button.css | 15 +++++++++++++++ 4 files changed, 56 insertions(+), 1 deletion(-) diff --git a/apps/experiments/src/index.html b/apps/experiments/src/index.html index 20da83e..e9294b9 100644 --- a/apps/experiments/src/index.html +++ b/apps/experiments/src/index.html @@ -93,7 +93,7 @@

Colors

danger-1100
-
+

Button

Colors

@@ -125,6 +125,16 @@

Ghost

+
+

Light

+
+ + + + + +
+

Sizes

diff --git a/apps/website/pages/docs/components/button.en.mdx b/apps/website/pages/docs/components/button.en.mdx index 2540e31..3a013e0 100644 --- a/apps/website/pages/docs/components/button.en.mdx +++ b/apps/website/pages/docs/components/button.en.mdx @@ -9,6 +9,7 @@ Button colors.
+ @@ -26,6 +27,7 @@ Button colors.
+ @@ -37,12 +39,25 @@ Button colors.
+
+### Light + + +
+ + + + + +
+
+ ### Sizes diff --git a/apps/website/pages/docs/components/button.zh.mdx b/apps/website/pages/docs/components/button.zh.mdx index b6436c3..f92ea13 100644 --- a/apps/website/pages/docs/components/button.zh.mdx +++ b/apps/website/pages/docs/components/button.zh.mdx @@ -7,6 +7,7 @@ import { CodeDemo } from '../../../components/demo/code';
+ @@ -24,6 +25,7 @@ import { CodeDemo } from '../../../components/demo/code';
+ @@ -35,12 +37,25 @@ import { CodeDemo } from '../../../components/demo/code';
+
+### 轻量按钮 + + +
+ + + + + +
+
+ ### 尺寸 diff --git a/packages/tailwind/src/style/components/button.css b/packages/tailwind/src/style/components/button.css index 358cdbc..7e240b2 100644 --- a/packages/tailwind/src/style/components/button.css +++ b/packages/tailwind/src/style/components/button.css @@ -49,6 +49,21 @@ color: rgba(var(--sira-color-800-contrast), var(--tw-text-opacity)); } +/* light */ +.btn.light { + --tw-ring-color: rgba(var(--sira-color-200), var(--tw-ring-opacity)); + --tw-bg-opacity: 1; + background-color: rgba(var(--sira-color-200), var(--tw-bg-opacity)); + --tw-text-opacity: 1; + color: rgba(var(--sira-color-900), var(--tw-text-opacity)); + @apply border-none; +} + +.btn.light:hover { + background-color: rgba(var(--sira-color-300), var(--tw-bg-opacity)); + color: rgba(var(--sira-color-1000), var(--tw-text-opacity)); +} + /* Button Sizes */ .btn.xs { @apply h-[1.5rem] min-h-[1.5rem] rounded-[7px] px-2 text-[0.5rem] leading-[0.5rem] font-normal;