|
| 1 | +--- |
| 2 | +title : To use 10000+ difference theming in the section blog theme. |
| 3 | + |
| 4 | +--- |
| 5 | + |
| 6 | +The section blog theme is based on [Shadcn UI](https://ui.shadcn.com/docs/theming), and Shadcn UI has the functionality to use different themes. |
| 7 | +Official Shadcn UI has two themes: the first is the default, and the second is the New York theme. |
| 8 | + |
| 9 | +There are tons of themes available for Shadcn UI on the internet. |
| 10 | +The [ui.jln.dev](https://ui.jln.dev/) website offers you more than 10000 custom Shadcn UI. You can use different themes in the section blog theme with copy-paste code. |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | +## How to use the custom theme in the section blog theme? |
| 15 | + |
| 16 | +You can copy any theme on ui.jln.dev website, paste in the global CSS file without **@layer directive**. |
| 17 | + |
| 18 | +```css filename="globals.css" |
| 19 | + :root { |
| 20 | + --card: 287 70% 98%; |
| 21 | + --ring: 287 66% 82%; |
| 22 | + --input: 220 13% 91%; |
| 23 | + --muted: 47 39% 88%; |
| 24 | + --accent: 167 66% 82%; |
| 25 | + --border: 220 13% 91%; |
| 26 | + --popover: 287 70% 99%; |
| 27 | + --primary: 287 66% 82%; |
| 28 | + --secondary: 47 66% 82%; |
| 29 | + --background: 287 70% 99%; |
| 30 | + --foreground: 287 53% 0%; |
| 31 | + --destructive: 20 81% 21%; |
| 32 | + --card-foreground: 0 0% 0%; |
| 33 | + --muted-foreground: 47 0% 36%; |
| 34 | + --accent-foreground: 167 66% 22%; |
| 35 | + --popover-foreground: 287 53% 0%; |
| 36 | + --primary-foreground: 287 66% 22%; |
| 37 | + --secondary-foreground: 47 66% 22%; |
| 38 | + --destructive-foreground: 20 81% 81%; |
| 39 | + --radius: 0.5rem; |
| 40 | + } |
| 41 | + |
| 42 | + .dark { |
| 43 | + --card: 287 55% 4%; |
| 44 | + --ring: 287 66% 82%; |
| 45 | + --input: 215 27.9% 16.9%; |
| 46 | + --muted: 47 39% 12%; |
| 47 | + --accent: 167 66% 82%; |
| 48 | + --border: 215 27.9% 16.9%; |
| 49 | + --popover: 287 55% 3%; |
| 50 | + --primary: 287 66% 82%; |
| 51 | + --secondary: 47 66% 82%; |
| 52 | + --background: 287 55% 3%; |
| 53 | + --foreground: 287 33% 98%; |
| 54 | + --destructive: 20 81% 47%; |
| 55 | + --card-foreground: 287 33% 99%; |
| 56 | + --muted-foreground: 47 0% 64%; |
| 57 | + --accent-foreground: 167 66% 22%; |
| 58 | + --popover-foreground: 287 33% 98%; |
| 59 | + --primary-foreground: 287 66% 22%; |
| 60 | + --secondary-foreground: 47 66% 22%; |
| 61 | + --destructive-foreground: 0 0% 100%; |
| 62 | + } |
| 63 | + |
| 64 | +``` |
| 65 | + |
| 66 | + |
| 67 | +## Why is Dark mode not working with the section blog theme with tailwind CSS? |
| 68 | +If you create your project using create-next-app, then remove the following code from your tailwind globals.css file. It creates conflict with Shadcn UI CSS variables. |
| 69 | + |
| 70 | + |
| 71 | +```css {5, 7-29} filename="globals.css" |
| 72 | +@tailwind base; |
| 73 | +@tailwind components; |
| 74 | +@tailwind utilities; |
| 75 | + |
| 76 | +/* Remove/uncomment the bellow code. */ |
| 77 | + |
| 78 | +:root { |
| 79 | + --foreground-rgb: 0, 0, 0; |
| 80 | + --background-start-rgb: 214, 219, 220; |
| 81 | + --background-end-rgb: 255, 255, 255; |
| 82 | +} |
| 83 | + |
| 84 | +@media (prefers-color-scheme: dark) { |
| 85 | + :root { |
| 86 | + --foreground-rgb: 255, 255, 255; |
| 87 | + --background-start-rgb: 0, 0, 0; |
| 88 | + --background-end-rgb: 0, 0, 0; |
| 89 | + } |
| 90 | +} |
| 91 | + |
| 92 | +body { |
| 93 | + color: rgb(var(--foreground-rgb)); |
| 94 | + background: linear-gradient( |
| 95 | + to bottom, |
| 96 | + transparent, |
| 97 | + rgb(var(--background-end-rgb)) |
| 98 | + ) |
| 99 | + rgb(var(--background-start-rgb)); |
| 100 | +} |
| 101 | + |
| 102 | + |
| 103 | +``` |
0 commit comments