feat: make stop icon and loading cursor customizable via CSS variables#2866
Merged
hayescode merged 2 commits intoChainlit:mainfrom Apr 2, 2026
Merged
Conversation
Replace hardcoded SVG/Tailwind with CSS mask-image rendering so
the shape, color, size, and animation of the stop icon and loading
cursor can be overridden via theme.json or custom CSS.
CSS variables exposed:
--stop-icon-mask SVG data URI for icon shape
--stop-icon-color defaults to currentColor
--stop-icon-animation defaults to none
--loading-cursor-mask SVG data URI (omit for default circle)
--loading-cursor-color defaults to hsl(var(--foreground))
--loading-cursor-size defaults to 0.875rem
--loading-cursor-animation defaults to pulse
Simple example (breathing pulse on both):
:root {
--stop-icon-animation: my-pulse 2s ease-in-out infinite;
--loading-cursor-animation: my-breathe 2s ease-in-out infinite;
--loading-cursor-size: 1.25rem;
}
@Keyframes my-pulse {
0%, 100% { opacity: 1; transform: scale(1); }
50% { opacity: 0.5; transform: scale(0.92); }
}
@Keyframes my-breathe {
0%, 100% { opacity: 1; transform: scale(1); }
50% { opacity: 0.35; transform: scale(0.85); }
}
Advanced example (custom icon shape and color):
:root {
--stop-icon-animation: stop-pulse 0.8s ease-in-out infinite;
--loading-cursor-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M9 18l6-6-6-6' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
--loading-cursor-color: hsl(120, 60%, 55%);
--loading-cursor-animation: chevron-spin 0.9s linear infinite;
}
@Keyframes stop-pulse {
0%, 100% { opacity: 1; transform: scale(1); }
50% { opacity: 0.2; transform: scale(1.35); }
}
@Keyframes chevron-spin {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
hayescode
previously approved these changes
Apr 1, 2026
Contributor
hayescode
left a comment
There was a problem hiding this comment.
Reviewed via Codex
LGTM.
Contributor
|
@nzjrs please fix CI then we're good to merge! |
The previous commit replaced Tailwind's animate-pulse class with a custom loading-cursor CSS class on BlinkingCursor.tsx, but the Cypress test still used .animate-pulse as its selector to detect the cursor.
auto-merge was automatically disabled
April 2, 2026 10:12
Head branch was pushed to by a user without write access
hayescode
approved these changes
Apr 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace hardcoded SVG/Tailwind with CSS mask-image rendering so the shape, color, size, and animation of the stop icon and loading cursor can be overridden via theme.json or custom CSS.
CSS variables exposed:
--stop-icon-maskSVG data URI for icon shape--stop-icon-colordefaults to currentColor--stop-icon-animationdefaults to none--loading-cursor-maskSVG data URI (omit for default circle)--loading-cursor-colordefaults to hsl(var(--foreground))--loading-cursor-sizedefaults to 0.875rem--loading-cursor-animationdefaults to pulseSimple example (breathing pulse on both):
Advanced example (custom icon shape and color):