Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
added Nightwind dark mode
- Loading branch information
Showing
12 changed files
with
8,159 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,29 +1,3 @@ | ||
| # Tailwind CSS Documentation | ||
| # Tailwind CSS Website - Nightwind dark mode | ||
|
|
||
| Tailwind CSS uses [Next.js](https://nextjs.org/) for its documentation. Here is how you can run the project locally: | ||
|
|
||
| 1. Clone this repo | ||
|
|
||
| ```sh | ||
| git clone https://github.com/tailwindlabs/tailwindcss.com.git | ||
| ``` | ||
|
|
||
| 2. Go into the project root directory | ||
|
|
||
| ```sh | ||
| cd tailwindcss.com | ||
| ``` | ||
|
|
||
| 3. Install JS dependencies | ||
|
|
||
| ```sh | ||
| yarn | ||
| ``` | ||
|
|
||
| 4. Start the dev server | ||
|
|
||
| ```sh | ||
| yarn dev | ||
| ``` | ||
|
|
||
| Alternatively you can generate a static export of the documentation using the `yarn export` command. The export will be saved in the `out` folder. | ||
| This is a clone of the original Tailwind CSS website, which also has an automatic dark mode generated using Nightwind. |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| import { useTheme } from 'next-themes' | ||
|
|
||
| export default function Nightwind(props) { | ||
| const { theme, setTheme } = useTheme() | ||
|
|
||
| const toggle = () => { | ||
| if (!document.documentElement.classList.contains('dark')) { | ||
| setTheme('dark') | ||
| } else { | ||
| setTheme('light') | ||
| } | ||
| } | ||
|
|
||
| return ( | ||
| <svg | ||
| width="140" | ||
| height="140" | ||
| viewBox="0 0 140 140" | ||
| fill="none" | ||
| onClick={toggle} | ||
| className={`${props.size || 'h-10'} w-auto cursor-pointer group mx-auto z-10`} | ||
| > | ||
| <circle | ||
| cx="70" | ||
| cy="70" | ||
| r="70" | ||
| fill="currentColor" | ||
| className={`${theme === 'dark' ? 'text-yellow-600' : 'text-blue-600'}`} | ||
| /> | ||
| <path | ||
| fillRule="evenodd" | ||
| clipRule="evenodd" | ||
| d="M82.5612 138.876C55.6458 126.762 37 100.476 37 70C37 39.5244 55.6458 13.2383 82.5613 1.1239C115.227 7.04239 140 35.6281 140 70C140 104.372 115.227 132.958 82.5612 138.876Z" | ||
| fill="currentColor" | ||
| className={`${ | ||
| theme === 'dark' | ||
| ? 'text-blue-400 group-hover:text-yellow-400' | ||
| : 'text-yellow-300 group-hover:text-blue-200' | ||
| }`} | ||
| /> | ||
| </svg> | ||
| ) | ||
| } |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
00d6f1fThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
nightwind – ./nightwindcss.com
nightwind.jacoporanalli.vercel.app
nightwind-git-master.jacoporanalli.vercel.app
nightwind.vercel.app
nightwindcss.com
00d6f1fThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
tailwindcss – ./tailwindcss.com
tailwindcss-git-master.jacoporanalli.vercel.app
tailwindcss.jacoporanalli.vercel.app
tailwindcss-ten.vercel.app