Skip to content

Change color for text in HTML report #116

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

Closed
APshenkin opened this issue May 17, 2017 · 15 comments · Fixed by #156
Closed

Change color for text in HTML report #116

APshenkin opened this issue May 17, 2017 · 15 comments · Fixed by #156

Comments

@APshenkin
Copy link

Hi!

First, thank you for this plugin!

I want to recommend to change font color in report because read grey text on white background is "hard" for eyes. Also if we can increase font size it would be great!

Thanks in advance!

@m8ttyB
Copy link
Collaborator

m8ttyB commented May 18, 2017

@APshenkin thank you for pointing this out. Let me spend some time investigating options.

@m8ttyB
Copy link
Collaborator

m8ttyB commented May 22, 2017

@davehunt what's your preference.

  • tweak the existing CSS to change the font coloring to be a bit darker (provide more contrast)
  • allow a user to specify a CSS file that overrides the one used by pytest-html

@davehunt
Copy link
Collaborator

@m8ttyB let's tweak the contrast of the current CSS to improve accessibility by default. I think having an option to provide a CSS file as an override would be neat, but it's not clear if there's a thirst for this. @APshenkin do you have any thoughts?

@m8ttyB
Copy link
Collaborator

m8ttyB commented May 22, 2017

@APshenkin An additional question to go along with @davehunt's It's also possible to increase the font-size, although would using the built-in ability of your browser to increase font-size work in this instance?

@APshenkin
Copy link
Author

@m8ttyB @davehunt
option to provide a CSS file would be great I think. This will unblock other users to customize the report as they want. But if it requires more time, the solution to change current CSS will be OK.

@bhatnagarvaibhav
Copy link

bhatnagarvaibhav commented Jul 26, 2017

@m8ttyB @davehunt
Any updates on this one where we can provide a CSS file of our own?

Thanks in advance.

@m8ttyB
Copy link
Collaborator

m8ttyB commented Aug 16, 2017

@APshenkin apologies, this thread fell of my radar. Let me take a look at this again early next week and scope a solution.

@sveinugu
Copy link

sveinugu commented Aug 28, 2017

@m8ttyB @davehunt +1 on adding option to specify a custom CSS. I was just planning to fork the code in order to change CSS when I noticed this issue.

@m8ttyB
Copy link
Collaborator

m8ttyB commented Aug 29, 2017

@davehunt what's your preference, tweaking the existing CSS (defining the write ratios could take awhile), or allowing users to insert their own CSS styling?

@davehunt
Copy link
Collaborator

davehunt commented Aug 29, 2017

@m8ttyB I like the idea of having a --css command line option that could be a path to a local CSS file. When present, we could read in this file and write it out inline or as an asset. I also like the idea of a --theme option for predefined styles. The current style would be the default, and we could ship with high-contrast or other accessible options. These two features could be implemented independently. In fact, implementing the former would make it easy for a contributor to test themes for the latter. As we have a number of users following this issue, let's see if they have thoughts of this before we make a decision.

@davehunt
Copy link
Collaborator

I would also propose that the theme is always set as a base style, and the user specified CSS simply allows selected styles to be replaced. That way, the two features would be able to work together.

@davehunt
Copy link
Collaborator

davehunt commented Jan 2, 2018

Are you still interested to work on this @m8ttyB or should I unassign in case someone else can take it?

@i-am-david-fernandez
Copy link
Contributor

To throw my two cents into the discussion, I vote for user-supplied CSS rather than a change to the core styles. This will provide a package-based solution that can be individually tailored as required.

Much of my current test output is unreadable: I use colorlog for coloured log output that gets captured and ansi-formatted into the HTML report, and the default ansi colors for debug level messages is illegible on the html report background. I don't expect this particular mix is that common, but if I can provide my own CSS as an option I can cleanly correct for this locally.

@davehunt
Copy link
Collaborator

davehunt commented Mar 2, 2018

Thanks for your thoughts @i-am-david-fernandez, I think the best way forward is allowing a user to specify a --css path that allows users modify the core styles. I've unassigned @m8ttyB (I hope that's okay, Matt!) so if anyone has time to work on this I'd be happy to mentor and review. If not, I'll try to keep this in mind for when I next have some time to hack.

@i-am-david-fernandez
Copy link
Contributor

@davehunt I've submitted a PR for my attempt at implementing this. Hopefully I've accurately captured the needs and desires as described here.

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

Successfully merging a pull request may close this issue.

6 participants