Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XWIKI-21387: The syntax highlighting done by the Code Macro lacks contrast #3052

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Sereza7
Copy link
Contributor

@Sereza7 Sereza7 commented Apr 10, 2024

Jira URL

https://jira.xwiki.org/browse/XWIKI-21387

Changes

Description

  • Created a pygment style in updated_default.py
  • Updated the parser configuration to fallback on this style by default
  • Updated tests to fit the new colortheme

Clarifications

  • The new pygments style is largely inspired by the latest version of the pygment style. It's not straightforward to upgrade so we cannot easily get it this way. Moreover, this style was made with a background color of #f8f8f8 in mind when considering contrast needs. Our default background is #f5f5f5, which is darker than that, so we need to update a few values that were "on the line" regarding contrast.
  • From a quick look at it, the changes in colors should not be particularly noticeable (at least when not comparing directly).

Screenshots & Video

Here is a screenshot of a code macro after teh changes with a java default content used in it. We can see that no contrast error is detected on the page.
21387-afterPR

Executed Tests

  • Regular build of the code macro mvn clean install -f xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-macros/xwiki-platform-rendering-macro-code -Pquality,docker,integration-tests successfully passed
  • Accessibility checks on xwiki-platform-export-pdf mvn clean install -f xwiki-platform-core/xwiki-platform-export/xwiki-platform-export-pdf/xwiki-platform-export-pdf-test/xwiki-platform-export-pdf-test-docker -Pdocker -Dxwiki.test.ui.wcag=true. They did pass successfully, but more importantly, the contrast violations reported by axe core and cause for this ticket creation are fixed.

Expected merging strategy

  • Prefers squash: Yes
  • Backport on branches:
    • 15.10.X, IMO this looks pretty safe. The changes are limited to the scope of the code macro.

…trast

* Created a pygment style in updated_default.py
* Updated the parser configuration to fallback on this style by default
* Updated tests to fit the new colortheme
@Sereza7 Sereza7 added the backport stable-15.10.x Used for automatic backport to 15.10.x branch. label Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport stable-15.10.x Used for automatic backport to 15.10.x branch.
Projects
None yet
1 participant