ckeditor / ckeditor5

Powerful rich text editor framework with a modular architecture, modern integrations, and features like collaborative editing.
https://ckeditor.com/ckeditor-5
Other
8.28k stars 3.59k forks source link

Improved placeholders and font color grids in high contrast mode #16284

Closed oleq closed 1 week ago

oleq commented 2 weeks ago

Suggested merge commit message (convention)

Feature (utils): Implemented the env#isMediaForcedColors property for forced colors detection (e.g. high contrast mode on Windows). See #14907.

Feature (ui): Implemented ck-media-forced-colors and ck-media-default-colors mixins for detecting the forced colors (e.g. high contrast mode on Windows) mode. See #14907.

Fix (theme-lark): The caret should be visible in a placeholder while in forced colors mode (e.g. high contrast mode on Windows). Improved the look of the placeholders in the forced colors mode. Closes #14907.

Fix (theme-lark): The color grid component should render as a grid of labels in the forced colors mode (e.g. high contrast mode on Windows). Closes #14907.

Summary by CodeRabbit

coderabbitai[bot] commented 2 weeks ago

Walkthrough

The update aims to improve accessibility features in CKEditor components, especially for high-contrast mode compatibility. It introduces mixins for media colors, adjusts color handling in UI components, and enhances visibility in various display settings.

Changes

Files Changes
.../imagecaption.css, .../tablecaption.css, .../ckeditor5-widget/widget.css Added _mediacolors.css import and new CSS variables for media color handling.
.../ckeditor5-ui/components/colorgrid/colorgrid.css Included mixins for default and forced media colors; updated color tile styles.
.../ckeditor5-theme-lark/theme/.../placeholder.css Introduced mixins to enhance placeholder text visibility in high contrast and Edge on Windows.
ckeditor5-table/package.json Updated dependencies to include @ckeditor/ckeditor5-ui.
ckeditor5-ui/src/colorgrid/colortileview.ts, ckeditor5-utils/src/env.ts Enhanced color handling based on the environment's forced color settings.
ckeditor5-ui/theme/mixins/_mediacolors.css Added new mixins for managing forced colors in media elements.

Assessment against linked issues

Objective Addressed Explanation
High contrast mode compatibility improvements (Issue #14907)
Enhancements for color handling in UI elements (Issue #14907)
Addressing visibility issues in different color modes (Issue #14907)
Indirect support for color utility functions (Issue #16260) The focus on theme responsiveness and color handling indirectly aligns with the objectives of enhancing color utility functions but does not directly extend them.

Recent Review Details **Configuration used: CodeRabbit UI** **Review profile: CHILL**
Commits Files that changed from the base of the PR and between 5a3d6f1ea52fc9071ea408653345cd297354ec05 and 64a01a7a59b86241414b91a344ff02ba2976bc87.
Files selected for processing (5) * packages/ckeditor5-image/theme/imagecaption.css (2 hunks) * packages/ckeditor5-theme-lark/theme/ckeditor5-ui/components/colorgrid/colorgrid.css (3 hunks) * packages/ckeditor5-theme-lark/theme/ckeditor5-widget/widget.css (2 hunks) * packages/ckeditor5-utils/src/env.ts (3 hunks) * packages/ckeditor5-utils/tests/env.js (3 hunks)
Files not reviewed due to errors (4) * packages/ckeditor5-theme-lark/theme/ckeditor5-ui/components/colorgrid/colorgrid.css (no review received) * packages/ckeditor5-theme-lark/theme/ckeditor5-widget/widget.css (no review received) * packages/ckeditor5-utils/src/env.ts (no review received) * packages/ckeditor5-utils/tests/env.js (no review received)
Additional comments not posted (2)
packages/ckeditor5-image/theme/imagecaption.css (2)
`6-6`: Import of `_mediacolors.css` correctly aligns with the PR's objectives to enhance high contrast mode support. --- `25-29`: Media query correctly enhances placeholder visibility in high contrast mode by unsetting styles, aligning with the PR's objectives.
--- Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Share - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)
Tips ### Chat There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai): - Review comments: Directly reply to a review comment made by CodeRabbit. Example: - `I pushed a fix in commit .` - `Generate unit testing code for this file.` - `Open a follow-up GitHub issue for this discussion.` - Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples: - `@coderabbitai generate unit testing code for this file.` - `@coderabbitai modularize this function.` - PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples: - `@coderabbitai generate interesting stats about this repository and render them as a table.` - `@coderabbitai show all the console.log statements in this repository.` - `@coderabbitai read src/utils.ts and generate unit testing code.` - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.` Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. ### CodeRabbit Commands (invoked as PR comments) - `@coderabbitai pause` to pause the reviews on a PR. - `@coderabbitai resume` to resume the paused reviews. - `@coderabbitai review` to trigger a review. This is useful when automatic reviews are disabled for the repository. - `@coderabbitai resolve` resolve all the CodeRabbit review comments. - `@coderabbitai help` to get help. Additionally, you can add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed. ### CodeRabbit Configration File (`.coderabbit.yaml`) - You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository. - Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information. - If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json` ### Documentation and Community - Visit our [Documentation](https://coderabbit.ai/docs) for detailed information on how to use CodeRabbit. - Join our [Discord Community](https://discord.com/invite/GsXnASn26c) to get help, request features, and share feedback. - Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.