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

docs: fix no-js dark theme bugs #16612

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

amareshsm
Copy link
Member

@amareshsm amareshsm commented Dec 4, 2022

Prerequisites checklist

What is the purpose of this pull request? (put an "X" next to an item)

[ ] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofix to a rule
[ ] Add a CLI option
[ ] Add something to the core
[x] Other, please explain:
Fixed no-js (js disabled) dark theme bugs.

What changes did you make? (Give an overview)

When javascript is disabled and the prefers-color-scheme is dark
1. code block texts are not visible.
2. Logo/tag text not inverted based on the theme.

Before After
image image
image image
image image
image image
image image

@amareshsm amareshsm requested a review from a team as a code owner December 4, 2022 18:21
@eslint-github-bot eslint-github-bot bot added documentation Relates to ESLint's documentation triage An ESLint team member will look at this issue soon labels Dec 4, 2022
@netlify
Copy link

netlify bot commented Dec 4, 2022

Deploy Preview for docs-eslint ready!

Name Link
🔨 Latest commit 5005a10
🔍 Latest deploy log https://app.netlify.com/sites/docs-eslint/deploys/6394d52929a13b0008a86304
😎 Deploy Preview https://deploy-preview-16612--docs-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Copy link
Member

@harish-sethuraman harish-sethuraman left a comment

Choose a reason for hiding this comment

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

LGTM thanks

Copy link
Member

@kecrily kecrily left a comment

Choose a reason for hiding this comment

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

I noticed that warning, tip blocks, etc. seem to be broken as well.

JS no-JS
image image
image image

@amareshsm amareshsm added accepted There is consensus among the team that this change meets the criteria for inclusion and removed triage An ESLint team member will look at this issue soon labels Dec 5, 2022
@amareshsm
Copy link
Member Author

I noticed that warning, tip blocks, etc. seem to be broken as well.

JS no-JS
image image
image image

Thanks. I will fix this also.

@amareshsm
Copy link
Member Author

I noticed that warning, tip blocks, etc. seem to be broken as well.

JS no-JS
image image
image image

Fixed.

@nzakas
Copy link
Member

nzakas commented Dec 26, 2022

@kecrily has your concern been addressed? If so, please approve and merge.

Copy link
Member

@kecrily kecrily left a comment

Choose a reason for hiding this comment

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

LGTM

@kecrily
Copy link
Member

kecrily commented Dec 27, 2022

@kecrily has your concern been addressed?

Sorry for the many notifications in my inbox that I didn't notice this update. I am looking for tools to improve this situation

If so, please approve and merge.

I've approved it, but I don't have the authority to merge

image

Copy link
Member

@mdjermanovic mdjermanovic left a comment

Choose a reason for hiding this comment

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

With dark mode preferred but light mode selected on the site, I'm getting a mix of light and dark themes:

image

@media (prefers-color-scheme: dark) {
pre[class*="language-"] {
color: var(--color-neutral-100);
}

.token {
&.comment,
.prolog,
.doctype,
.cdata {
color: #8e9fae;
}
}

.logo-component {
fill: #fff;
}

#logo-center {
opacity: 0.6;
}

.rule__categories,
.rule__status {
background: var(--body-background-color);
}

.algolia-docsearch-suggestion--highlight {
background-color: var(--link-color);
color: var(--color-neutral-900);
}

.alert {
&.alert--warning {
color: var(--color-rose-300);
background-color: var(--color-rose-900);
border: 1px solid var(--color-rose-300);
}

&.alert--important {
color: var(--color-warning-300);
background-color: var(--color-warning-900);
border: 1px solid var(--color-warning-300);
}

&.alert--tip {
color: var(--color-success-300);
background-color: var(--color-success-900);
border: 1px solid var(--color-success-300);
}
}

.alert__type,
.alert__learn-more {
.alert--warning & {
color: var(--color-rose-200);
}

.alert--important & {
color: var(--color-warning-200);
}

.alert--tip & {
color: var(--color-success-200);
}
}
}
Copy link
Member

@kecrily kecrily Dec 28, 2022

Choose a reason for hiding this comment

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

Adding a :not([data-theme="light"]) range would have solved the problem @mdjermanovic found.

Details
Suggested change
@media (prefers-color-scheme: dark) {
pre[class*="language-"] {
color: var(--color-neutral-100);
}
.token {
&.comment,
.prolog,
.doctype,
.cdata {
color: #8e9fae;
}
}
.logo-component {
fill: #fff;
}
#logo-center {
opacity: 0.6;
}
.rule__categories,
.rule__status {
background: var(--body-background-color);
}
.algolia-docsearch-suggestion--highlight {
background-color: var(--link-color);
color: var(--color-neutral-900);
}
.alert {
&.alert--warning {
color: var(--color-rose-300);
background-color: var(--color-rose-900);
border: 1px solid var(--color-rose-300);
}
&.alert--important {
color: var(--color-warning-300);
background-color: var(--color-warning-900);
border: 1px solid var(--color-warning-300);
}
&.alert--tip {
color: var(--color-success-300);
background-color: var(--color-success-900);
border: 1px solid var(--color-success-300);
}
}
.alert__type,
.alert__learn-more {
.alert--warning & {
color: var(--color-rose-200);
}
.alert--important & {
color: var(--color-warning-200);
}
.alert--tip & {
color: var(--color-success-200);
}
}
}
@media (prefers-color-scheme: dark) {
:not([data-theme="light"]) {
pre[class*="language-"] {
color: var(--color-neutral-100);
}
.token {
&.comment,
.prolog,
.doctype,
.cdata {
color: #8e9fae;
}
}
.logo-component {
fill: #fff;
}
#logo-center {
opacity: 0.6;
}
.rule__categories,
.rule__status {
background: var(--body-background-color);
}
.algolia-docsearch-suggestion--highlight {
background-color: var(--link-color);
color: var(--color-neutral-900);
}
.alert {
&.alert--warning {
color: var(--color-rose-300);
background-color: var(--color-rose-900);
border: 1px solid var(--color-rose-300);
}
&.alert--important {
color: var(--color-warning-300);
background-color: var(--color-warning-900);
border: 1px solid var(--color-warning-300);
}
&.alert--tip {
color: var(--color-success-300);
background-color: var(--color-success-900);
border: 1px solid var(--color-success-300);
}
}
.alert__type,
.alert__learn-more {
.alert--warning & {
color: var(--color-rose-200);
}
.alert--important & {
color: var(--color-warning-200);
}
.alert--tip & {
color: var(--color-success-200);
}
}
}
}

Copy link
Member Author

Choose a reason for hiding this comment

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

We can wrap it inside the no-js class. It will fix the issue I guess.

Copy link
Member

Choose a reason for hiding this comment

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

We can wrap it inside the no-js class. It will fix the issue I guess.

Sounds good to me. @kecrily what do you think?

Copy link
Member

Choose a reason for hiding this comment

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

Sounds good for me

@amareshsm amareshsm marked this pull request as draft January 18, 2023 15:13
@github-actions
Copy link

Hi everyone, it looks like we lost track of this pull request. Please review and see what the next steps are. This pull request will auto-close in 7 days without an update.

@github-actions github-actions bot added the Stale label Feb 20, 2023
@amareshsm
Copy link
Member Author

bump

@amareshsm amareshsm removed the Stale label Feb 21, 2023
@github-actions
Copy link

Hi everyone, it looks like we lost track of this pull request. Please review and see what the next steps are. This pull request will auto-close in 7 days without an update.

@github-actions github-actions bot added the Stale label Mar 10, 2023
@Rec0iL99
Copy link

@amareshsm is still working on this. Don't close.

@Rec0iL99 Rec0iL99 removed the Stale label Mar 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion documentation Relates to ESLint's documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants