---
title: "modal_kit_styles – Modal Kit Docs"
description: "Add fixed styles: token sets of colours, fonts, radius and shadow that look the same on any theme, like the bundled Fieldnote, Harbor and Night."
language: "en-US"
canonical_url: "https://modalkitwp.com/docs/hooks/modal_kit_styles/"
source_url: "https://modalkitwp.com/docs/hooks/modal_kit_styles/"
content_type: "text/markdown"
---

[All hooks](https://modalkitwp.com/docs/hooks/)

Free · PHP hooks

[modal_kit_layouts](https://modalkitwp.com/docs/hooks/modal_kit_layouts/)

[modal_kit_styles](https://modalkitwp.com/docs/hooks/modal_kit_styles/)

[modal_kit_theme_tokens](https://modalkitwp.com/docs/hooks/modal_kit_theme_tokens/)

[modal_kit_meta_schema](https://modalkitwp.com/docs/hooks/modal_kit_meta_schema/)

[modal_kit_targets_request](https://modalkitwp.com/docs/hooks/modal_kit_targets_request/)

[modal_kit_dialog_context](https://modalkitwp.com/docs/hooks/modal_kit_dialog_context/)

[modal_kit_dialog_panel](https://modalkitwp.com/docs/hooks/modal_kit_dialog_panel/)

[modal_kit_button_actions](https://modalkitwp.com/docs/hooks/modal_kit_button_actions/)

[modal_kit_render_button_action](https://modalkitwp.com/docs/hooks/modal_kit_render_button_action/)

[modal_kit_link_prefix](https://modalkitwp.com/docs/hooks/modal_kit_link_prefix/)

[modal_kit_close_label](https://modalkitwp.com/docs/hooks/modal_kit_close_label/)

[modal_kit_post_type_capabilities](https://modalkitwp.com/docs/hooks/modal_kit_post_type_capabilities/)

[modal_kit_pattern_categories](https://modalkitwp.com/docs/hooks/modal_kit_pattern_categories/)

[modal_kit_pattern_collections](https://modalkitwp.com/docs/hooks/modal_kit_pattern_collections/)

[modal_kit_pattern_collection_types](https://modalkitwp.com/docs/hooks/modal_kit_pattern_collection_types/)

[modal_kit_starter_settings](https://modalkitwp.com/docs/hooks/modal_kit_starter_settings/)

[modal_kit_backdrop_capability](https://modalkitwp.com/docs/hooks/modal_kit_backdrop_capability/)

[modal_kit_backdrop_request](https://modalkitwp.com/docs/hooks/modal_kit_backdrop_request/)

[modal_kit_optimizer_paths](https://modalkitwp.com/docs/hooks/modal_kit_optimizer_paths/)

[modal_kit_pro_listings](https://modalkitwp.com/docs/hooks/modal_kit_pro_listings/)

Pro · PHP hooks

[modal_kit_pro_providers](https://modalkitwp.com/docs/hooks/modal_kit_pro_providers/)

[modal_kit_pro_captcha_providers](https://modalkitwp.com/docs/hooks/modal_kit_pro_captcha_providers/)

[modal_kit_pro_captcha_hostnames](https://modalkitwp.com/docs/hooks/modal_kit_pro_captcha_hostnames/)

[modal_kit_pro_country](https://modalkitwp.com/docs/hooks/modal_kit_pro_country/)

[modal_kit_pro_country_sources](https://modalkitwp.com/docs/hooks/modal_kit_pro_country_sources/)

[modal_kit_pro_results_goal](https://modalkitwp.com/docs/hooks/modal_kit_pro_results_goal/)

[modal_kit_pro_results_count](https://modalkitwp.com/docs/hooks/modal_kit_pro_results_count/)

[modal_kit_pro_coupon_issued](https://modalkitwp.com/docs/hooks/modal_kit_pro_coupon_issued/)

[modal_kit_pro_visitor_address](https://modalkitwp.com/docs/hooks/modal_kit_pro_visitor_address/)

[modal_kit_pro_play_rate_limit](https://modalkitwp.com/docs/hooks/modal_kit_pro_play_rate_limit/)

[modal_kit_pro_form_daily_limit](https://modalkitwp.com/docs/hooks/modal_kit_pro_form_daily_limit/)

[modal_kit_pro_address_daily_limit](https://modalkitwp.com/docs/hooks/modal_kit_pro_address_daily_limit/)

[modal_kit_pro_events_rate_limit](https://modalkitwp.com/docs/hooks/modal_kit_pro_events_rate_limit/)

[modal_kit_pro_modal_events_per_hour](https://modalkitwp.com/docs/hooks/modal_kit_pro_modal_events_per_hour/)

Pro · Updates

[modal_kit_pro_is_staging](https://modalkitwp.com/docs/hooks/modal_kit_pro_is_staging/)

[modal_kit_pro_pre_rollback](https://modalkitwp.com/docs/hooks/modal_kit_pro_pre_rollback/)

[modal_kit_pro_tested_up_to](https://modalkitwp.com/docs/hooks/modal_kit_pro_tested_up_to/)

Editor filters · JavaScript

[modalKit.layouts](https://modalkitwp.com/docs/hooks/modalkit-layouts/)

[modalKit.triggerTypes](https://modalkitwp.com/docs/hooks/modalkit-triggertypes/)

[modalKit.triggerMenuGroups](https://modalkitwp.com/docs/hooks/modalkit-triggermenugroups/)

[modalKit.buttonActions](https://modalkitwp.com/docs/hooks/modalkit-buttonactions/)

[modalKit.canvasChrome](https://modalkitwp.com/docs/hooks/modalkit-canvaschrome/)

[modalKit.styleTarget](https://modalkitwp.com/docs/hooks/modalkit-styletarget/)

[modalKit.settingsTabs](https://modalkitwp.com/docs/hooks/modalkit-settingstabs/)

[modalKit.styleEditor](https://modalkitwp.com/docs/hooks/modalkit-styleeditor/)

[modalKit.toolsRows](https://modalkitwp.com/docs/hooks/modalkit-toolsrows/)

[modalKit.pickerPreview](https://modalkitwp.com/docs/hooks/modalkit-pickerpreview/)

Hooks ▾

[All hooks](https://modalkitwp.com/docs/hooks/)

Free · PHP hooks

[modal_kit_layouts](https://modalkitwp.com/docs/hooks/modal_kit_layouts/)

[modal_kit_styles](https://modalkitwp.com/docs/hooks/modal_kit_styles/)

[modal_kit_theme_tokens](https://modalkitwp.com/docs/hooks/modal_kit_theme_tokens/)

[modal_kit_meta_schema](https://modalkitwp.com/docs/hooks/modal_kit_meta_schema/)

[modal_kit_targets_request](https://modalkitwp.com/docs/hooks/modal_kit_targets_request/)

[modal_kit_dialog_context](https://modalkitwp.com/docs/hooks/modal_kit_dialog_context/)

[modal_kit_dialog_panel](https://modalkitwp.com/docs/hooks/modal_kit_dialog_panel/)

[modal_kit_button_actions](https://modalkitwp.com/docs/hooks/modal_kit_button_actions/)

[modal_kit_render_button_action](https://modalkitwp.com/docs/hooks/modal_kit_render_button_action/)

[modal_kit_link_prefix](https://modalkitwp.com/docs/hooks/modal_kit_link_prefix/)

[modal_kit_close_label](https://modalkitwp.com/docs/hooks/modal_kit_close_label/)

[modal_kit_post_type_capabilities](https://modalkitwp.com/docs/hooks/modal_kit_post_type_capabilities/)

[modal_kit_pattern_categories](https://modalkitwp.com/docs/hooks/modal_kit_pattern_categories/)

[modal_kit_pattern_collections](https://modalkitwp.com/docs/hooks/modal_kit_pattern_collections/)

[modal_kit_pattern_collection_types](https://modalkitwp.com/docs/hooks/modal_kit_pattern_collection_types/)

[modal_kit_starter_settings](https://modalkitwp.com/docs/hooks/modal_kit_starter_settings/)

[modal_kit_backdrop_capability](https://modalkitwp.com/docs/hooks/modal_kit_backdrop_capability/)

[modal_kit_backdrop_request](https://modalkitwp.com/docs/hooks/modal_kit_backdrop_request/)

[modal_kit_optimizer_paths](https://modalkitwp.com/docs/hooks/modal_kit_optimizer_paths/)

[modal_kit_pro_listings](https://modalkitwp.com/docs/hooks/modal_kit_pro_listings/)

Pro · PHP hooks

[modal_kit_pro_providers](https://modalkitwp.com/docs/hooks/modal_kit_pro_providers/)

[modal_kit_pro_captcha_providers](https://modalkitwp.com/docs/hooks/modal_kit_pro_captcha_providers/)

[modal_kit_pro_captcha_hostnames](https://modalkitwp.com/docs/hooks/modal_kit_pro_captcha_hostnames/)

[modal_kit_pro_country](https://modalkitwp.com/docs/hooks/modal_kit_pro_country/)

[modal_kit_pro_country_sources](https://modalkitwp.com/docs/hooks/modal_kit_pro_country_sources/)

[modal_kit_pro_results_goal](https://modalkitwp.com/docs/hooks/modal_kit_pro_results_goal/)

[modal_kit_pro_results_count](https://modalkitwp.com/docs/hooks/modal_kit_pro_results_count/)

[modal_kit_pro_coupon_issued](https://modalkitwp.com/docs/hooks/modal_kit_pro_coupon_issued/)

[modal_kit_pro_visitor_address](https://modalkitwp.com/docs/hooks/modal_kit_pro_visitor_address/)

[modal_kit_pro_play_rate_limit](https://modalkitwp.com/docs/hooks/modal_kit_pro_play_rate_limit/)

[modal_kit_pro_form_daily_limit](https://modalkitwp.com/docs/hooks/modal_kit_pro_form_daily_limit/)

[modal_kit_pro_address_daily_limit](https://modalkitwp.com/docs/hooks/modal_kit_pro_address_daily_limit/)

[modal_kit_pro_events_rate_limit](https://modalkitwp.com/docs/hooks/modal_kit_pro_events_rate_limit/)

[modal_kit_pro_modal_events_per_hour](https://modalkitwp.com/docs/hooks/modal_kit_pro_modal_events_per_hour/)

Pro · Updates

[modal_kit_pro_is_staging](https://modalkitwp.com/docs/hooks/modal_kit_pro_is_staging/)

[modal_kit_pro_pre_rollback](https://modalkitwp.com/docs/hooks/modal_kit_pro_pre_rollback/)

[modal_kit_pro_tested_up_to](https://modalkitwp.com/docs/hooks/modal_kit_pro_tested_up_to/)

Editor filters · JavaScript

[modalKit.layouts](https://modalkitwp.com/docs/hooks/modalkit-layouts/)

[modalKit.triggerTypes](https://modalkitwp.com/docs/hooks/modalkit-triggertypes/)

[modalKit.triggerMenuGroups](https://modalkitwp.com/docs/hooks/modalkit-triggermenugroups/)

[modalKit.buttonActions](https://modalkitwp.com/docs/hooks/modalkit-buttonactions/)

[modalKit.canvasChrome](https://modalkitwp.com/docs/hooks/modalkit-canvaschrome/)

[modalKit.styleTarget](https://modalkitwp.com/docs/hooks/modalkit-styletarget/)

[modalKit.settingsTabs](https://modalkitwp.com/docs/hooks/modalkit-settingstabs/)

[modalKit.styleEditor](https://modalkitwp.com/docs/hooks/modalkit-styleeditor/)

[modalKit.toolsRows](https://modalkitwp.com/docs/hooks/modalkit-toolsrows/)

[modalKit.pickerPreview](https://modalkitwp.com/docs/hooks/modalkit-pickerpreview/)

[Docs](https://modalkitwp.com/docs/) / [Hooks](https://modalkitwp.com/docs/hooks/) / Free · PHP hooks

# `modal_kit_styles`

filter

Free

PHP

Add fixed styles: token sets of colours, fonts, radius and shadow that look the same on any theme, like the bundled Fieldnote, Harbor and Night.

Fixed styles bring their own colours and fonts, unlike Native, Soft and Editorial, which follow the theme. Each one is a block style of the Modal block (`is-style-{slug}`). This filter receives the bundled styles and the ones authors imported or made on the site, keyed by slug, and returns the full list.

It runs once per request, on `init` at priority 20, when the block styles are registered. Each style that isn’t bundled gets a `.mk-style-{slug}` rule of `--mk-*` custom properties, printed inline with the Modal block’s stylesheet on the site and in the editor canvas. Styles you add are listed on **Modal Kit → Settings → Styles** as “Added by a plugin”.

## Parameters

Parameter

Description

`$styles`

array

Styles keyed by slug. Each has `label`, `description`, `version`, `color` (`surface`, `ink`, `muted`, `line`, `field`, `accent`, `accent-strong`, `on-accent`, `tint`, `overlay`, `full-bg`, `full-ink`, `full-accent`), `font` (`head`, `body`, `mono`, `head-weight`, `head-tracking`, `head-size`), `radius` (`panel`, `button`, `field`) and `shadow`.

## Returns

`array` Styles keyed by slug. Each is cleaned: unknown keys are dropped, values keep only characters that can appear in a CSS value, and a style without a label or one of its required colours is left out.

## Examples

### Add a brand style

A complete token set, in the same shape as the bundled `fieldnote.json`. It uses the bundled fonts, so they load with the modal.

PHP

```
add_filter( 'modal_kit_styles', function ( $styles ) {
  $styles['my-brand'] = array(
    'label'       => __( 'Acme', 'my-plugin' ),
    'description' => __( 'Warm white, deep green, square', 'my-plugin' ),
    'color'       => array(
      'surface'       => '#fffdf8',
      'ink'           => '#1d2420',
      'muted'         => '#55605a',
      'line'          => '#e6e2d8',
      'field'         => '#8a918c',
      'accent'        => '#0b6e4f',
      'accent-strong' => '#07513a',
      'on-accent'     => '#ffffff',
      'tint'          => '#e6f2ed',
      'overlay'       => 'rgba(20,28,24,.5)',
      'full-bg'       => '#1d2420',
      'full-ink'      => '#f6f3ea',
      'full-accent'   => '#7fd1ae',
    ),
    'font'        => array(
      'head'          => "'Instrument Serif', serif",
      'body'          => "'Instrument Sans', sans-serif",
      'head-weight'   => 400,
      'head-tracking' => '-0.01em',
      'head-size'     => 40,
    ),
    'radius'      => array(
      'panel'  => '0',
      'button' => '0',
      'field'  => '0',
    ),
    'shadow'      => '0 24px 60px rgba(20,28,24,.25)',
  );

  return $styles;
} );
```

### Change a bundled style’s accent

A bundled style you change is no longer treated as bundled: its rule is printed inline after the stylesheet, so your values win.

PHP

```
add_filter( 'modal_kit_styles', function ( $styles ) {
  if ( isset( $styles['fieldnote'] ) ) {
    $styles['fieldnote']['color']['accent']        = '#0b6e4f';
    $styles['fieldnote']['color']['accent-strong'] = '#07513a';
    $styles['fieldnote']['color']['tint']          = '#e6f2ed';
  }

  return $styles;
} );
```

Good to know

Add the filter before `init` priority 20, at plugin load or on `plugins_loaded`. The list is built once and kept for the request, so a filter added later has no effect.

The slugs `default`, `soft` and `editorial` belong to the styles that follow the theme and are skipped. Slugs go through `sanitize_key()`.

The required colours (`surface`, `ink`, `accent`, `on-accent`, `full-bg`, `full-ink`, `full-accent`) must be hex or `rgb()`/`rgba()` values: the plugin works out contrast and a dark style’s field colour from them. A style with an `hsl()` or `var()` value there is dropped.

Instrument Sans, Instrument Serif and IBM Plex Mono come with the plugin and load with any modal that uses the style’s fonts. Any other font is yours to load, on the site and in the editor.

Styles saved on the site are added at priority 5, so a style you add at the default priority replaces a saved one with the same slug.

There is no editor filter to add: the editor, Settings and the setup wizard get the list from PHP.

Applied in `modal-kit/includes/Styles.php`.

Related

[`modal_kit_theme_tokens`](https://modalkitwp.com/docs/hooks/modal_kit_theme_tokens/)

[`modal_kit_layouts`](https://modalkitwp.com/docs/hooks/modal_kit_layouts/)

## Need a hook that isn’t here?

[Ask us](https://modalkitwp.com/support/)

[Developers overview](https://modalkitwp.com/developers/)
