Files
longbridge__developers/docs/postcss.config.mjs
Jason Lee e772d79d17 fix(pricing): fix UnoCSS build errors and update page titles (#955)
## 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>
2026-05-07 21:46:36 +08:00

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],
}