|
| 1 | +/** |
| 2 | + * MCP style variables for the basic-host example. |
| 3 | + * These are passed to apps via hostContext.styles.variables. |
| 4 | + */ |
| 5 | +import type { McpUiStyles } from "@modelcontextprotocol/ext-apps"; |
| 6 | + |
| 7 | +/** |
| 8 | + * MCP App style variables using light-dark() for theme adaptation. |
| 9 | + * Apps receive these and can use them as CSS custom properties. |
| 10 | + */ |
| 11 | +export const HOST_STYLE_VARIABLES: McpUiStyles = { |
| 12 | + // Background colors - using light-dark() for automatic adaptation |
| 13 | + "--color-background-primary": "light-dark(#ffffff, #1a1a1a)", |
| 14 | + "--color-background-secondary": "light-dark(#f5f5f5, #2d2d2d)", |
| 15 | + "--color-background-tertiary": "light-dark(#e5e5e5, #404040)", |
| 16 | + "--color-background-inverse": "light-dark(#1a1a1a, #ffffff)", |
| 17 | + "--color-background-ghost": "light-dark(rgba(255,255,255,0), rgba(26,26,26,0))", |
| 18 | + "--color-background-info": "light-dark(#eff6ff, #1e3a5f)", |
| 19 | + "--color-background-danger": "light-dark(#fef2f2, #7f1d1d)", |
| 20 | + "--color-background-success": "light-dark(#f0fdf4, #14532d)", |
| 21 | + "--color-background-warning": "light-dark(#fefce8, #713f12)", |
| 22 | + "--color-background-disabled": "light-dark(rgba(255,255,255,0.5), rgba(26,26,26,0.5))", |
| 23 | + |
| 24 | + // Text colors |
| 25 | + "--color-text-primary": "light-dark(#1f2937, #f3f4f6)", |
| 26 | + "--color-text-secondary": "light-dark(#6b7280, #9ca3af)", |
| 27 | + "--color-text-tertiary": "light-dark(#9ca3af, #6b7280)", |
| 28 | + "--color-text-inverse": "light-dark(#f3f4f6, #1f2937)", |
| 29 | + "--color-text-ghost": "light-dark(rgba(107,114,128,0.5), rgba(156,163,175,0.5))", |
| 30 | + "--color-text-info": "light-dark(#1d4ed8, #60a5fa)", |
| 31 | + "--color-text-danger": "light-dark(#b91c1c, #f87171)", |
| 32 | + "--color-text-success": "light-dark(#15803d, #4ade80)", |
| 33 | + "--color-text-warning": "light-dark(#a16207, #fbbf24)", |
| 34 | + "--color-text-disabled": "light-dark(rgba(31,41,55,0.5), rgba(243,244,246,0.5))", |
| 35 | + |
| 36 | + // Border colors |
| 37 | + "--color-border-primary": "light-dark(#e5e7eb, #404040)", |
| 38 | + "--color-border-secondary": "light-dark(#d1d5db, #525252)", |
| 39 | + "--color-border-tertiary": "light-dark(#f3f4f6, #374151)", |
| 40 | + "--color-border-inverse": "light-dark(rgba(255,255,255,0.3), rgba(0,0,0,0.3))", |
| 41 | + "--color-border-ghost": "light-dark(rgba(229,231,235,0), rgba(64,64,64,0))", |
| 42 | + "--color-border-info": "light-dark(#93c5fd, #1e40af)", |
| 43 | + "--color-border-danger": "light-dark(#fca5a5, #991b1b)", |
| 44 | + "--color-border-success": "light-dark(#86efac, #166534)", |
| 45 | + "--color-border-warning": "light-dark(#fde047, #854d0e)", |
| 46 | + "--color-border-disabled": "light-dark(rgba(229,231,235,0.5), rgba(64,64,64,0.5))", |
| 47 | + |
| 48 | + // Ring colors (focus) |
| 49 | + "--color-ring-primary": "light-dark(#3b82f6, #60a5fa)", |
| 50 | + "--color-ring-secondary": "light-dark(#6b7280, #9ca3af)", |
| 51 | + "--color-ring-inverse": "light-dark(#ffffff, #1f2937)", |
| 52 | + "--color-ring-info": "light-dark(#2563eb, #3b82f6)", |
| 53 | + "--color-ring-danger": "light-dark(#dc2626, #ef4444)", |
| 54 | + "--color-ring-success": "light-dark(#16a34a, #22c55e)", |
| 55 | + "--color-ring-warning": "light-dark(#ca8a04, #eab308)", |
| 56 | + |
| 57 | + // Typography - Family |
| 58 | + "--font-sans": "system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif", |
| 59 | + "--font-mono": "ui-monospace, 'SF Mono', Monaco, 'Cascadia Code', monospace", |
| 60 | + |
| 61 | + // Typography - Weight |
| 62 | + "--font-weight-normal": "400", |
| 63 | + "--font-weight-medium": "500", |
| 64 | + "--font-weight-semibold": "600", |
| 65 | + "--font-weight-bold": "700", |
| 66 | + |
| 67 | + // Typography - Text Size |
| 68 | + "--font-text-xs-size": "0.75rem", |
| 69 | + "--font-text-sm-size": "0.875rem", |
| 70 | + "--font-text-md-size": "1rem", |
| 71 | + "--font-text-lg-size": "1.125rem", |
| 72 | + |
| 73 | + // Typography - Heading Size |
| 74 | + "--font-heading-xs-size": "0.75rem", |
| 75 | + "--font-heading-sm-size": "0.875rem", |
| 76 | + "--font-heading-md-size": "1rem", |
| 77 | + "--font-heading-lg-size": "1.25rem", |
| 78 | + "--font-heading-xl-size": "1.5rem", |
| 79 | + "--font-heading-2xl-size": "1.875rem", |
| 80 | + "--font-heading-3xl-size": "2.25rem", |
| 81 | + |
| 82 | + // Typography - Text Line Height |
| 83 | + "--font-text-xs-line-height": "1.4", |
| 84 | + "--font-text-sm-line-height": "1.4", |
| 85 | + "--font-text-md-line-height": "1.5", |
| 86 | + "--font-text-lg-line-height": "1.5", |
| 87 | + |
| 88 | + // Typography - Heading Line Height |
| 89 | + "--font-heading-xs-line-height": "1.4", |
| 90 | + "--font-heading-sm-line-height": "1.4", |
| 91 | + "--font-heading-md-line-height": "1.4", |
| 92 | + "--font-heading-lg-line-height": "1.3", |
| 93 | + "--font-heading-xl-line-height": "1.25", |
| 94 | + "--font-heading-2xl-line-height": "1.2", |
| 95 | + "--font-heading-3xl-line-height": "1.1", |
| 96 | + |
| 97 | + // Border radius |
| 98 | + "--border-radius-xs": "2px", |
| 99 | + "--border-radius-sm": "4px", |
| 100 | + "--border-radius-md": "6px", |
| 101 | + "--border-radius-lg": "8px", |
| 102 | + "--border-radius-xl": "12px", |
| 103 | + "--border-radius-full": "9999px", |
| 104 | + |
| 105 | + // Border width |
| 106 | + "--border-width-regular": "1px", |
| 107 | + |
| 108 | + // Shadows |
| 109 | + "--shadow-hairline": "0 1px 2px 0 rgba(0, 0, 0, 0.05)", |
| 110 | + "--shadow-sm": "0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1)", |
| 111 | + "--shadow-md": "0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)", |
| 112 | + "--shadow-lg": "0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1)", |
| 113 | +}; |
0 commit comments