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

💄 add root background style #112

Merged
merged 1 commit into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ export async function generateMetadata(): Promise<Metadata> {
function HtmlLayout({ children }: React.PropsWithChildren) {
return (
<Html>
<body className="body-bg dark:body-bg-dark">
<body>
<div className="root-background fixed inset-0 -z-50"></div>
<Providers>{children}</Providers>
</body>
</Html>
Expand Down
33 changes: 18 additions & 15 deletions tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,29 +37,32 @@ const tailwindcssConfig = {
},
plugins: [
require('@tailwindcss/typography'),
plugin(({ addUtilities }) => {
addUtilities({
'.body-bg': {
'--color': 'rgba(0, 0, 0, 0.1)',
plugin(({ addComponents, theme }) => {
addComponents({
'.root-background': {
'--base-color': theme('colors.zinc.100'),
'--line-color': 'rgba(0, 0, 0, 0.04)',
background: `
linear-gradient(
to left,
var(--color) 0,
var(--color) 1px,
transparent 1px,
transparent 10px
var(--line-color) 0,
var(--line-color) 10%,
transparent 10%,
transparent 100%
),
linear-gradient(
to top,
var(--color) 0,
var(--color) 1px,
transparent 1px,
transparent 10px
);`,
var(--line-color) 0,
var(--line-color) 10%,
transparent 10%,
transparent 100%
),
var(--base-color);`,
backgroundSize: '10px 10px;'
},
'.body-bg-dark': {
'--color': 'rgba(255, 255, 255, 0.05)',
'.dark .root-background': {
'--base-color': theme('colors.zinc.900'),
'--line-color': 'rgba(255, 255, 255, 0.04)',
}
})
})
Expand Down
Loading