Skip to content

[WS-2176]: made changes to add greyed link colour - #6E6E73#13953

Draft
victranfield wants to merge 1 commit intolatestfrom
WS-2176-Grey-viewed-colour-to-ranked-most-read-component
Draft

[WS-2176]: made changes to add greyed link colour - #6E6E73#13953
victranfield wants to merge 1 commit intolatestfrom
WS-2176-Grey-viewed-colour-to-ranked-most-read-component

Conversation

@victranfield
Copy link
Copy Markdown

@victranfield victranfield commented Apr 24, 2026

Resolves JIRA: https://bbc.atlassian.net/browse/WS-2176

Summary

greyed link colour should be #6E6E73

Code changes

changes made to index.tsx and index.styles.ts

Testing

  1. List the steps required to test this PR.
    Checking live page

Useful Links

@victranfield victranfield changed the title made changes to add greyed link colour - #6E6E73 WS-2176: made changes to add greyed link colour - #6E6E73 Apr 24, 2026
@victranfield victranfield changed the title WS-2176: made changes to add greyed link colour - #6E6E73 [WS-2176]: made changes to add greyed link colour - #6E6E73 Apr 24, 2026
Comment on lines +53 to +55
'&:visited': {
color: '#6E6E73 !important',
},
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes more sense added within the existing 'link' styles above, as it's targeting the link, so doesn't need its own style.

#6E6E73 also already exists within our colour palette under the name Metal ( you can see it in this file here ) , so you can access it using palette.METAL .

Whenever I am adding a colour to a style, i always do a search for it in the codebase to see if it is already named in that palette file first - that's how i found it here 😄

We also generally wouldnt use the !important declaration, we shouldn't need to be forcing the style.

Comment on lines +76 to +77
styles.visitedItem(),
isCurrentPage && styles.visitedItem(),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've suggested above that we remove visitedItem as an extra class so not relevant right now, but for future to apply style classes you dont need the () bracket notation. It would just be styles.visitedItem

also here, it will always be applied regardless of isCurrentPage 's value, as you have it listed twice, so your conditional won't work.

Comment on lines +53 to +55
const isCurrentPage =
typeof window !== 'undefined' && href.includes(window.location.pathname);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should need to do any of this, if a user is on a page that exists in the Most Read, then that link should count as 'visited' automatically (i think!) as this comes from the browser's history. So all we should need to do is add the &:visited selector to the link styles

Comment on lines +57 to +59
'&.is-current': {
color: '#6E6E73 !important',
},
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think i see what you're trying to do here, but this won't work or apply to anything as the class is-current doesn't exist anywhere. For this to work, you would need to apply this class to an element somewhere conditionally based on if it is a link to the current page. I don't think we should need to do this anyway, I've tried to explain why in my comment here

Copy link
Copy Markdown
Contributor

@Isabella-Mitchell Isabella-Mitchell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this - I agree with Em's comments. The :visited psuedo class does a lot of the heavy lifting for us fortunately! So we can simplify this a bit.

It might help as reference to see how we apply the :visited styles to an existing link component using the emotion syntax. I think this is a good example: src/app/components/ArticleLinksBlock/Promo/index.styles.tsx.

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 this pull request may close these issues.

3 participants