深海軍藍文字搭配招牌紫色 Blurple,柔和的大陰影與圓角,適合金融與 SaaS 產品。
Preview
使用 Stripe token 打造的範例元件。
Card
radius-lg · shadow-md
background
#ffffff
foreground
#0a2540
gray-100
#f6f9fc
gray-200
#e3e8ee
gray-400
#adbdcc
gray-600
#425466
gray-900
#0a2540
border
#e3e8ee
primary
#635bff
primary-foreground
#ffffff
accent
#00d4ff
success
#00d924
warning
#ffbb00
error
#df1b41
// =============================================
// Stripe Style Tokens — _tokens.scss
// 漸層紫藍・精緻商務
// =============================================
// ---------- Colors ----------
$color-background: #ffffff;
$color-foreground: #0a2540;
$color-gray-100: #f6f9fc;
$color-gray-200: #e3e8ee;
$color-gray-400: #adbdcc;
$color-gray-600: #425466;
$color-gray-900: #0a2540;
$color-border: #e3e8ee;
$color-primary: #635bff;
$color-primary-foreground: #ffffff;
$color-accent: #00d4ff;
$color-success: #00d924;
$color-warning: #ffbb00;
$color-error: #df1b41;
// ---------- Typography ----------
$font-sans: "Sohne", "Inter", -apple-system, "Segoe UI", sans-serif;
$font-mono: "Source Code Pro", Menlo, monospace;
$font-size-xs: 13px;
$font-size-sm: 15px;
$font-size-base: 17px;
$font-size-lg: 20px;
$font-size-xl: 26px;
$font-size-2xl: 38px;
$font-size-3xl: 56px;
$font-weight-regular: 400;
$font-weight-medium: 500;
$font-weight-semibold: 600;
$font-weight-bold: 700;
// ---------- Radius ----------
$radius-sm: 4px;
$radius-md: 6px;
$radius-lg: 8px;
$radius-xl: 16px;
$radius-full: 9999px;
// ---------- Spacing ----------
$space-0: 0;
$space-1: 4px;
$space-2: 8px;
$space-3: 12px;
$space-4: 16px;
$space-5: 24px;
$space-6: 32px;
$space-7: 48px;
$space-8: 64px;
// ---------- Shadows ----------
$shadow-sm: 0 2px 5px -1px rgba(50, 50, 93, 0.25), 0 1px 3px -1px rgba(0, 0, 0, 0.3);
$shadow-md: 0 13px 27px -5px rgba(50, 50, 93, 0.25), 0 8px 16px -8px rgba(0, 0, 0, 0.3);
$shadow-lg: 0 30px 60px -12px rgba(50, 50, 93, 0.25), 0 18px 36px -18px rgba(0, 0, 0, 0.3);
// ---------- Motion ----------
$duration: 200ms;
$easing: cubic-bezier(0.25, 1, 0.5, 1);
// ---------- Maps ----------
$colors: (
"background": $color-background,
"foreground": $color-foreground,
"gray-100": $color-gray-100,
"gray-200": $color-gray-200,
"gray-400": $color-gray-400,
"gray-600": $color-gray-600,
"gray-900": $color-gray-900,
"border": $color-border,
"primary": $color-primary,
"primary-foreground": $color-primary-foreground,
"accent": $color-accent,
"success": $color-success,
"warning": $color-warning,
"error": $color-error,
);
$font-sizes: (
"xs": $font-size-xs,
"sm": $font-size-sm,
"base": $font-size-base,
"lg": $font-size-lg,
"xl": $font-size-xl,
"2xl": $font-size-2xl,
"3xl": $font-size-3xl,
);
$radii: (
"sm": $radius-sm,
"md": $radius-md,
"lg": $radius-lg,
"xl": $radius-xl,
"full": $radius-full,
);
$spaces: (
"0": $space-0,
"1": $space-1,
"2": $space-2,
"3": $space-3,
"4": $space-4,
"5": $space-5,
"6": $space-6,
"7": $space-7,
"8": $space-8,
);
$shadows: (
"sm": $shadow-sm,
"md": $shadow-md,
"lg": $shadow-lg,
);
// ---------- Helpers ----------
@function color($name) {
@return map-get($colors, $name);
}
@function space($step) {
@return map-get($spaces, $step);
}
// 將所有 token 輸出為 CSS 自訂屬性
:root {
@each $name, $value in $colors {
--color-#{$name}: #{$value};
}
@each $name, $value in $font-sizes {
--font-size-#{$name}: #{$value};
}
@each $name, $value in $radii {
--radius-#{$name}: #{$value};
}
@each $name, $value in $spaces {
--space-#{$name}: #{$value};
}
@each $name, $value in $shadows {
--shadow-#{$name}: #{$value};
}
--font-sans: #{$font-sans};
--font-mono: #{$font-mono};
}
// ---------- Mixins ----------
@mixin button-primary {
display: inline-flex;
align-items: center;
gap: $space-2;
padding: $space-2 $space-4;
font-family: $font-sans;
font-size: $font-size-sm;
font-weight: $font-weight-medium;
color: $color-primary-foreground;
background: $color-primary;
border: 0;
border-radius: $radius-md;
transition: opacity $duration $easing;
&:hover {
opacity: 0.85;
}
}
@mixin card {
padding: $space-5;
background: $color-background;
border: 1px solid $color-border;
border-radius: $radius-lg;
box-shadow: $shadow-sm;
}