ext-apps/examples/basic-server-react/src/mcp-app.module.css
Jonathan Hefner c3d91a13ad
Improve example CSS files to better demonstrate host style integration
Update `mcp-app.css`, `mcp-app.module.css`, and Svelte/Vue component
styles across all `basic-server-*` examples (and `integration-server`)
to use CSS variables instead of hardcoded values:

- Remove component-local color variables (`--color-primary`, etc.)
- Add derived spacing variables to `global.css` based on `--spacing-unit`
- Replace hardcoded spacing with `--spacing-xs/sm/md/lg` variables
- Add app-defined accent color variables (`--color-accent`,
  `--color-text-on-accent`) to `global.css` for brand customization
- Use app accent colors for button styling
- Update button hover to use `color-mix()` for theme-adaptive lightening
- Change focus-visible to use `--color-ring-primary` outline

This makes the templates more instructive for users and AI coding agents
building new MCP Apps by showing how to consume host-provided variables
semantically, define app-specific accent colors, and create adaptive
styling that integrates with host themes.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 09:32:26 -06:00

79 lines
1.5 KiB
CSS
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

.main {
width: 100%;
max-width: 425px;
box-sizing: border-box;
> * {
margin-top: 0;
margin-bottom: 0;
}
> * + * {
margin-top: var(--spacing-lg);
}
}
.action {
> * {
margin-top: 0;
margin-bottom: 0;
width: 100%;
}
> * + * {
margin-top: var(--spacing-sm);
}
/* Server time row: flex layout for consistent mask width in E2E tests */
> p {
display: flex;
align-items: baseline;
gap: var(--spacing-xs);
}
/* Consistent font for form inputs (inherits from global.css) */
textarea,
input {
display: block;
font-family: inherit;
font-size: inherit;
}
button {
padding: var(--spacing-sm) var(--spacing-md);
border: none;
border-radius: var(--border-radius-md);
color: var(--color-text-on-accent);
font-weight: var(--font-weight-bold);
background-color: var(--color-accent);
cursor: pointer;
&:hover {
background-color: color-mix(in srgb, var(--color-accent) 85%, var(--color-background-inverse));
}
&:focus-visible {
outline: calc(var(--border-width-regular) * 2) solid var(--color-ring-primary);
outline-offset: var(--border-width-regular);
}
}
}
.notice {
padding: var(--spacing-sm) var(--spacing-md);
color: var(--color-text-info);
text-align: center;
font-style: italic;
background-color: var(--color-background-info);
&::before {
content: "ℹ️ ";
font-style: normal;
}
}
/* Server time fills remaining width for consistent E2E screenshot masking */
.serverTime {
flex: 1;
min-width: 0;
}