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

feat: add system theme option #586

Merged
merged 14 commits into from
Jul 24, 2024

Conversation

akulsr0
Copy link
Contributor

@akulsr0 akulsr0 commented Jun 18, 2024

Prerequisites checklist

What is the purpose of this pull request?

Closes eslint/eslint#18190

What changes did you make? (Give an overview)

Add System button for theme switcher

Related Issues

Is there anything you'd like reviewers to focus on?

Translations, I've added by searching on google translate, can be double checked by reviewers.

Copy link

netlify bot commented Jun 18, 2024

Deploy Preview for hi-eslint ready!

Name Link
🔨 Latest commit 4c769b4
🔍 Latest deploy log https://app.netlify.com/sites/hi-eslint/deploys/669b66bbb7c3bc0008f0deaf
😎 Deploy Preview https://deploy-preview-586--hi-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 configuration.

Copy link

netlify bot commented Jun 18, 2024

Deploy Preview for es-eslint ready!

Name Link
🔨 Latest commit 4c769b4
🔍 Latest deploy log https://app.netlify.com/sites/es-eslint/deploys/669b66bbafe6d50008686f23
😎 Deploy Preview https://deploy-preview-586--es-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 configuration.

Copy link

netlify bot commented Jun 18, 2024

Deploy Preview for new-eslint ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 4c769b4
🔍 Latest deploy log https://app.netlify.com/sites/new-eslint/deploys/669b66bbaf6f6a0008660a67
😎 Deploy Preview https://deploy-preview-586--new-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 configuration.

Copy link

netlify bot commented Jun 18, 2024

Deploy Preview for zh-hans-eslint ready!

Name Link
🔨 Latest commit 4c769b4
🔍 Latest deploy log https://app.netlify.com/sites/zh-hans-eslint/deploys/669b66bbc69d9f0008ecf6c4
😎 Deploy Preview https://deploy-preview-586--zh-hans-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 configuration.

Copy link

netlify bot commented Jun 18, 2024

Deploy Preview for pt-br-eslint ready!

Name Link
🔨 Latest commit 4c769b4
🔍 Latest deploy log https://app.netlify.com/sites/pt-br-eslint/deploys/669b66bb306cf400085dcd68
😎 Deploy Preview https://deploy-preview-586--pt-br-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 configuration.

Copy link

netlify bot commented Jun 18, 2024

Deploy Preview for fr-eslint ready!

Name Link
🔨 Latest commit 4c769b4
🔍 Latest deploy log https://app.netlify.com/sites/fr-eslint/deploys/669b66bbc2d39a0008ea9a14
😎 Deploy Preview https://deploy-preview-586--fr-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 configuration.

Copy link

netlify bot commented Jun 18, 2024

Deploy Preview for ja-eslint ready!

Name Link
🔨 Latest commit 4c769b4
🔍 Latest deploy log https://app.netlify.com/sites/ja-eslint/deploys/669b66bb2bdcf000080d8e4c
😎 Deploy Preview https://deploy-preview-586--ja-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 configuration.

Copy link

netlify bot commented Jun 18, 2024

Deploy Preview for de-eslint ready!

Name Link
🔨 Latest commit 4c769b4
🔍 Latest deploy log https://app.netlify.com/sites/de-eslint/deploys/669b66bbf3b5d80008bddb10
😎 Deploy Preview https://deploy-preview-586--de-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 configuration.

@snitin315
Copy link
Contributor

@akulsr0 The npm run build script is failing, can you fix it?

@akulsr0
Copy link
Contributor Author

akulsr0 commented Jun 20, 2024

@snitin315 This is fixed, translation was missing for other languages, added it.

src/assets/js/themes.js Outdated Show resolved Hide resolved
@amareshsm
Copy link
Member

amareshsm commented Jun 20, 2024

Thank you for the PR.

Here are a few suggestions:

  1. Instead of adding a new key system-theme, use the existing theme key and set its value to "system" when the user selects the system theme.
  2. The data-system-theme attribute is unnecessary.
  3. In tablet view, the new system button causes the language selection option to be cropped in the UI. Alt text

Pls refer to this PR eslint/eslint#18617 I have made the changes for https://eslint.org/docs/

Copy link
Contributor

@Tanujkanti4441 Tanujkanti4441 left a comment

Choose a reason for hiding this comment

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

Screenshot 2024-06-23 163912

the footer is still going out of the screen can you fix this also?

@nzakas
Copy link
Member

nzakas commented Jul 12, 2024

@Tanujkanti4441 @harish-sethuraman @amareshsm it looks like there have been updates since your last comments. Can you please re-check?

@amareshsm
Copy link
Member

@Tanujkanti4441 @harish-sethuraman @amareshsm it looks like there have been updates since your last comments. Can you please re-check?

Thanks for the reminder. I'll re-check.

@amareshsm
Copy link
Member

amareshsm commented Jul 13, 2024

The functionality works as expected, but there are redundancies in the theme.js file that need to be removed. Refer to this commit - eslint/eslint@7e724bb

In the playground, the theme option is going out of the screen

image

Copy link
Member

@amareshsm amareshsm left a comment

Choose a reason for hiding this comment

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

image

At 800px, the select option is being cut off and is not fully visible on the screen.

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. Will wait for other reviews to be closed

Copy link
Member

@amareshsm amareshsm left a comment

Choose a reason for hiding this comment

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

Thanks 🎉, LGTM.

@amareshsm amareshsm merged commit 7def673 into eslint:main Jul 24, 2024
37 checks passed
zhangenming pushed a commit to zhangenming/eslint.org that referenced this pull request Jul 26, 2024
* feat: add system theme option

* chore: add translations for system word

* chore: handle playground theming

* refactor: remove seperate key for system theme

* refactor: remove unintended semicolon

* chore: add `aria-hidden=true` to svg icon

* chore: add `aria-hidden=true` to svg icon

* fix: footer language option getting out of screen

* refactor: formatting fix

* refactor: pr review changes

* chore: theme switcher padding fix

* refactor: pr review changes

* fix: lang select cutting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Docs: Option to use system preference for light/dark theme
6 participants