Adjust theme to enable light mode - #137
Open
jonathonherbert wants to merge 2 commits into
Open
Conversation
Contributor
Contributor
Contributor
There was a problem hiding this comment.
Pull request overview
This PR restructures the CQL input theming API to better support light mode by introducing a base text color and nesting input-related styling in a more consistent shape.
Changes:
- Adds a top-level
theme.color.textand threads it into key CSS containers. - Restructures the theme shape so
placeholderand chip styling are nested undertheme.input(and chip content/handle underinput.chipWrapper). - Exports
CqlThemefrom the library entrypoint for external consumers.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
lib/cql/src/lib.ts |
Re-exports CqlTheme from the public barrel. |
lib/cql/src/cqlInput/theme.ts |
Updates the CqlTheme shape and default theme values to support base text theming and new nesting. |
lib/cql/src/cqlInput/CqlInput.ts |
Adapts template/theme destructuring and applies base text color to additional containers. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| CqlStr, | ||
| CqlField, | ||
| } from "./lang/ast.ts"; | ||
| export type { CqlTheme } from './cqlInput/theme.ts'; No newline at end of file |
Comment on lines
398
to
402
| .Cql__TypeaheadPopoverContainer, .Cql__ErrorPopover { | ||
| color: ${baseColor.text}; | ||
| position: absolute; | ||
| min-width: ${typeahead.layout.minWidth}; | ||
| margin: 0; |
Comment on lines
+98
to
+103
| chipHandle: { | ||
| color: { | ||
| background: "#3737378f", | ||
| border: "none", | ||
| }, | ||
| }, |
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.
What does this change?
Adjusts the theme to add enough styling to enable light mode.
A breaking change, as the API for the theme changes. I think it's worth breaking, as the theme structure before was not consistent, and it's trivial to adapt.
How has this change been tested?
Tested in https://github.com/guardian/capi.gutools, where I took the screenshot.