a11y NPM Resource Changed PR-5.4-dev Pending

User tests: Successful: Unsuccessful:

avatar Nikhil-sinhaa
Nikhil-sinhaa
3 Jun 2026

Pull Request resolves Fixes #47838

[x] I read the Generative AI policy and my contribution is either not created with the help of AI or is compatible with the policy and GNU/GPL 2 or later.

Summary of Changes

adjusted highlight colors for better contrast

Testing Instructions

  1. Enable administrator dark mode

  2. Create multiple versions of an article

  3. Open:
    Articles → Versions → Compare

  4. Verify:

    • added text is clearly readable
    • removed text is clearly readable
    • contrast is improved in dark mode
    • compare view remains functional in light mode

Actual result BEFORE applying this Pull Request

issue before

Expected result AFTER applying this Pull Request

Screenshot (311) Screenshot (312)

Link to documentation

[x] No documentation changes for guide.joomla.org needed
[x] No documentation changes for manual.joomla.org needed

avatar Nikhil-sinhaa Nikhil-sinhaa - open - 3 Jun 2026
avatar Nikhil-sinhaa Nikhil-sinhaa - change - 3 Jun 2026
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 3 Jun 2026
Category JavaScript Repository NPM Change
avatar Nikhil-sinhaa Nikhil-sinhaa - change - 3 Jun 2026
The description was changed
avatar Nikhil-sinhaa Nikhil-sinhaa - edited - 3 Jun 2026
avatar BeginnerJoomlaCom
BeginnerJoomlaCom - comment - 3 Jun 2026

Please use the Pull Request-Template.

avatar Nikhil-sinhaa Nikhil-sinhaa - change - 3 Jun 2026
The description was changed
avatar Nikhil-sinhaa Nikhil-sinhaa - edited - 3 Jun 2026
avatar Nikhil-sinhaa Nikhil-sinhaa - change - 3 Jun 2026
The description was changed
avatar Nikhil-sinhaa Nikhil-sinhaa - edited - 3 Jun 2026
avatar Nikhil-sinhaa Nikhil-sinhaa - close - 3 Jun 2026
avatar Nikhil-sinhaa
Nikhil-sinhaa - comment - 3 Jun 2026

Please use the Pull Request-Template.

avatar Nikhil-sinhaa Nikhil-sinhaa - change - 3 Jun 2026
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2026-06-03 13:18:07
Closed_By Nikhil-sinhaa
Labels Added: NPM Resource Changed PR-5.4-dev
avatar Nikhil-sinhaa Nikhil-sinhaa - change - 3 Jun 2026
Status Closed New
Closed_Date 2026-06-03 13:18:07
Closed_By Nikhil-sinhaa
avatar Nikhil-sinhaa Nikhil-sinhaa - change - 3 Jun 2026
Status New Pending
avatar Nikhil-sinhaa Nikhil-sinhaa - reopen - 3 Jun 2026
avatar drmenzelit
drmenzelit - comment - 3 Jun 2026

In my opinion red and green should not be used at all

avatar Nikhil-sinhaa
Nikhil-sinhaa - comment - 3 Jun 2026

Thank you for the feedback.
So should i use neutral color or use borders styling for the compare view ?

avatar CSGoat0
CSGoat0 - comment - 3 Jun 2026

Hi @Nikhil-sinhaa, Thank you for your first time contribution.
From my POV I think this is a good starting. The colors here are currently not the best, your suggestion is better but it's not my opinion to decide though.

Anyways, this PR is a feature and it should be rebased to 6.2.
5.4 is no longer accepting features, only bug fixes.

You can also close this PR and open another one against 5.4 if it would be easier for you.
Also, you can add the target branch name in the PR title like this: [6.2] Fix dark mode color contrast.

Thanks again!

avatar CSGoat0
CSGoat0 - comment - 3 Jun 2026

Hi @Nikhil-sinhaa, Thank you for your first time contribution.
From my POV I think this is a good starting. The colors here are currently not the best, your suggestion is better but it's not my decision though.

Anyways, this PR is a feature and it should be rebased to 6.2.
5.4 is no longer accepting features, only bug fixes.

You can also close this PR and open another one against 5.4 if it would be easier for you.
Also, you can add the target branch name in the PR title like this: [6.2] Fix dark mode color contrast.

Thanks again!

avatar CSGoat0
CSGoat0 - comment - 3 Jun 2026

Hi @Nikhil-sinhaa, Thank you for your first time contribution.
From my POV I think this is a good starting. The colors here are currently not the best, your suggestion is better but it's not my decision though.

Anyways, this PR is a feature and it should be rebased to 6.2.
5.4 is no longer accepting features, only bug fixes.

You can also close this PR and open another one against 6.2 if it would be easier for you.
Also, you can add the target branch name in the PR title like this: [6.2] Fix dark mode color contrast.

Thanks again!

avatar richard67
richard67 - comment - 3 Jun 2026

You can also close this PR and open another one against 5.4 if it would be easier for you.

@CSGoat0 i guess you meant „against 6.2-dev“

avatar CSGoat0
CSGoat0 - comment - 3 Jun 2026

You can also close this PR and open another one against 5.4 if it would be easier for you.

@CSGoat0 i guess you meant „against 6.2-dev“

ahh, my bad thank you.

avatar richard67
richard67 - comment - 3 Jun 2026

Anyways, this PR is a feature and it should be rebased to 6.2.

Not necessarily. If it fixes an accessibility (a11y) issue without introducing new functionality or changing html markup, it can be considered a bug fix and so would bebop for 5.4-dev. I think this is the case for this PR, and it is ok for 5.4.

avatar richard67
richard67 - comment - 3 Jun 2026

Anyways, this PR is a feature and it should be rebased to 6.2.

Not necessarily. If it fixes an accessibility (a11y) issue without introducing new functionality or changing html markup, it can be considered a bug fix and so would be ok for 5.4-dev. I think this is the case for this PR, and it is ok for 5.4.

avatar brianteeman
brianteeman - comment - 3 Jun 2026

I agree that colour alone should not be used to indicate a state. Green=good red=bad are meaningless if you can't see the difference between those colours. But in this case they're pretty meaningless and just used to highlight so I don't see a real problem.

I always ask myself does this change make it better (not perfect, just better) than it was before and for me this pr does that.

avatar C-Lodder
C-Lodder - comment - 4 Jun 2026

Can't quite remember, but I feel like we might have looked at this years ago.

Whilst I agree this PR addresses some contrast issues, the HTML semantics are still incorrect.
The diff display should be using <del> and <ins> tags to represent changes.

From a default visual and accessibility perspective, inserted text will contain an underline, and deleted text will contain a strikethrough, which at a bare minimum, will assist users who suffer from Achromatopsia.

Here's a basic example: https://jsfiddle.net/2vgLzumd/
I've added basic colours for additional presentation.

avatar C-Lodder
C-Lodder - comment - 4 Jun 2026

Can't quite remember, but I feel like we might have looked at this years ago.

Whilst I agree this PR addresses some contrast issues, the HTML semantics are still incorrect.
The diff display should be using <del> and <ins> tags to represent changes.

From a default visual and accessibility perspective, inserted text will contain an underline, and deleted text will contain a strikethrough, which at a bare minimum, will assist users who suffer from Achromatopsia.

Here's a basic example: https://jsfiddle.net/2vgLzumd/
I've added basic colours for additional presentation.

Achromatopsia simulation:

{6E8E7003-5171-436E-A5B2-7708A329F6F0}

Sighted:

{01ED4BE5-96F2-483B-879A-549C676C296B}
avatar Nikhil-sinhaa
Nikhil-sinhaa - comment - 4 Jun 2026

Thanks for the feedback. Good point about accessibility. I'll update the implementation to use <ins> and <del> and push a new commit.

avatar Nikhil-sinhaa Nikhil-sinhaa - change - 4 Jun 2026
Labels Added: a11y
avatar Nikhil-sinhaa
Nikhil-sinhaa - comment - 4 Jun 2026

Updated the implementation to use semantic and elements for inserted and deleted content while keeping the visual highlighting.
image

avatar Nikhil-sinhaa
Nikhil-sinhaa - comment - 4 Jun 2026

Updated the implementation to use semantic ins and del elements for inserted and deleted content while keeping the visual highlighting.
image

avatar cyrez
cyrez - comment - 13 Jun 2026

I agree with @C-Lodder, it's better with <del> and <ins> (and as a colorblind, visual element helps when you can't see difference between 2 colors).

But color contrast is not correct.

It would be easier to set background color differently depending on the theme mode (light or dark).

In admin Joomla, you can use such kind of code:

const bstheme = document.documentElement.dataset.bsTheme;
const darkMode = (bstheme && bstheme === 'dark');

And then, something like that:

if (part.added) {
    let color = darkMode ? '#fff' : '#000';
    let bgColor = darkMode ? '#266303' : '#d4fcbc';
    element.style.color = color;
    element.style.backgroundColor = bgColor;
}

if (part.removed) {
    let color = darkMode ? '#b3b3b3' : '#555';
    let bgColor = darkMode ? '#8f0000' : '#ffbbbb';
    element.style.color = color;
    element.style.backgroundColor = bgColor;
}

Color contrast above: WCAG AA for removed and AAA for added.

avatar chmst
chmst - comment - 13 Jun 2026

I also agree with @drmenzelit that red and green are "wrong" colours, but they are common usage also on github, but better with it's better with and .

But before patch we have this:
grafik
If only the font color in dark mode becomes black, it is WCAG AAA

After patch this
grafik

avatar chmst
chmst - comment - 13 Jun 2026

I also agree with @drmenzelit that red and green are "wrong" colours, but they are common usage also on github.
I agree with @C-Lodder, it's better with '' and ''

But before patch we have this:
grafik
If only the font color in dark mode becomes black, it is WCAG AAA

After patch this
grafik

avatar chmst
chmst - comment - 13 Jun 2026

I also agree with @drmenzelit that red and green are "wrong" colours, but they are common usage also on github.
I agree with @C-Lodder, it's better with <del> and <ins>

But before patch we have this:
grafik
If only the font color in dark mode becomes black, it is WCAG AAA

After patch this
grafik

avatar chmst
chmst - comment - 13 Jun 2026

It is an a11y bug. A PR should go into 5.4

I also agree with @drmenzelit that red and green are "wrong" colours, but they are common usage also on github.
I agree with @C-Lodder, it's better with <del> and <ins>

But before patch we have this:
grafik
If only the font color in dark mode becomes black, it is WCAG AAA

After patch this
grafik

Add a Comment

Login with GitHub to post a comment