Colors

Predefined colors

Components are based on a primary color and neutral color.

vueless.config.{js,ts}
export default {
  primary: "green",  /* default -> grayscale */
  neutral: "stone", /* default -> gray */
};

Vueless uses Tailwind CSS under the hood, so you can use any of the Tailwind CSS colorsarrow-up-right or your own custom colors.

Default primary colors:

red, orange, amber, yellow, lime, green, emerald, teal, cyan, sky, blue, indigo, violet, purple, fuchsia, pink, rose

Default neutral colors:

slate, gray, zinc, neutral, stone


Custom color shades

You can also define custom colors by providing an object with all Tailwind shades (50, 100 ..., 950):

vueless.config.{js,ts}
export default {
  primary: {
    50: "#fef2f2",
    100: "#fee2e2",
    200: "#fecaca",
    300: "#fca5a5",
    400: "#f87171",
    500: "#ef4444",
    600: "#dc2626",
    700: "#b91c1c",
    800: "#991b1b",
    900: "#7f1d1d",
    950: "#450a0a",
  },
  neutral: {
    50: "#f9fafb",
    100: "#f3f4f6",
    200: "#e5e7eb",
    300: "#d1d5db",
    400: "#9ca3af",
    500: "#6b7280",
    600: "#4b5563",
    700: "#374151",
    800: "#1f2937",
    900: "#111827",
    950: "#030712",
  },
};
circle-info

If you use an object for colors, all shade keys should be defined. Missing or invalid shade keys will trigger a console warning.


CSS variables

To enable dynamic color changes at runtime, Vueless use the --vl-primary-* and --vl-neutral-* CSS variables. These variables will represent all Tailwind CSS shades of the defined Vueless colors.

  • --vl-primary-50, --vl-primary-100, ... --vl-primary-900, --vl-primary-950

  • --vl-gray-50, --vl-gray-100, ... --vl-gray-900, --vl-gray-950

Example usage (custom properties syntaxarrow-up-right):


Adding color utility classes

To use all primary and neutral color shades as a utility classes (e.g.: text-primary-700 dark:text-neutral-300), you must define them in the application’s main CSS file.

circle-info

Keep in mind that Tailwind CSS already includes a neutral color in its palette, so it will be overridden. To avoid conflicts, consider using a different color name, such as neu (e.g., --color-neu-*).


Custom colors

When overriding default colorsarrow-up-right or adding custom colorsarrow-up-right, ensure you define all shades from 50 to 950, or at least the ones used in the default or your Vueless theme.

You can generate your colors using tools such as uicolorsarrow-up-right for example.

Last updated