Skip to content

Configuration

After adding the Color Chips plugin to your Expressive Code config as shown in the set-up guide, no further configuration is required.

If you want to customize the appearance of the color chips, you can use style overrides.

You can provide custom styles in your Expressive Code config using the styleOverrides.colorChips object.

For example, to display square chips instead of the default round style, set borderRadius to zero:

{
plugins: [pluginColorChips()],
styleOverrides: {
colorChips: {
borderRadius: 0,
},
},
},

Default: "1.2em"

The size of each color chip.

Default: "1px"

The width of the border around each color chip.

Default: "50%"

The roundness of each color chip.

Default: ({ theme }) => theme.fg

The color of the border around each chip.

Default: ["#777", "#fff"]

The first of two shades used in the checkerboard background for transparent colors.

Default: ["#000", "#bbb"]

The second of two shades used in the checkerboard background for transparent colors.