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

Icon Confusion on the Website: Analyzing the Light/Dark Mode Switch #646

Open
1 task done
Koushik1311 opened this issue Oct 21, 2023 · 1 comment
Open
1 task done
Labels
enhancement New feature or request gssoc23 This label aids in the tracking of issues for octabot used by GSSoC'23 for tracking.

Comments

@Koushik1311
Copy link

Detailed description

In night mode it should show the moon icon and in light mode, it should show the sun icon.

Light Mode:
vibey Light

Dark Mode:
vibey Dark

Context

Many websites maintain this format.
Like TailwindCSS: https://tailwindcss.com/

Light Mode:
tail light

Dark Mode:
tail dark

Possible implementation

Have to change some CSS class

Old Code:

<button
        className="flex aspect-square w-10 items-center justify-center rounded-full border border-gray-900/30 bg-gray-900 p-2 text-gray-50 dark:border-gray-50/30 dark:bg-gray-50 dark:text-gray-900"
        onClick={() =>
          setTheme(
            theme === 'light'
              ? 'dark'
              : sysMode === 'light' && theme === 'system'
              ? 'dark'
              : 'light'
          )
        }
      >
        <Svg.sun className="rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0" />
        <Svg.moon className="absolute rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100" />
        <span className="sr-only">Dark and Light Mode</span>
      </button>

Fix Code:

<button
        className="flex aspect-square w-10 items-center justify-center rounded-full border border-gray-900/30 bg-gray-50 p-2 text-gray-900 dark:border-gray-50/30 dark:bg-gray-900 dark:text-gray-50"
        onClick={() =>
          setTheme(
            theme === 'light'
              ? 'dark'
              : sysMode === 'light' && theme === 'system'
              ? 'dark'
              : 'light'
          )
        }
      >
        <Svg.sun className="rotate-0 scale-0 transition-all dark:-rotate-90 dark:scale-100" />
        <Svg.moon className="absolute rotate-90 scale-100 transition-all dark:rotate-0 dark:scale-0" />
        <span className="sr-only">Dark and Light Mode</span>
      </button>

Additional information

No Additional Information.

Can you assign this issue to me?

Code of Conduct

  • I agree to follow this project's Code of Conduct
@Koushik1311 Koushik1311 added the enhancement New feature or request label Oct 21, 2023
@github-actions
Copy link

To reduce notifications, issues are locked. Your issue will be unlock when we will add label as status: ready for dev. Check out the contributing guide for more information.

@github-actions github-actions bot added the gssoc23 This label aids in the tracking of issues for octabot used by GSSoC'23 for tracking. label Oct 21, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Oct 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request gssoc23 This label aids in the tracking of issues for octabot used by GSSoC'23 for tracking.
Projects
None yet
Development

No branches or pull requests

1 participant