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

Changing ANSI Colors in pa11y-ci output #108

Open
mike-potter opened this issue Apr 9, 2020 · 1 comment
Open

Changing ANSI Colors in pa11y-ci output #108

mike-potter opened this issue Apr 9, 2020 · 1 comment

Comments

@mike-potter
Copy link

mike-potter commented Apr 9, 2020

When running pa11y-ci locally in a terminal window with color enabled, the actual error messages are impossible to read if using a black background in Terminal (which is a common "dark mode" config these days)

For example:

• Anchor element found with a valid href attribute, but no link content has been supplied.

   (html > body > footer > nav > div > section:nth-child(4) > section:nth-child(1) >
   span:nth-child(2) > a)

   <a href="https://www.linkedin.com/company"> <div class="fill-current s...</a>

Has the first line with the in white, but has the error for the html in a very dark gray color.

A bit ironic that the output of pa11y-ci itself isn't accessible ;)

I know you can't account for possible different terminal output color schemes, so mainly asking for either a "dark" scheme that just changes this dark-gray to a very light-grey, or a --no-color flag itself or something.

Right now I'm resorting to a script that changes my terminal settings before running pa11y then restoring them afterwards.

Forgive me if there is already some option for this, but couldn't find anything in searching or docs. Thanks!

@josebolos
Copy link
Member

josebolos commented Mar 23, 2022

Hi @mike-potter

Thanks for creating this issue. Would it be possible to share the name of the colour scheme that you use in your terminal and/or a screenshot of the problem? Most of us use terminals with dark colour schemes and we haven't encountered this problem, it's definitely something that we would have addressed earlier if we had experienced it.

Regarding disabling colour output altogether, as most unix tools pa11y-ci uses a library to output colour that will detect it the tool is run on non-TTY contexts and disable colour output accordingly. So for example piping pa11y-ci's output through a command like cat will cause colour to be disabled automatically:

pa11y-ci 'https://www.example.com/' | cat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants