From 87df78fe449f3961a472b3b93131f709a8334e63 Mon Sep 17 00:00:00 2001 From: Ben Word Date: Thu, 27 Jan 2022 23:28:29 -0600 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20migrate=20global=20settings=20to?= =?UTF-8?q?=20theme.json?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/setup.php | 54 --------------------------------------------------- style.css | 2 +- theme.json | 38 ++++++++++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 55 deletions(-) create mode 100644 theme.json diff --git a/app/setup.php b/app/setup.php index 9b6d0eac5f..5469bb9b94 100644 --- a/app/setup.php +++ b/app/setup.php @@ -58,60 +58,6 @@ 'primary_navigation' => __('Primary Navigation', 'sage') ]); - /** - * Register the editor color palette. - * @link https://developer.wordpress.org/block-editor/developers/themes/theme-support/#block-color-palettes - */ - add_theme_support('editor-color-palette', []); - - /** - * Register the editor color gradient presets. - * @link https://developer.wordpress.org/block-editor/developers/themes/theme-support/#block-gradient-presets - */ - add_theme_support('editor-gradient-presets', []); - - /** - * Register the editor font sizes. - * @link https://developer.wordpress.org/block-editor/developers/themes/theme-support/#block-font-sizes - */ - add_theme_support('editor-font-sizes', []); - - /** - * Register relative length units in the editor. - * @link https://developer.wordpress.org/block-editor/developers/themes/theme-support/#support-custom-units - */ - add_theme_support('custom-units'); - - /** - * Enable support for custom line heights in the editor. - * @link https://developer.wordpress.org/block-editor/developers/themes/theme-support/#supporting-custom-line-heights - */ - add_theme_support('custom-line-height'); - - /** - * Enable support for custom block spacing control in the editor. - * @link https://developer.wordpress.org/block-editor/developers/themes/theme-support/#spacing-control - */ - add_theme_support('custom-spacing'); - - /** - * Disable custom colors in the editor. - * @link https://developer.wordpress.org/block-editor/developers/themes/theme-support/#disabling-custom-colors-in-block-color-palettes - */ - add_theme_support('disable-custom-colors'); - - /** - * Disable custom color gradients in the editor. - * @link https://developer.wordpress.org/block-editor/developers/themes/theme-support/#disabling-custom-gradients - */ - add_theme_support('disable-custom-gradients'); - - /** - * Disable custom font sizes in the editor. - * @link https://developer.wordpress.org/block-editor/developers/themes/theme-support/#disabling-custom-font-sizes - */ - add_theme_support('disable-custom-font-sizes'); - /** * Disable the default block patterns. * @link https://developer.wordpress.org/block-editor/developers/themes/theme-support/#disabling-the-default-block-patterns diff --git a/style.css b/style.css index 556600f818..87c5ed8bc6 100644 --- a/style.css +++ b/style.css @@ -9,5 +9,5 @@ Text Domain: sage License: MIT License License URI: https://opensource.org/licenses/MIT Requires PHP: 7.4 -Requires at least: 5.4 +Requires at least: 5.9 */ diff --git a/theme.json b/theme.json new file mode 100644 index 0000000000..e5b8e50a8a --- /dev/null +++ b/theme.json @@ -0,0 +1,38 @@ +{ + "$schema": "https://schemas.wp.org/trunk/theme.json", + "version": 2, + "settings": { + "color": { + "palette": [ + { + "slug": "primary", + "color": "#525ddc", + "name": "Primary" + } + ], + "custom": false, + "customGradient": false + }, + "custom": { + "spacing": {}, + "typography": { + "font-size": {}, + "line-height": {} + } + }, + "spacing": { + "padding": true, + "units": [ + "px", + "%", + "em", + "rem", + "vw", + "vh" + ] + }, + "typography": { + "customFontSize": false + } + } +}