the latest code
This commit is contained in:
1 parent
d28bc1ed43
commit
9bbb24a52b
12226 files changed
+1455579
-21
No files matched your search
+21
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Tailwind Labs, Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
+76
@@ -0,0 +1,76 @@
|
||||
<p align="center">
|
||||
<a href="https://tailwindcss.com" target="_blank">
|
||||
<picture>
|
||||
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/tailwindlabs/tailwindcss/HEAD/.github/logo-dark.svg">
|
||||
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/tailwindlabs/tailwindcss/HEAD/.github/logo-light.svg">
|
||||
<img alt="Tailwind CSS" src="https://raw.githubusercontent.com/tailwindlabs/tailwindcss/HEAD/.github/logo-light.svg" width="350" height="70" style="max-width: 100%;">
|
||||
</picture>
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
A utility-first CSS framework for rapidly building custom user interfaces.
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/tailwindlabs/tailwindcss/actions"><img src="https://img.shields.io/github/actions/workflow/status/tailwindlabs/tailwindcss/ci.yml?branch=next" alt="Build Status"></a>
|
||||
<a href="https://www.npmjs.com/package/tailwindcss"><img src="https://img.shields.io/npm/dt/tailwindcss.svg" alt="Total Downloads"></a>
|
||||
<a href="https://github.com/tailwindcss/tailwindcss/releases"><img src="https://img.shields.io/npm/v/tailwindcss.svg" alt="Latest Release"></a>
|
||||
<a href="https://github.com/tailwindcss/tailwindcss/blob/master/LICENSE"><img src="https://img.shields.io/npm/l/tailwindcss.svg" alt="License"></a>
|
||||
</p>
|
||||
|
||||
---
|
||||
|
||||
## Documentation
|
||||
|
||||
For full documentation, visit [tailwindcss.com](https://tailwindcss.com).
|
||||
|
||||
## Community
|
||||
|
||||
For help, discussion about best practices, or feature ideas:
|
||||
|
||||
[Discuss Tailwind CSS on GitHub](https://github.com/tailwindcss/tailwindcss/discussions)
|
||||
|
||||
## Contributing
|
||||
|
||||
If you're interested in contributing to Tailwind CSS, please read our [contributing docs](https://github.com/tailwindcss/tailwindcss/blob/next/.github/CONTRIBUTING.md) **before submitting a pull request**.
|
||||
|
||||
---
|
||||
|
||||
## `@tailwindcss/vite` plugin API
|
||||
|
||||
### Enabling or disabling Lightning CSS
|
||||
|
||||
By default, this plugin detects whether or not the CSS is being built for production by checking the `NODE_ENV` environment variable. When building for production Lightning CSS will be enabled otherwise it is disabled.
|
||||
|
||||
If you want to always enable or disable Lightning CSS the `optimize` option may be used:
|
||||
|
||||
```js
|
||||
import tailwindcss from '@tailwindcss/vite'
|
||||
import { defineConfig } from 'vite'
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
tailwindcss({
|
||||
// Disable Lightning CSS optimization
|
||||
optimize: false,
|
||||
}),
|
||||
],
|
||||
})
|
||||
```
|
||||
|
||||
It's also possible to keep Lightning CSS enabled but disable minification:
|
||||
|
||||
```js
|
||||
import tailwindcss from '@tailwindcss/vite'
|
||||
import { defineConfig } from 'vite'
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
tailwindcss({
|
||||
// Enable Lightning CSS but disable minification
|
||||
optimize: { minify: false },
|
||||
}),
|
||||
],
|
||||
})
|
||||
```
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
import { Plugin } from 'vite';
|
||||
|
||||
type PluginOptions = {
|
||||
/**
|
||||
* Optimize and minify the output CSS.
|
||||
*/
|
||||
optimize?: boolean | {
|
||||
minify?: boolean;
|
||||
};
|
||||
};
|
||||
declare function tailwindcss(opts?: PluginOptions): Plugin[];
|
||||
|
||||
export { type PluginOptions, tailwindcss as default };
|
||||
+1
@@ -0,0 +1 @@
|
||||
var z=(r,s)=>(s=Symbol[r])?s:Symbol.for("Symbol."+r),O=r=>{throw TypeError(r)};var w=(r,s,e)=>{if(s!=null){typeof s!="object"&&typeof s!="function"&&O("Object expected");var t,d;e&&(t=s[z("asyncDispose")]),t===void 0&&(t=s[z("dispose")],e&&(d=t)),typeof t!="function"&&O("Object not disposable"),d&&(t=function(){try{d.call(this)}catch(f){return Promise.reject(f)}}),r.push([e,t,s])}else e&&r.push([e]);return s},P=(r,s,e)=>{var t=typeof SuppressedError=="function"?SuppressedError:function(u,g,n,l){return l=Error(n),l.name="SuppressedError",l.error=u,l.suppressed=g,l},d=u=>s=e?new t(u,s,"An error was suppressed during disposal"):(e=!0,u),f=u=>{for(;u=r.pop();)try{var g=u[1]&&u[1].call(u[2]);if(u[0])return Promise.resolve(g).then(f,n=>(d(n),f()))}catch(n){d(n)}if(e)throw s};return f()};import{compile as J,env as $,Features as b,Instrumentation as _,normalizePath as U,optimize as j,toSourceMap as A}from"@tailwindcss/node";import{clearRequireCache as K}from"@tailwindcss/node/require-cache";import{Scanner as T}from"@tailwindcss/oxide";import C from"fs/promises";import h from"path";import*as D from"vite";var c=$.DEBUG,x=/[?&](?:worker|sharedworker|raw|url)\b/,M=/\?commonjs-proxy/,B=/[?&]index\=\d+\.css$/;function q(r={}){let s=[],e=null,t=new E(n=>new Map),d=!1,f=!0,u=!0;function g(n,l){let i,a;if(n){let o=D.createIdResolver(n.config,{...n.config.resolve,extensions:[".css"],mainFields:["style"],conditions:["style","development|production"],tryIndex:!1,preferRelative:!0}),p=D.createIdResolver(n.config,n.config.resolve);i=(m,v)=>o(n,m,v,!0),a=(m,v)=>p(n,m,v,!0)}else{let o=e.createResolver({...e.resolve,extensions:[".css"],mainFields:["style"],conditions:["style","development|production"],tryIndex:!1,preferRelative:!0}),p=e.createResolver(e.resolve);i=(m,v)=>o(m,v,!0,d),a=(m,v)=>p(m,v,!0,d)}return new F(l,e.root,e?.css.devSourcemap??!1,i,a)}return[{name:"@tailwindcss/vite:scan",enforce:"pre",configureServer(n){s.push(n)},async configResolved(n){e=n,d=e.build.ssr!==!1&&e.build.ssr!==void 0,r.optimize!==void 0&&(f=r.optimize!==!1),u=f&&e.build.cssMinify!==!1,typeof r.optimize=="object"&&(u=r.optimize.minify!==!1)}},{name:"@tailwindcss/vite:generate:serve",apply:"serve",enforce:"pre",transform:{filter:{id:{exclude:[/\/\.vite\//,x,M],include:[/\.css(?:\?.*)?$/,/&lang\.css/,B]}},async handler(n,l){var m=[];try{if(!V(l))return;let i=w(m,new _);c&&i.start("[@tailwindcss/vite] Generate CSS (serve)");let a=t.get(this.environment?.name??"default");let o=a.get(l);o||(o??=g(this.environment??null,l),a.set(l,o));let p=await o.generate(n,R=>this.addWatchFile(R),i);if(!p)return a.delete(l),n;c&&i.end("[@tailwindcss/vite] Generate CSS (serve)");return p}catch(v){var S=v,y=!0}finally{P(m,S,y)}}}},{name:"@tailwindcss/vite:generate:build",apply:"build",enforce:"pre",transform:{filter:{id:{exclude:[/\/\.vite\//,x,M],include:[/\.css(?:\?.*)?$/,/&lang\.css/,B]}},async handler(n,l){var m=[];try{if(!V(l))return;let i=w(m,new _);c&&i.start("[@tailwindcss/vite] Generate CSS (build)");let a=t.get(this.environment?.name??"default");let o=a.get(l);o||(o??=g(this.environment??null,l),a.set(l,o));let p=await o.generate(n,R=>this.addWatchFile(R),i);if(!p)return a.delete(l),n;c&&i.end("[@tailwindcss/vite] Generate CSS (build)");f&&(c&&i.start("[@tailwindcss/vite] Optimize CSS"),p=j(p.code,{minify:u,map:p.map}),c&&i.end("[@tailwindcss/vite] Optimize CSS"));return p}catch(v){var S=v,y=!0}finally{P(m,S,y)}}}}]}function k(r){let[s]=r.split("?",2);return h.extname(s).slice(1)}function V(r){return r.includes("/.vite/")||x.test(r)||M.test(r)?!1:k(r)==="css"||r.includes("&lang.css")||r.match(B)}function G(r){return h.resolve(r.replace(/\?.*$/,""))}var E=class extends Map{constructor(e){super();this.factory=e}get(e){let t=super.get(e);return t===void 0&&(t=this.factory(e,this),this.set(e,t)),t}},F=class{constructor(s,e,t,d,f){this.id=s;this.base=e;this.enableSourceMaps=t;this.customCssResolver=d;this.customJsResolver=f}compiler;scanner;candidates=new Set;buildDependencies=new Map;async generate(s,e,t){let d=G(this.id);function f(i){i!==d&&(/[\#\?].*\.svg$/.test(i)||e(i))}let u=this.requiresBuild(),g=h.dirname(h.resolve(d));if(!this.compiler||!this.scanner||await u){K(Array.from(this.buildDependencies.keys())),this.buildDependencies.clear(),this.addBuildDependency(G(d)),c&&t.start("Setup compiler");let i=[];this.compiler=await J(s,{from:this.enableSourceMaps?this.id:void 0,base:g,shouldRewriteUrls:!0,onDependency:o=>{f(o),i.push(this.addBuildDependency(o))},customCssResolver:this.customCssResolver,customJsResolver:this.customJsResolver}),await Promise.all(i),c&&t.end("Setup compiler"),c&&t.start("Setup scanner");let a=(this.compiler.root==="none"?[]:this.compiler.root===null?[{base:this.base,pattern:"**/*",negated:!1}]:[{...this.compiler.root,negated:!1}]).concat(this.compiler.sources);this.scanner=new T({sources:a}),c&&t.end("Setup scanner")}else for(let i of this.buildDependencies.keys())f(i);if(!(this.compiler.features&(b.AtApply|b.JsPluginCompat|b.ThemeFunLine truncated
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"name": "@tailwindcss/vite",
|
||||
"version": "4.1.18",
|
||||
"description": "A utility-first CSS framework for rapidly building custom user interfaces.",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/tailwindlabs/tailwindcss.git",
|
||||
"directory": "packages/@tailwindcss-vite"
|
||||
},
|
||||
"bugs": "https://github.com/tailwindlabs/tailwindcss/issues",
|
||||
"homepage": "https://tailwindcss.com",
|
||||
"files": [
|
||||
"dist/"
|
||||
],
|
||||
"publishConfig": {
|
||||
"provenance": true,
|
||||
"access": "public"
|
||||
},
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/index.d.mts",
|
||||
"default": "./dist/index.mjs"
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@tailwindcss/node": "4.1.18",
|
||||
"tailwindcss": "4.1.18",
|
||||
"@tailwindcss/oxide": "4.1.18"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.19.0",
|
||||
"vite": "^7.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"vite": "^5.2.0 || ^6 || ^7"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsup-node",
|
||||
"dev": "pnpm run build -- --watch"
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user