Skip to content

Commit 8bdf01c

Browse files
committed
feat: init cssConfig
1 parent b4ca4eb commit 8bdf01c

16 files changed

+1099
-55
lines changed

README.md

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1 @@
1-
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).
2-
3-
## Getting Started
4-
5-
First, run the development server:
6-
7-
```bash
8-
npm run dev
9-
# or
10-
yarn dev
11-
# or
12-
pnpm dev
13-
# or
14-
bun dev
15-
```
16-
17-
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
18-
19-
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
20-
21-
This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.
22-
23-
## Learn More
24-
25-
To learn more about Next.js, take a look at the following resources:
26-
27-
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
28-
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
29-
30-
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!
31-
32-
## Deploy on Vercel
33-
34-
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
35-
36-
Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
1+
blog

eslint.config.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const reactHooks = require('eslint-plugin-react-hooks');
77
const { resolve } = require('path');
88
module.exports = [
99
{
10-
ignores: ['node_modules/**', '.next/**', './eslint.config.cjs', '.gitignore','analyze/**'],
10+
ignores: ['node_modules/**', '.next/**', './eslint.config.cjs', '.gitignore', 'analyze/**','plugins/**/*'],
1111
},
1212
{
1313
files: ['**/*.{js,jsx,ts,tsx}'],

next.config.mjs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
/** @type {import('next').NextConfig} */
2-
import NextBundleAnalyzer from '@next/bundle-analyzer'
2+
import NextBundleAnalyzer from '@next/bundle-analyzer';
33

44
let nextConfig = {};
55

6-
if(process.env.ANALYZE === 'true'){
6+
if (process.env.ANALYZE === 'true') {
77
nextConfig = NextBundleAnalyzer({
88
enabled: true,
9-
})(nextConfig)
9+
})(nextConfig);
1010
}
1111

12-
1312
export default nextConfig;

package.json

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,21 @@
1414
"analyze": "set ANALYZE=true && set BUNDLE_ANALYZE=browser && npm run build"
1515
},
1616
"dependencies": {
17+
"@egoist/tailwindcss-icons": "^1.8.1",
18+
"@iconify-json/material-symbols": "^1.2.4",
19+
"@iconify-json/mingcute": "^1.2.1",
1720
"@next/bundle-analyzer": "^14.2.15",
1821
"@types/prettier": "^3.0.0",
22+
"daisyui": "^4.12.13",
1923
"next": "14.2.15",
24+
"postcss-js": "^4.0.1",
2025
"prettier": "3.3.2",
2126
"react": "^18",
22-
"react-dom": "^18"
27+
"react-dom": "^18",
28+
"tailwind-scrollbar": "^3.1.0",
29+
"tailwind-variants": "^0.2.1",
30+
"tailwindcss-animate": "^1.0.7",
31+
"tailwindcss-animated": "^1.1.2"
2332
},
2433
"devDependencies": {
2534
"@commitlint/cli": "^19.4.1",
@@ -57,7 +66,7 @@
5766
"nextBundleAnalysis": {
5867
"budget": 358400,
5968
"budgetPercentIncreaseRed": 20,
60-
"minimumChangeThreshold":102400,
69+
"minimumChangeThreshold": 102400,
6170
"showDetails": true
6271
}
63-
}
72+
}

plugins/tw-css-plugin.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// https://github.com/tailwindlabs/tailwindcss-intellisense/issues/227#issuecomment-1462034856
2+
// cssAsPlugin.js
3+
const postcss = require('postcss');
4+
const postcssJs = require('postcss-js');
5+
const { readFileSync } = require('node:fs');
6+
7+
require.extensions['.css'] = function (module, filename) {
8+
const cssAsPlugin = ({ addBase, addComponents, addUtilities }) => {
9+
const css = readFileSync(filename, 'utf8');
10+
const root = postcss.parse(css);
11+
const jss = postcssJs.objectify(root);
12+
13+
if ('@layer base' in jss) {
14+
addBase(jss['@layer base']);
15+
}
16+
if ('@layer components' in jss) {
17+
addComponents(jss['@layer components']);
18+
}
19+
if ('@layer utilities' in jss) {
20+
addUtilities(jss['@layer utilities']);
21+
}
22+
};
23+
module.exports = cssAsPlugin;
24+
};

0 commit comments

Comments
 (0)