Repository navigation
feat(angular)!: style the v2 components with core's shared CSS instead of Tailwind - #8104
Conversation
…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]>
|
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 05:26:11 PDT — 0 finding(s). |
|
Size Change: +92 B (0%) Total Size: 2.39 MB 📦 View Changed
ℹ️ View Unchanged
|
@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/react-textarea
@copilotkit/react-ui
@copilotkit/runtime
@copilotkit/runtime-client-gql
@copilotkit/sdk-js
@copilotkit/shared
@copilotkit/sqlite-runner
@copilotkit/voice
@copilotkit/vue
@copilotkit/web-components
@copilotkit/web-inspector
commit: |
…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]>
953ae6c
into
alem/pe-1130-native-styles
… no stylesheet import (#8088) 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. Apps can load @copilotkit/core/styles.css as a cached file with injectStyles: false. The remove-stylesheet-import and v2-migration codemods delete the old imports. Includes the Vue port (#8101) and the Angular port (#8104). BREAKING CHANGE: @copilotkit/react-core/styles.css, @copilotkit/react-core/v2/styles.css, @copilotkit/vue/styles.css, and @copilotkit/angular/styles.css are removed. Remove the import, or run codemods/remove-stylesheet-import.ts. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Angular apps no longer add a stylesheet. The Angular v2 components now use the same CSS as React, from
@copilotkit/core. The chat view, popup, and sidebar render<copilot-kit-styles>, and Angular adds the CSS to the page once, including in server-rendered HTML. Tailwind is gone from@copilotkit/angular. The popup and sidebar now look like React's.This PR is stacked on #8088. Review and merge #8088 first.
BREAKING CHANGE:
@copilotkit/angular/styles.cssis removed. Remove it fromangular.jsonor from your global stylesheet, or run the codemod from #8088:What does this PR do?
cpk:classes now renders React'scpk-*classes and DOM structure. This includes the attachment renderer.copilot-icontakes a newiconClassinput for the<svg>.<copilot-kit-styles>(CopilotKitStyles). This is a new export. It usesViewEncapsulation.Nonewithstyles: [stylesheet], so Angular adds the CSS to<head>once, puts it in the SSR HTML, and appliesCSP_NONCE.provideCopilotKit({ injectStyles: false })turns it off.aria-modal, Escape, and docking do not change. They now use React's toggle button, header, window, panel, and welcome screens.stylesat compile time, so it cannot use a value imported from another package.scripts/generate-stylesheet.mjswrites a git-ignoredstylesheet.tsfrom@copilotkit/core/stylesbefore build, dev, test, and check-types.tailwind-merge,clsx,tw-animate-css,build:css,src/styles/,scope-preflight.mjs, and the./styles.cssexport.cn()stays, because it is public API. It is now a plain class join, like React's.Also in this PR:
angular.jsonand the showcase'sangular.jsondo not list the old CSS. The showcase compiles the package from source, so the stylesheet counts as one component style there. ItsanyComponentStylebudget goes from 32 kB to 96 kB. Apps that install the package do not count library styles in this budget. The storybook wraps stories in<copilot-kit-styles />, and has two new stories withCopilotChatin the popup and sidebar.@copilotkit/angular/styles.csssetup is gone from the docs and the README. The Angular reference has a Styling section with "Load the CSS as a cached file".API.mdlistsCopilotKitStyles.Size (gzip)
tailwind-merge,clsxThe shared stylesheet also has rules for components that only React has.
Feature parity with React
A second commit adds React's chat features that Angular did not have. There are no new dependencies.
highlight.jsis removed.tooltipDelayis now 0), and close on pointer leave, click, scroll, and Escape.toolCallDisplayinput (grouped, line, stacked, separate).Not in this PR, because each one is a large port:
"turn"display ("Worked for 9s").groupandinspectorButtonslots, and the lightbox preview for queued PDF and text files.Related PRs and Issues
@copilotkit/coreand adds the codemod. feat(vue)!: style the v2 components with core's shared CSS instead of Tailwind #8101 does the same port for Vue.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,attw -p @copilotkit/angular: pass. 624 tests pass, 1 skipped.nx run-many -t build,test -p @copilotkit/core @copilotkit/react-core: pass. The parity commit adds one class to core CSS, which React does not use.test,publint,attwon all 34 affected projects: pass. The Go, .NET, and Ruby suites did not run, because these toolchains are not installed on my machine. Both commits skip that hook for this reason.nx run @copilotkit/showcase-angular-host:build,testandtypecheck: pass, including its bundle-size check and artifact audit.@angular/platform-serveradded for the test and then removed: the server HTML has one<style nonce="…">in<head>, and none withinjectStyles: false.Manual test
pnpm nx run @copilotkit-storybook/angular:devand openhttp://localhost:6007.<style>tag and no CopilotKit.cssfile.How this PR makes testing easy
packages/angular/src/lib/components/copilot-kit-styles.spec.tscovers a single copy, injection from the chat view and from a closed popup and sidebar, the opt-out, and the nonce. Other specs cover the popup and sidebar welcome layouts. New specs cover the tooltip, lightbox, tool-call display, input layout, and Inspector button. Each test fails when its behavior is broken (16 deliberate breaks for the parity commit).Risk / rollback
@copilotkit/angular/styles.cssdoes not exist. The codemod removes it. The release notes must say this.<copilot-kit-styles />, as in React.defaultToolRendering: true, tool calls are grouped. Tooltips open with no delay.cn()no longer merges conflicting Tailwind classes.examples/integrations/adk-angularpins the published0.5.2and imports the old stylesheet. It breaks when its version is bumped../styles.cssexport come back.Public API change
Before
After
🤖 Generated with Claude Code