Repository navigation
feat!: ship the v2 styles from core for React, Vue, and Angular, with no stylesheet import - #8088
Conversation
…stylesheet import Spike for PE-1130. Adds <CopilotStyle>, which renders a component's CSS as <style href precedence>. React 19 moves it into <head> once, including in server HTML; React 18 renders it in place. No new dependencies and no React version check. A nonce on CopilotKitProvider renders the tags in place with the nonce, because Next.js passes React a string nonce that only covers scripts. All selectors use :where(), so any class the app sets wins. The suggestion pill is the first component moved off Tailwind. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Replaces per-component <style> tags with a single <CopilotKitStyles>, so React 18 gets one copy per chat instead of one per pill or message. CopilotChat renders it (and so do CopilotPopup and CopilotSidebar); it is exported for layouts built from the chat parts. Apps that only use hooks never import it, so they ship no CSS. Styles are written as plain .css files in src/v2/styles/css. scripts/generate-stylesheet.mjs minifies them with esbuild into the committed stylesheet.ts, and the build fails if that file is stale. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…f Tailwind Every v2 component now uses semantic cpk-* classes styled from plain CSS files in src/v2/styles/css, compiled into the one stylesheet <CopilotKitStyles> renders. Selectors sit in :where(), so any class an app sets wins without tailwind-merge. - base.css ports Tailwind's preflight, scoped to [data-copilotkit] as scope-preflight.mjs did, so components render as before. - Files load base -> ui/ -> components -> layout/, so a parent can override the parts it renders. - cn() is a plain class join; tailwind-merge, clsx, and cva are no longer imported. - Markdown typography replaces @tailwindcss/typography with markdown.css. BREAKING CHANGE: cpk:-prefixed Tailwind classes are gone from rendered markup. Apps that targeted them should target the cpk-* classes instead. Co-Authored-By: Claude Opus 5.5 <[email protected]>
CopilotKit components now render their own styles, so apps no longer import @copilotkit/react-core/v2/styles.css. Removes the export, the build:css step, globals.css, and the Tailwind, tailwind-merge, cva, clsx and tw-animate dependencies. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Removes imports of the CopilotKit v2 stylesheet from JS, TS and CSS files, and runs it on the examples that use the workspace react-core. Co-Authored-By: Claude Opus 5.5 <[email protected]>
CopilotKit v2 components include their own styles. Removes the import from every example, rewrites the setup and theming sections, and adds the codemod to the v2 migration guide. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Unlayered CSS beats every layered rule, so an app's Tailwind utility classes could not override the components. The stylesheet now uses the layers the Tailwind build did: theme variables in base, the rest in utilities. Also restores the 24px chat input line height that shipped. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review: 1
Please check the settings in the CodeRabbit UI or the
|
Production Digest-Pinning AuditAll 43 services digest-pinned. Run 2026-10-30 06:14:44 PDT — 0 finding(s). |
The ported preflight had rules for a [data-copilotkit] root that is an h1, video, table, and more. Only div, aside, and button elements carry the attribute, so these 41 selectors never matched. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The fixture renders CopilotChatView without CopilotChat, so since the stylesheet import was removed it had no CSS and no scroll container. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…-in cached styles.css
The CSS source and generator move from react-core to core, so every
framework package can inject the same stylesheet:
- `@copilotkit/core/styles` exports the minified CSS as a string.
react-core's <CopilotKitStyles> renders it from there.
- `@copilotkit/core/styles.css` is the same CSS as a file. Apps that want
browsers to cache it import it and set
`<CopilotKitProvider injectStyles={false}>`, which turns off the
injected <style> tag.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The token sync read react-core's globals.css, which no longer exists, so the web-components build failed. It now reads the theme in packages/core/src/styles/css/theme.css. The derived values are unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…esheet-import The codemod now also removes `@copilotkit/vue/styles.css` and `@copilotkit/angular/styles.css`: from JS, TS and CSS files (including webpack's `~` prefix), from Vue single-file components, and from the `styles` arrays in angular.json. An angular.json with comments is reported instead of rewritten. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…iew buttons Vue renders the add menu in place above the add button rather than in a portal, and wraps attachment previews in a button for keyboard users. The new rules only add selectors, so React's styling is unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… Tailwind Vue components now render React's `cpk-*` classes and markup, so the stylesheet from `@copilotkit/core/styles` applies to them. CopilotChat renders the new `CopilotKitStyles` component, which puts one `<style>` tag in the page, including in server-rendered HTML. CopilotKitProvider takes `nonce` and `injectStyles`, as in React. BREAKING CHANGE: `@copilotkit/vue/styles.css` is removed. Remove the import, or run the remove-stylesheet-import codemod. To load the CSS as a cached file, import `@copilotkit/core/styles.css` and set `injectStyles: false` on CopilotKitProvider. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…d of Tailwind
Angular components now render React's `cpk-*` classes and markup, so the
stylesheet from `@copilotkit/core/styles` applies to them. The chat view,
popup and sidebar render the new `<copilot-kit-styles>`, which Angular adds
to the page once, including in server-rendered HTML, with its CSP_NONCE.
`provideCopilotKit({ injectStyles: false })` turns it off. The popup and
sidebar take React's toggle button, header, window and welcome screen.
BREAKING CHANGE: `@copilotkit/angular/styles.css` is removed. Remove it
from angular.json or your global stylesheet, or run the
remove-stylesheet-import codemod. Input and message components rendered
without a chat surface need `<copilot-kit-styles />`. `cn()` no longer
merges conflicting Tailwind classes. The popup and sidebar no longer dim
the page.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
- An attachment lightbox, and attachments rendered in user messages. - Tooltips on the input and message toolbar buttons. - The reply-ratings popover and the Inspector button in the assistant toolbar. - Grouped, line, stacked and separate tool-call displays (`toolCallDisplay`). - A2UI building, retrying and failed states, with `a2ui.recovery`. - A `position` prop on CopilotSidebar for a left-docked sidebar. - Real submenus in the chat input add menu, with keyboard support. Vue no longer sets `data-multiline` on the user bubble, as in React, and the in-place add-menu CSS that #8101 added to core is gone. No new dependencies: tooltip, popover and menu positioning are built on Vue. Co-Authored-By: Claude Opus 5.5 <[email protected]>
- CopilotKitProvider takes `learning` (true, or an options object with `autoStart`, `trajectoryId` and `learningContainerIds`), as in React, so apps can turn on interaction capture and reply ratings from the provider. - `toolCallDisplay: "turn"` folds a reply's working phase behind React's "Working… / Worked for 9s" summary. CopilotChatWorkSummary and the `#work-summary` slot are exported. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…put and code blocks - Tooltips render React's markup and shared CSS, placed with the CDK overlay, and open at once as in React (`tooltipDelay` defaults to 0). - An attachment lightbox for images in the queue and in sent messages, and a play button on queued videos. Sent documents are download links. - React's default tool-call card, grouped calls and the `toolCallDisplay` input (grouped, line, stacked, separate). - React's compact and expanded input layouts, and its spinner while processing. - React's code block markup, without syntax highlighting. - The Inspector button and menu in the assistant toolbar. BREAKING CHANGE: code blocks no longer have syntax colours or a copy button, and highlight.js is no longer a dependency. With `defaultToolRendering: true`, tool calls are grouped by default. The default `tooltipDelay` is 0. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The Angular package no longer ships styles.css, so drop it from the showcase's global styles and from the staged package exports. The showcase compiles the package from source, so the shared stylesheet now counts as one component style; raise the anyComponentStyle budget to fit it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
@copilotkit/a2ui-renderer
@copilotkit/agentcore-runner
@copilotkit/angular
@copilotkit/channels
@copilotkit/channels-core
@copilotkit/channels-discord
@copilotkit/channels-intelligence
@copilotkit/channels-slack
@copilotkit/channels-teams
@copilotkit/channels-ui
@copilotkit/channels-whatsapp
@copilotkit/core
@copilotkit/intelligence-langgraph
@copilotkit/intelligence-mastra
@copilotkit/learning
@copilotkit/markdown-renderer
@copilotkit/mcp-apps-renderer
@copilotkit/react-core
@copilotkit/react-native
@copilotkit/runtime
@copilotkit/sdk-js
@copilotkit/shared
@copilotkit/sqlite-runner
@copilotkit/voice
@copilotkit/vue
@copilotkit/web-components
@copilotkit/web-inspector
commit: |
Adapt the native styles work to #8084, which moved react-core's src/v2 up to src and removed the /v2 subpaths: - react-core: no ./styles.css export, no build:css, and no Tailwind or class-merge dependencies. src/index.ts exports CopilotKitStyles. - Examples drop the new @copilotkit/react-core/styles.css imports. - web-components keep reading the theme from core's theme.css. - The v2-migration codemod deletes stylesheet imports instead of rewriting them to @copilotkit/react-core/styles.css, which no longer exists. remove-stylesheet-import also removes that path and the v1 @copilotkit/react-ui/styles.css. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Size Change: +10.8 kB (+0.54%) Total Size: 2.02 MB 📦 View Changed
ℹ️ View Unchanged
|
…orts Add @copilotkit/core/styles and @copilotkit/core/styles.css. Remove the react-core, Vue, and Angular styles.css exports. Co-Authored-By: Claude Opus 5.5 <[email protected]>
React 18 does not move a <style precedence> into <head>, and its server escapes > and quotes in style text, which broke the CSS in server HTML. On React 18, CopilotKitStyles now renders a plain <style> in place with the CSS unescaped. The tests run on both React versions. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The Inspector uses marked 12 and @copilotkit/core uses marked 16. The harness imports both from source, so Vite's dep optimizer bundled one marked for both, and which version won depended on scan order. With marked 16 the Inspector's link renderer threw, the What's New feed was dropped, and learning-status.browser.ts failed. Exclude marked from pre-bundling so each import resolves to its own package's version. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Bring in #8088 (styles ship from core, no stylesheet import). Conflicts keep this branch's 2.0 names and root imports and drop every styles.css import. The new content from #8088 uses <CopilotKitProvider> instead of <CopilotKit>, and its Angular styling fences now type-check. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Apps no longer import a CopilotKit stylesheet. React, Vue, and Angular now share one native-CSS stylesheet from
@copilotkit/core, and each chat component adds it to the page. Tailwind is gone from all three packages. A codemod removes the old imports.To review: start with
packages/core/src/styles/andpackages/react-core/src/styles/copilot-kit-styles.tsx. This PR now contains the Vue port (#8101) and the Angular port (#8104), and it is up to date with2.0.0.BREAKING CHANGE:
@copilotkit/react-core/styles.css,@copilotkit/react-core/v2/styles.css,@copilotkit/vue/styles.css, and@copilotkit/angular/styles.cssare removed. Remove the import from your app, or run the codemod:For Angular, add
angular.jsonafter./src. Thev2-migrationcodemod also deletes these imports from JavaScript and TypeScript files.What does this PR do?
packages/core/src/styles/css. A script minifies it intostylesheet.ts, and the core build fails if that file is out of date.@copilotkit/core/stylesexports the CSS as a string.<CopilotKitStyles />, rendered byCopilotChat. React 19 moves the tag into<head>and removes duplicates. React 18 renders it in place.CopilotKitStyles, rendered byCopilotChat. Only the first instance in an app renders the tag.<copilot-kit-styles>, rendered by the chat view, popup, and sidebar. Angular adds the CSS to<head>once.nonce, andinjectStyles: falsefor apps that load@copilotkit/core/styles.cssas a cached file. The server-rendered HTML includes the CSS.baseandutilitiescascade layers. App CSS and Tailwind classes override it in any load order.cpk-*classes and structure. They also get the React chat features that they did not have. Angular still lacks four of them, and PE-1140 tracks these.Also in this PR:
remove-stylesheet-importremoves all old stylesheet paths, from JS, CSS, Vue files, andangular.json. Thev2-migrationcodemod from feat!: remove v1 and the /v2 subpaths from react-core and runtime #8084 now deletes stylesheet imports instead of rewriting them to@copilotkit/react-core/styles.css.>and quotes in<style>text. On React 18,CopilotKitStyleswrites the CSS unescaped, so the server HTML is correct.marked12 (Inspector) andmarked16 (core) through one Vite pre-bundle. The bundle used one version, and the scan order chose it.markedis now excluded from that pre-bundle.web-componentsreads its drawer tokens from core'stheme.css. The public API manifest lists the new exports. Examples, showcases, storybooks, and docs no longer import a stylesheet.Size (gzip)
tailwind-merge,class-variance-authority, andclsxhighlight.jsis removed.Vue and Angular get some CSS for components that only React has, about 3 to 4 KB gzip. A stylesheet per component removes it. That change is not in this PR.
Related PRs and Issues
/v2subpaths and added thev2-migrationcodemod.Checklist
!(for examplefeat(react-core)!: ...) and the description has aBREAKING CHANGE:line with migration steps. See VERSIONING.mdTesting
Commands run
nx run-many -t build,test,check-types,publint,attwoncore,react-core,vue,angular, andweb-components: pass. React has 2,522 tests, Vue has 1,432.CopilotKitStylestests on React 18.3.1 and React 19.2.3: pass. Three of them fail when the React 18 fix is removed.react-corebrowser tests (test:browser,test:browser-scroll, including the cascade-layer test in Chromium): pass.web-inspectortests: 915 unit tests and 23 browser tests pass.learning-status.browser.tsfails without the harness fix.v2-migrationtests and 17remove-stylesheet-importtests pass. The Angular and Vue showcase hosts build, and the Angular bundle-size check passes.The pre-commit hook's
test,publint,attwpassed on all 36 affected JavaScript projects. The Go, .NET, and Ruby suites did not run, because these toolchains are not installed on my machine. For this reason, some commits skip that hook. A visual diff of all 129 React Storybook stories against2.0.0was done before the2.0.0merge.CI failures that this PR does not cause:
doc-testsfails on every PR into2.0.0. The 15 dojo starters look for@copilotkit/react-ui, which #8084 removed.Manual test
pnpm nx run @copilotkit-storybook/react:devand openhttp://localhost:6006.<style>tag and no CopilotKit.cssfile.@copilotkit-storybook/vue:devand@copilotkit-storybook/angular:dev(port 6007).How this PR makes testing easy
packages/react-core/src/styles/__tests__/: client and server tests for one tag, the nonce, unescaped CSS, andinjectStyles={false}. They run on React 18 and 19.packages/vue/src/v2/styles/__tests__/) and Angular (copilot-kit-styles.spec.ts).codemods/__tests__/remove-stylesheet-import.test.tsandcodemods/v2-migration/tests/tsx/stylesheets/.Risk / rollback
CopilotChatinstances add two identical<style>tags. The CSS result is the same.defaultToolRendering: true, tool calls are grouped. Tooltips open with no delay.Public API change
Before
After
Optional: CSS as a cached file
Vue takes the same
nonceandinjectStylesprops onCopilotKitProvider. Angular takes them inprovideCopilotKit({ injectStyles: false })and throughCSP_NONCE.🤖 Generated with Claude Code