nuxt-ui-colors-no-inline

Nuxt module that ensures nuxt-ui-colors CSS generated by Nuxt UI respects the Nuxt inlineStyles feature when disabled.
1,609 2
Install
npm install nuxt-ui-colors-no-inline
Latest Version:0.0.6
Vue:3
License:MIT
Last Updated:Sep 16, 2026
Links: GitHub  ·  npm
Maintainer: yizack

nuxt-ui-colors-no-inline

Nuxt module that ensures nuxt-ui-colors CSS generated by Nuxt UI respects the Nuxt inlineStyles feature when disabled.

[!NOTE] This module works only with inlineStyles: false feature in your Nuxt config. Without this setting, it defers to Nuxt UI's default behavior.

Quick setup

  1. Add nuxt-ui-colors-no-inline dependency to your project
# Using pnpm
pnpm add -D nuxt-ui-colors-no-inline

# Using yarn
yarn add --dev nuxt-ui-colors-no-inline

# Using npm
npm install --save-dev nuxt-ui-colors-no-inline
  1. Add the module in your nuxt.config.ts after @nuxt/ui:
export default defineNuxtConfig({
  modules: [
    '@nuxt/ui',
    'nuxt-ui-colors-no-inline'
  ],
  features: {
    inlineStyles: false
  },
})

Options

This module augments the ui module options in nuxt.config.ts with a new colors property for static color customization, instead of using app.config.ts.

export default defineNuxtConfig({
  modules: [
    '@nuxt/ui',
    'nuxt-ui-colors-no-inline'
  ],
  features: {
    inlineStyles: false
  },
  ui: {
    // '@nuxt/ui' module options
    colorMode: true,
    fonts: true,
    // ...
    // 'nuxt-ui-colors-no-inline' module options
    colors: {
      neutral: "zinc",
      primary: "emerald",
      secondary: "violet",
      error: "red"
    }
  }
})

Why?

By default, Nuxt UI uses a colors plugin to inject a <style id="nuxt-ui-colors"> tag in the <head> of your pages, even when inlineStyles feature is disabled.

If you're particular about clean HTML with no inline styles, this module is for you. It removes Nuxt UI's colors plugin and generates a separate CSS file that is included in your app's main CSS entry instead, fully respecting the inlineStyles feature config.

Caveats

  • Since CSS is generated at build time into a static file, you can no longer dynamically update colors at runtime by targeting #nuxt-ui-colors. To change colors dynamically, you must manually inject a new <style> tag into <head> with the updated CSS variables.
  • In development, the separate CSS file is always generated since inlineStyles is disabled by default in dev mode. In production, it is only generated when inlineStyles: false is set in your Nuxt config.
  • Color customization must be defined statically via the augmented colors property under ui in nuxt.config.ts, since the CSS is generated at build time and cannot pick up runtime app.config.ts changes.
  • Color changes require a dev server restart to take effect. If you frequently tweak colors during development, consider temporarily removing this module from your Nuxt config.

Credits

Development

# Install dependencies
pnpm install

# Generate type stubs
pnpm run dev:prepare

# Develop with the playground
pnpm run dev

# Build the playground
pnpm run dev:build

# Run ESLint
pnpm run lint

# Run Vitest
pnpm run test
pnpm run test:watch

# Release new version
pnpm run release

Related Packages

@scayle/storefront-nuxt

Nuxt integration for the SCAYLE Commerce Engine and Storefront API

152,903
nuxt-tsconfig-stub

Stub Nuxt's generated tsconfig.json at installation

70,835 24
kuranuxt

Look at the Nuxt 3 documentation to learn more.

871 0
@norbiros/nuxt-auto-form

Auto-generate Nuxt UI forms from Zod 4 schemas

9,137 58
nuxt-define

One utility function for module authors to define compiler constants for all bui...

13,412,511

Version History

Version Released Vue License
0.0.6 ^3.0 MIT
0.0.5 ^3.0 MIT
0.0.4 ^3.0 MIT
0.0.3 ^3.0 MIT
0.0.2 ^3.0 MIT