Skip to content

Engine Config

The engine configuration controls every aspect of PikaCSS. Create a pika.config.ts file in your project root:

ts
import { defineEngineConfig } from '@pikacss/core'

export default defineEngineConfig({
  // options here
})

Config

Core

PropertyDescription
prefixClass name prefix prepended to every generated atomic class name. Default: 'pk-'.
defaultSelectorCSS selector template for atomic styles. $ is replaced with the generated class ID. Default: '.$'.
pluginsArray of engine plugins to load in resolution order. See Plugin Development.
layersMap of CSS @layer names to numeric priorities. Lower numbers render earlier. See Layers.
defaultPreflightsLayerLayer name for preflight styles. Default: 'preflights'.
defaultUtilitiesLayerLayer name for atomic utility styles. Default: 'utilities'.
preflightsBase styles injected before utilities. See Preflights.
cssImportsArray of CSS @import rules included at the top of generated output.
importantWhen true, all generated declarations include !important. See Important.

Customizations

PropertyDescription
autocompleteIDE autocomplete configuration. See Autocomplete.
selectorsCustom selector mappings for nested selectors. See Selectors.
shortcutsReusable style definition aliases. See Shortcuts.
variablesCSS custom properties injected under :root. See Variables.
keyframesCSS @keyframes animation definitions. See Keyframes.

Plugin Config

TIP

These fields are added by official plugins via type augmentation. Install the corresponding plugin package to use them.

PropertyDescription
resetSee Reset plugin.
typographySee Typography plugin.
iconsSee Icons plugin.
fontsSee Fonts plugin.

See API Reference — Core for full type signatures and defaults.

Examples

ts
import { defineEngineConfig } from '@pikacss/core'

export const selectorsConfig = defineEngineConfig({
	selectors: {
		selectors: [
			['@dark', 'html.dark $'],
			['@light', 'html:not(.dark) $'],
			['@sm', '@media (min-width: 640px)'],
			['@md', '@media (min-width: 768px)'],
			['@lg', '@media (min-width: 1024px)'],
		],
	},
})

Next