sahat / hackathon-starter

A boilerplate for Node.js web applications
MIT License
34.77k stars 8.14k forks source link

Uniform text colour under "API Examples" tab #1270

Closed VatsalBhuva11 closed 8 months ago

VatsalBhuva11 commented 9 months ago

Right now, the text and the underline of the "Foursquare" and the "Stripe" buttons have different colours, which looks non-uniform. The underline is white, while the text is black. I think it would be better to make the text white as well. Attaching a screenshot: image

VatsalBhuva11 commented 9 months ago

I would like to assign this to myself.

harshul-2002 commented 9 months ago

Hello sir, i would like to solve this issue

VatsalBhuva11 commented 9 months ago

@harshul-2002 I'm a contributor as well :). I've made a PR for now, waiting for approval.

YasharF commented 9 months ago

We don't need this at this point

VatsalBhuva11 commented 9 months ago

We don't need this at this point

maybe atleast the underline color can be changed to black, and keep the text color black. black text with white underline looks kinda off.

YasharF commented 9 months ago

OK, I see. The desired rendered view would be to color match the underline of the text links with the color of the text. For example:

The issue: Foursquare, Stripe, and File Upload do not follow the above theme.

YasharF commented 9 months ago

(https://github.com/sahat/hackathon-starter/blob/dcf10bd62055c5b5e92af67719228238cc952767/views/api/index.pug#L93C44-L93C50) seem to have a one-off style color style='color: #1565c0' which is a blue, instead of style='color: #000' or style='color: #fff'. HERE Maps seem to have a one-off color as well, but visually doesn't seem to have an issue. @VatsalBhuva11 can you investigate this? Do they both have a bug? Is changing the style colors to #000 or #fff the fix? If not, why not?

Does the same thing apply to the Foursquare and Stripe's style?

Thanks.

VatsalBhuva11 commented 9 months ago

(https://github.com/sahat/hackathon-starter/blob/dcf10bd62055c5b5e92af67719228238cc952767/views/api/index.pug#L93C44-L93C50) seem to have a one-off style color style='color: #1565c0' which is a blue, instead of style='color: #000' or style='color: #fff'. HERE Maps seem to have a one-off color as well, but visually doesn't seem to have an issue. @VatsalBhuva11 can you investigate this? Do they both have a bug? Is changing the style colors to #000 or #fff the fix? If not, why not?

Does the same thing apply to the Foursquare and Stripe's style?

Thanks.

sure, let me have a look at it. thanks!

VatsalBhuva11 commented 9 months ago

@YasharF While changing the text-colour of Stripe and Foursquare to #000 (black) does make the colour code uniform, I think that a white colour might look better on a blue background particularly because black text has majorly been used only over white background on the buttons. Black text on white seems "natural" to the eyes, and hence we don't really notice the difference between the text colours on the different backgrounds! On the other hand, to have white on some blue buttons (like Facebook, QuickBooks) and black on others would again, be your choice of preference but my suggestion is to make all shades of blue have a text and underline colour of white as it would seem more natural. That would ensure that all non-white backgrounds have a white text, and white backgrounds have a black text, making it look uniform to the eyes.

VatsalBhuva11 commented 9 months ago

As far as the underline on the "File Upload" button is concerned, the dark shade of blue doesn't really distinguish itself from black, just like white distinguished itself from black on the "Stripe" and "Foursquare" buttons. To make the code uniform, however, it would of-course be better to change the blue underline to black even if it does not create any drastic visual changes.

YasharF commented 9 months ago

The color should go based on the W3C Web Content Accessibility Guidelines (WCAG). In summary, between white and black, the color that produces the higher contrast ratio is the one to be picked to conform to the W3C WCAG recommendation. The relevant parts of the standard are: https://www.w3.org/TR/WCAG21/#contrast-minimum https://www.w3.org/TR/WCAG21/#dfn-contrast-ratio https://www.w3.org/TR/WCAG21/#dfn-relative-luminance

If adjusting the style='color: #fff' to style='color: #000' for the four (4) cards is the fix the mismatch between the text and underlines, and to use the same theme across all cards, I would be happy to accept a PR given:

Priority to a PR submission by VatsalBhuva11 for the next 10 days since he identified the issue and has been looking into it.