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

[#556]: Fix text visibility in Dark mode on 404 page #557

Merged
merged 4 commits into from
Oct 7, 2024

Conversation

sergiozeppo
Copy link
Contributor

@sergiozeppo sergiozeppo commented Sep 28, 2024

Hi there, Hexlet team!
I found the issue and I'm fixing it by myself
Fixes #556

The page is looking better now:
изображение


function NotFound() {
const { t: tPNF } = useTranslation('translation', {
keyPrefix: 'pageNotFound',
});
const { isDarkMode } = useTernaryDarkMode();
const paragraphClass = `fs-5 mb-3 text-${isDarkMode ? 'white' : 'black'}`;
Copy link
Contributor

Choose a reason for hiding this comment

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

@sergiozeppo do we have bootstrap themes? I think we can use bootstrap css variables/classes that changes color depends on theme

@sergiozeppo
Copy link
Contributor Author

@sergiozeppo do we have bootstrap themes? I think we can use bootstrap css variables/classes that changes color depends on theme

Hi, @fey ! Check now, please. As I can say, code has become more concise and convenient, thanks!

Also, I don't know where to define the new class, so created the file. If it's not a good practice for Hexlet, let me know, where I should have defined it, and I'll fix it.

@@ -19,11 +22,11 @@ function NotFound() {
</div>
<div className="col">
<h1 className="mb-4">{tPNF('title')}</h1>
<p className="fs-5 text-black mb-3">{tPNF('whatHappened.title')}</p>
Copy link
Contributor

Choose a reason for hiding this comment

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

@sergiozeppo i watched code and current behavior and consider that we can just remove text-black color classes and do not add another. It will work well on dark and white theme.

BTW bootstrap has class for default color https://getbootstrap.com/docs/5.3/utilities/colors/ .text-body

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i watched code and current behavior and consider that we can just remove text-black color classes and do not add another. It will work well on dark and white theme.

Hi there, @fey ! You was totally right, deleted all of this unnecessary stuff. Works as intended.

BTW bootstrap has class for default color https://getbootstrap.com/docs/5.3/utilities/colors/ .text-body

Thanks for remark!

@fey fey merged commit caee6cf into hexlet-rus:main Oct 7, 2024
@fey
Copy link
Contributor

fey commented Oct 7, 2024

@HelenOne deploy pls

@sergiozeppo sergiozeppo deleted the sergiozeppo/fix404DarkTheme branch October 10, 2024 05:27
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.

Bug: Poorly visible text on 404 page when using dark theme
2 participants