Disclaimer
This extension is currently under active development and is not ready for production use. Parts of this documentation may be incomplete, outdated, or subject to change without notice.
Responsive Settings adds device-specific editing to the Gutenberg block editor.
Desktop is the base layer. Tablet and Mobile store only differences as overrides.
- Device-aware editing workflow (Desktop / Tablet / Mobile)
- Dedicated “Overrides” sidebar in the editor
- Per-setting override summaries
- One-click removal of individual overrides
- List View indicator for blocks containing responsive data
- Automatic setting availability based on supported block types
- WordPress 5.8+
- PHP 8.2+
- Copy this plugin to
/wp-content/plugins/responsive-settings. - Activate Responsive Settings in the WordPress admin.
- Open the block editor.
- Select a block.
- Open the Overrides sidebar.
- Switch preview to Tablet or Mobile.
- Edit supported block settings.
Only changed values are saved in attributes.responsive.
- spacing
- layout
- typography
- alignment
- color
- border
app/— PHP core (registration, validation, rendering)sources/— editor-side JavaScript/SCSSsettings/— setting definitions (setting.json) and CSS generators (css.php)
Create a folder:
settings/{setting-key}/
with at least:
setting.jsoncss.php
Optional files:
- custom editor interceptor script (declared via
interceptor) - editor stylesheet (declared via
editorStyle, defaults toeditor.css)
{
"key": "shadow",
"label": "Shadow",
"description": "Responsive shadow overrides",
"blockSupports": ["*"],
"properties": ["style.shadow"],
"propertyLabels": {
"style.shadow": "Shadow"
},
"badge": {
"mode": "both",
"targets": ["style.shadow"]
},
"css": "css.php",
"interceptor": "interceptor.js",
"editorStyle": "editor.css"
}Notes:
propertiesaccepts dot paths (for examplestyle.spacing.padding).- Dot paths are normalized automatically for editor mapping.
blockSupports: ["*"]applies to all core blocks.
css.php must return a callable.
<?php
return function( $data, $block_name = '', $block_context = [] ) {
if ( ! is_array( $data ) || empty( $data['shadow'] ) ) {
return '';
}
return ' box-shadow: ' . esc_attr( $data['shadow'] ) . ";\n";
};Arguments:
$data— setting data for the current device$block_name— current block name$block_context— contextual data for rendering
The plugin exposes a browser API:
window.responsiveSettingsApi.registerSetting(key, config)window.responsiveSettingsApi.registerInterceptor(key, callback)
Use this only when you need runtime integrations outside the folder-based settings/ registration.
Install dependencies:
npm install
Available scripts:
npm run start— watch/dev buildnpm run build— production buildnpm run make:zip— package plugin zip
Current version: 0.1.0