mirror of
https://github.com/longbridge/developers.git
synced 2026-09-19 03:34:09 +08:00
e772d79d17
## Summary - Fix UnoCSS build error: `[font-feature-settings:'tnum']` arbitrary class causes "Unknown word tnum&" — moved to static `style` attribute - Fix PostCSS crash: add `result.root` null guard in `postcss.config.mjs` - Simplify pricing page frontmatter titles to "Pricing / 定价 / 定價" ## Test plan - [ ] Verify `bun run build:release` completes without errors - [ ] Verify pricing page renders correctly in all three locales 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
31 lines
877 B
JavaScript
31 lines
877 B
JavaScript
import tailwindcss from '@tailwindcss/postcss'
|
|
|
|
// Wrap @tailwindcss/postcss so it only processes files that contain
|
|
// `@import "tailwindcss"`. This prevents it from interfering with
|
|
// UnoCSS's @apply handling in Vue SFC <style> blocks.
|
|
const twPlugin = tailwindcss()
|
|
|
|
function gatedTailwind() {
|
|
const inner = typeof twPlugin === 'function' ? twPlugin() : twPlugin
|
|
return {
|
|
postcssPlugin: 'gated-tailwindcss',
|
|
prepare(result) {
|
|
if (!result.root) return {}
|
|
const css = result.root.toString()
|
|
// Only run Tailwind if the file imports tailwindcss
|
|
if (!css.includes('@import "tailwindcss"') && !css.includes("@import 'tailwindcss'")) {
|
|
return {}
|
|
}
|
|
if (inner.prepare) {
|
|
return inner.prepare(result)
|
|
}
|
|
return inner
|
|
},
|
|
}
|
|
}
|
|
gatedTailwind.postcss = true
|
|
|
|
export default {
|
|
plugins: [gatedTailwind],
|
|
}
|