Skip to content

Configuration

GaleforceCSS reads your existing tailwind.config.{js,cjs,mjs,ts} unchanged. No migration required.

js
/** @type {import('tailwindcss').Config} */
export default {
  content: ['./src/**/*.{html,js,jsx,ts,tsx,vue,svelte}'],
  theme: {
    extend: {
      colors: { brand: '#3b82f6' },
      fontFamily: { sans: ['Inter', 'sans-serif'] },
    },
  },
  plugins: [require('@tailwindcss/forms')],
  darkMode: 'class',
  prefix: '',
}

Supported fields

FieldStatus
contentUsed by the scanner when no explicit content option is passed to the plugin/CLI.
theme / theme.extendMerged + resolved; theme() calls resolved at compile time.
pluginsaddUtilities, addComponents, addBase, addVariant, matchUtilities, matchComponents, matchVariant.
darkMode'media', 'class', 'selector'.
prefixFull — prefix: 'tw-' prefixes every utility (including @apply targets).
corePluginsObject and array forms. preflight: false skips the preflight reset.
separatorCustom variant separator (default :).

Plugins

Each plugin runs through a JS-side recording context that captures addUtilities, matchUtilities, addVariant, etc., and feeds the calls into the Rust compiler. Standard plugins (@tailwindcss/forms, @tailwindcss/typography, @tailwindcss/aspect-ratio) work unchanged.

Plugins that manipulate the PostCSS AST beyond the shim's surface emit a warning in diagnostics and produce no output.

TypeScript configs

.ts configs load via jiti. No setup needed.

theme() and @apply

css
.my-element {
  color: theme('colors.blue.500');
  font-size: theme('fontSize.lg');
}

.btn {
  @apply px-4 py-2 rounded bg-blue-600 text-white;
  @apply hover:bg-blue-700;
  @apply focus:outline-none focus:ring-2;
}

@apply honors variants and the configured prefix. The opacity shorthand (theme('colors.red.500/50')) is not yet supported — use a separate bg-opacity utility.

Known limitations

  • Third-party plugins that manipulate the PostCSS AST beyond walkRules / modifySelectors.
  • theme() opacity shorthand.
  • Object-form screen configs ({ md: { min: '768px', max: '1023px' } }).
  • Nested @layer inside @media / @supports.

See Unsupported features for the full list.

Vite plugin options

ts
galeforcecss({
  input?: string        // CSS entry. Default: 'src/index.css'
  config?: string       // tailwind.config path. Default: auto-discovered
  content?: string[]    // Content roots. Default: from tailwind.config `content`
  minify?: boolean      // Default: Vite's build.cssMinify
  sourceMap?: boolean   // Default: Vite's build.sourcemap
  targets?: object      // Lightning CSS browser targets
  virtualId?: string    // Default: 'virtual:galeforcecss.css'
})

CLI flags (build / watch)

FlagDefaultDescription
--input / -isrc/index.cssCSS entry containing @tailwind directives.
--output / -ostdoutOutput path.
--configautotailwind.config.{js,cjs,mjs,ts} path.
--content.Content root (repeatable).
--verboseoffPrint diagnostics + timing to stderr.
--diagnostics <path>offWrite diagnostics JSON. Use - for stderr.

Node API — CompileInput

ts
{
  candidates?: string[]   // Class names to compile directly
  inputCss?: string       // CSS with @tailwind directives
  config?: object         // Resolved Tailwind config
  content?: string[]      // Content roots (alternative to candidates)
}

Environment variables

VariableDescription
GALEFORCE_CLI_BINOverride the path to the galeforcecss binary.
GALEFORCE_DEBUGSet to 1 for scan/compile timing on every build.
GALEFORCE_LOGSet to debug for verbose compiler output.

Released under the MIT License.