From 486bba5bea2395a3b3fbe2e0861489075dfd75cf Mon Sep 17 00:00:00 2001 From: yyh Date: Tue, 10 Nov 2026 18:42:40 +0800 Subject: [PATCH] fix(billing): theme pricing cards and align action spacing (cherry picked from commit 23b6abf235bc94401c51ccf9f0bece734223511c) --- .../billing/pricing/dialog-content.tsx | 2 +- web/app/components/billing/pricing/footer.tsx | 2 +- web/app/components/billing/pricing/header.tsx | 9 +- .../pricing/plans/cloud-plan-item/index.tsx | 45 +++++----- .../billing/pricing/pricing.module.css | 82 +++++++++++++------ web/public/pricing/logo-dark.svg | 36 ++++++++ 6 files changed, 128 insertions(+), 48 deletions(-) create mode 100644 web/public/pricing/logo-dark.svg diff --git a/web/app/components/billing/pricing/dialog-content.tsx b/web/app/components/billing/pricing/dialog-content.tsx index ec0a3901ed4..843f7fa878f 100644 --- a/web/app/components/billing/pricing/dialog-content.tsx +++ b/web/app/components/billing/pricing/dialog-content.tsx @@ -21,7 +21,7 @@ export function PricingDialogContent() { return ( <> - + diff --git a/web/app/components/billing/pricing/header.tsx b/web/app/components/billing/pricing/header.tsx index 0db3428aa69..516399a1df5 100644 --- a/web/app/components/billing/pricing/header.tsx +++ b/web/app/components/billing/pricing/header.tsx @@ -8,7 +8,14 @@ export default function Header() { return (
- Dify + Dify + Dify Cloud diff --git a/web/app/components/billing/pricing/plans/cloud-plan-item/index.tsx b/web/app/components/billing/pricing/plans/cloud-plan-item/index.tsx index 9d8041a854b..45848980b2f 100644 --- a/web/app/components/billing/pricing/plans/cloud-plan-item/index.tsx +++ b/web/app/components/billing/pricing/plans/cloud-plan-item/index.tsx @@ -215,25 +215,32 @@ export function CloudPlanItem({ plan, billingInterval, billing }: CloudPlanItemP )}
- {showPlanButton && ( -
- - {educationDiscountWarningText && ( -
- {educationDiscountWarningText} -
- )} -
- )} +
+ {showPlanButton && ( + <> + + {educationDiscountWarningText && ( +
+ {educationDiscountWarningText} +
+ )} + + )} +
diff --git a/web/app/components/billing/pricing/pricing.module.css b/web/app/components/billing/pricing/pricing.module.css index 1b23fab1b04..1c2cf7190ec 100644 --- a/web/app/components/billing/pricing/pricing.module.css +++ b/web/app/components/billing/pricing/pricing.module.css @@ -29,16 +29,41 @@ .content { --pricing-ink: #010916; --pricing-muted: #57657a; - --pricing-blue: #0033ff; + --pricing-switch: #e1e2e5; + --pricing-switch-border: #d8dadd; + --pricing-subdued: #959eab; + --pricing-card-border: #cec2b6; + --pricing-button-bg: #f8f7f7; + --pricing-button-border: var(--pricing-muted); + --pricing-feature-border: #f2f3f8; + --pricing-info: #b9bece; position: relative; isolation: isolate; min-height: 100%; padding: 40px 52px 24px; color: var(--pricing-ink); - background: #fff; + background: var(--color-background-default); font-family: PricingSohne, Arial, sans-serif; } +/* Light cards use the website palette. The dark surface uses product theme tokens. */ +:global(html[data-theme='dark']) .content { + --pricing-ink: var(--color-text-primary); + --pricing-muted: var(--color-text-secondary); + --pricing-switch: var(--color-background-section); + --pricing-switch-border: var(--color-divider-regular); + --pricing-subdued: var(--color-text-tertiary); + --pricing-card-border: var(--color-divider-regular); + --pricing-button-bg: var(--color-components-button-secondary-bg); + --pricing-button-border: var(--color-divider-regular); + --pricing-feature-border: var(--color-divider-subtle); + --pricing-info: var(--color-text-quaternary); +} + +:global(html[data-theme='dark']) .content::before { + content: none; +} + .content::before { position: absolute; inset: 0; @@ -63,7 +88,7 @@ } .description { margin-top: 3px; - color: #676f83; + color: var(--color-text-tertiary); font-family: PricingInter, sans-serif; font-size: 16px; line-height: 24px; @@ -83,9 +108,9 @@ margin: 32px auto; gap: 0; padding: 4px; - border: 1px solid #d8dadd; + border: 1px solid var(--pricing-switch-border); border-radius: 100px; - background: #e1e2e5; + background: var(--pricing-switch); } .intervalOption { display: flex; @@ -96,22 +121,22 @@ min-width: 190px; padding: 4px 24px; border-radius: 100px; - color: #959eab; + color: var(--pricing-subdued); font-size: 24px; line-height: 30px; font-weight: 500; cursor: pointer; } .intervalOption[data-checked] { - background: white; + background: var(--color-components-button-secondary-bg); color: var(--pricing-ink); } .intervalOption:focus-visible { - outline: 2px solid var(--pricing-blue); + outline: 2px solid var(--color-text-accent); outline-offset: 3px; } .savings { - color: var(--pricing-blue); + color: var(--color-text-accent); font-family: PricingInter, sans-serif; font-size: 20px; font-weight: 600; @@ -125,9 +150,9 @@ min-width: 0; min-height: 750px; padding: 40px 23px 44px; - border: 1px solid #cec2b6; + border: 1px solid var(--pricing-card-border); border-radius: 16px; - background: white; + background: var(--color-background-default); } .cardHeader { display: flex; @@ -160,8 +185,9 @@ line-height: 15px; font-weight: 600; text-transform: uppercase; - background: var(--pricing-blue); - color: white; + border-radius: 4px; + background: var(--color-state-accent-hover-alt); + color: var(--color-text-accent); } .planDescription { position: relative; @@ -186,26 +212,30 @@ font-weight: 500; } .card[data-plan='professional'] .priceAmount { - color: var(--pricing-blue); + color: var(--color-text-primary); } .priceSuffix { font-size: 20px; line-height: 25px; } .originalPrice { - color: #959eab; + color: var(--pricing-subdued); font-size: 20px; line-height: 25px; text-decoration: line-through; } +.actionSlot { + position: relative; + min-height: 60px; +} .planButton { width: 100%; min-height: 60px; height: auto; padding: 12px; - border: 1px solid var(--pricing-muted); + border: 1px solid var(--pricing-button-border); border-radius: 8px; - background: #f8f7f7; + background: var(--pricing-button-bg); color: var(--pricing-muted); font-family: inherit; font-size: 24px; @@ -215,15 +245,15 @@ box-shadow: none; } .planButton:not(:disabled):hover { - background: #eee; + background: var(--color-components-button-secondary-bg-hover); } -.planButton[data-plan='professional'] { - border-color: var(--pricing-blue); - background: var(--pricing-blue); +.planButton[data-promoted] { + border-color: var(--color-saas-dify-blue-static); + background: var(--color-saas-dify-blue-static); color: white; } -.planButton[data-plan='professional']:not(:disabled):hover { - background: #0029cc; +.planButton[data-promoted]:not(:disabled):hover { + background: var(--color-saas-dify-blue-static-hover); } .planButton:disabled { cursor: default; @@ -240,7 +270,7 @@ gap: 6px; min-height: 20px; padding-bottom: 2px; - border-bottom: 1px solid #f2f3f8; + border-bottom: 1px solid var(--pricing-feature-border); font-size: 14px; line-height: 17px; } @@ -248,7 +278,7 @@ flex: none; width: 4px; height: 7px; - background: radial-gradient(circle at 2px 5px, var(--pricing-blue) 2px, transparent 2px); + background: radial-gradient(circle at 2px 5px, var(--color-text-accent) 2px, transparent 2px); } .featureLabel { flex: 1; @@ -260,7 +290,7 @@ width: 18px; height: 18px; margin: -4px; - color: #b9bece; + color: var(--pricing-info); } .footer { display: flex; diff --git a/web/public/pricing/logo-dark.svg b/web/public/pricing/logo-dark.svg new file mode 100644 index 00000000000..16d169e6de9 --- /dev/null +++ b/web/public/pricing/logo-dark.svg @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + +