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

--sgds-nav-link-color is not defined #278

Open
2 tasks done
clye-cog opened this issue Nov 4, 2024 · 2 comments
Open
2 tasks done

--sgds-nav-link-color is not defined #278

clye-cog opened this issue Nov 4, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@clye-cog
Copy link

clye-cog commented Nov 4, 2024

Prerequisites

Describe the issue

Somehow, getting an error with --sgds-nav-link-color is not defined is not defined. When we try to implement the .nav class, it the variable works. Is it something we missed on our end?

image

Recording:

styling-sgds_nav.mp4

What operating system(s) are you seeing the problem on?

macOS

What browser(s) are you seeing the problem on?

Chrome

Describe your frontend stack. What version of React and @govtechsg/sgds-react are you using? CSR or SSR?

NextJS, typescript, react. sgds v2.7.3

@clye-cog clye-cog added the bug Something isn't working label Nov 4, 2024
@clye-cog clye-cog changed the title --sgds-nav-link-hover-color is not defined --sgds-nav-link-color is not defined Nov 4, 2024
@clukhei
Copy link
Collaborator

clukhei commented Nov 5, 2024

@clye-cog .nav-link class selector should only be used as a child of .nav. The .nav css selector defines the value of css variable --sgds-nav-link-color, without .nav parent the variable will have no value when using .nav-link alone.

meaning you will need to

<Nav>
<Nav.Link></Nav.Link> 
</Nav> 

however, this case seems like a standalone link instead of being part of a navigation group (Nav is usually for a group of links), you can directly use <a href=...> </a> and it will have the sgds link color.

if u decide to use Nav and Nav.Link , then please wait for me to do an update to the next patch version for a small UI fix.

@clye-cog
Copy link
Author

clye-cog commented Nov 6, 2024

Ah okay thanks for explaining! We'll just go ahead to use <a href=...> </a>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants