Browse Source

editor ๐Ÿ“ styles

windhamdavid 5 months ago
parent
commit
8d3cb3f855
10 changed files with 139 additions and 48 deletions
  1. 6 6
      css/custom.css
  2. 4 0
      css/custom.scss
  3. 6 6
      css/site.css
  4. 65 2
      functions.php
  5. 0 3
      index.php
  6. 4 7
      parts/header.html
  7. BIN
      screenshot.png
  8. 41 17
      style-editor.css
  9. 7 3
      style.css
  10. 6 4
      theme.json

+ 6 - 6
css/custom.css

@@ -100,8 +100,8 @@
   --bs-body-line-height: 1.5;
   --bs-body-color: #212529;
   --bs-body-color-rgb: 33, 37, 41;
-  --bs-body-bg: #fff;
-  --bs-body-bg-rgb: 255, 255, 255;
+  --bs-body-bg: #e9e4dc;
+  --bs-body-bg-rgb: 233, 228, 220;
   --bs-emphasis-color: #000;
   --bs-emphasis-color-rgb: 0, 0, 0;
   --bs-secondary-color: rgba(33, 37, 41, 0.75);
@@ -113,11 +113,11 @@
   --bs-tertiary-bg: #f8f9fa;
   --bs-tertiary-bg-rgb: 248, 249, 250;
   --bs-heading-color: inherit;
-  --bs-link-color: #0d6efd;
-  --bs-link-color-rgb: 13, 110, 253;
+  --bs-link-color: #4f6579;
+  --bs-link-color-rgb: 79, 101, 121;
   --bs-link-decoration: underline;
-  --bs-link-hover-color: #0a58ca;
-  --bs-link-hover-color-rgb: 10, 88, 202;
+  --bs-link-hover-color: #72aee6;
+  --bs-link-hover-color-rgb: 114, 174, 230;
   --bs-code-color: #d63384;
   --bs-highlight-color: #212529;
   --bs-highlight-bg: #fff3cd;

+ 4 - 0
css/custom.scss

@@ -18,6 +18,10 @@
 ####################### Custom  ############################
 ************************************************************/
 
+$body-bg: #e9e4dc;
+$link-color: #4f6579;
+$link-hover-color: #72aee6;
+
 $custom-colors: (
   'gwp-blue-dark': #33545C,
   'gwp-blue':#8FEAFF,

+ 6 - 6
css/site.css

@@ -206,8 +206,8 @@ table.costs tr.border-top {
   --bs-body-line-height: 1.5;
   --bs-body-color: #212529;
   --bs-body-color-rgb: 33, 37, 41;
-  --bs-body-bg: #fff;
-  --bs-body-bg-rgb: 255, 255, 255;
+  --bs-body-bg: #e9e4dc;
+  --bs-body-bg-rgb: 233, 228, 220;
   --bs-emphasis-color: #000;
   --bs-emphasis-color-rgb: 0, 0, 0;
   --bs-secondary-color: rgba(33, 37, 41, 0.75);
@@ -219,11 +219,11 @@ table.costs tr.border-top {
   --bs-tertiary-bg: #f8f9fa;
   --bs-tertiary-bg-rgb: 248, 249, 250;
   --bs-heading-color: inherit;
-  --bs-link-color: #0d6efd;
-  --bs-link-color-rgb: 13, 110, 253;
+  --bs-link-color: #4f6579;
+  --bs-link-color-rgb: 79, 101, 121;
   --bs-link-decoration: underline;
-  --bs-link-hover-color: #0a58ca;
-  --bs-link-hover-color-rgb: 10, 88, 202;
+  --bs-link-hover-color: #72aee6;
+  --bs-link-hover-color-rgb: 114, 174, 230;
   --bs-code-color: #d63384;
   --bs-highlight-color: #212529;
   --bs-highlight-bg: #fff3cd;

+ 65 - 2
functions.php

@@ -41,7 +41,11 @@ add_action('updated_option', 'gwp24_browsersync_save', 10, 3);
 ************************************************************/
 
 wp_enqueue_style( 'site-css', get_template_directory_uri() . '/css/site.css');
-wp_enqueue_script ( 'site-js', get_template_directory_uri() . '/js/site.js' );
+
+function gwp24_enqueue_script() {
+  wp_enqueue_script ( 'site-js', get_template_directory_uri() . '/js/site.js' );
+}
+add_action( 'wp_enqueue_scripts', 'gwp24_enqueue_script' );
 
 remove_theme_support( 'block-templates' );
 add_theme_support( 'block-template-parts' );
@@ -90,6 +94,58 @@ function gwp24_admin_styles() {
   wp_enqueue_style( 'style-editor', get_template_directory_uri().'/style-editor.css' );
 }
 
+remove_theme_support( 'core-block-patterns' );
+add_filter( 'should_load_remote_block_patterns', 'gwp24_disable_remote_patterns' );
+function gwp24_disable_remote_patterns() {
+	return false;
+}
+
+add_filter(
+  'block_editor_settings_all',
+  function( $settings ) {
+    $settings['enableOpenverseMediaCategory'] = false;
+    return $settings;
+  },
+  10
+);
+
+add_filter( 'allowed_block_types_all', 'gwp24_allowed_block_types', 25, 2 );
+function gwp24_allowed_block_types( $allowed_blocks, $editor_context ) {
+	return array(
+		'core/paragraph',
+		'core/heading',
+		'core/list',
+		'core/list-item',
+    'core/table',
+    'core/columns',
+    'core/column',
+    'core/image',
+    'core/gallery',
+    'core/cover',
+    'core/quote',
+    'core/file',
+    'core/video',
+    'core/audio',
+    'core/separator',
+    'core/spacer',
+    'core/shortcode',
+    //'core/html',
+    'core/freeform',
+    'core/verse',
+    'core/code',
+    'core/preformatted',
+    'core/pullquote',
+    'core/button',
+    'core/buttons',
+    'core/media-text',
+    'core/more',
+    'core/nextpage',
+
+	);
+}
+
+
+
 /***********************************************************
 ######################### Admin ############################
 ************************************************************/
@@ -210,7 +266,7 @@ add_action( 'admin_menu', 'gwp24_remove_admin_pages', 99 );
 function gwp24_remove_admin_pages() {
   global $current_user;
   $user_id = get_current_user_id();
-  if($user_id != '1') {
+  if($user_id != '0') {
     remove_submenu_page('themes.php', 'themes-editor.php');
     remove_submenu_page( 'themes.php', 'customize.php?return=' . urlencode($_SERVER['SCRIPT_NAME']));
     remove_submenu_page( 'themes.php', 'themes.php' );
@@ -220,6 +276,7 @@ function gwp24_remove_admin_pages() {
     remove_menu_page('tools.php');
     remove_menu_page('options-general.php');
     remove_menu_page('gutenberg');
+    remove_menu_page('users.php');
   }
 }
 
@@ -322,6 +379,12 @@ function gwp24_cleaner_header() {
 	remove_action('wp_head', 'feed_links', 2 );
 }
 
+add_action( 'wp_head', 'gwp24_favicon', 100 );
+function gwp24_favicon() {
+	echo '<link rel="icon" href="' . esc_url( get_stylesheet_directory_uri() . '/assets/images/_gwp_icon.svg' ) . '" type="image/svg+xml">';
+}
+
+
 /***********************************************************
 ####################### Comments ###########################
 ************************************************************/

+ 0 - 3
index.php

@@ -1,3 +0,0 @@
-<?php get_header(); ?>
-
-<?php get_footer(); ?>

+ 4 - 7
parts/header.html

@@ -1,22 +1,19 @@
 <!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"top":"20px","bottom":"20px"}}},"layout":{"type":"constrained"}} -->
-<div class="text-light wp-block-group alignwide has-grey-background-color has-background"
+<div class="autohide navbar fixed-top text-light wp-block-group alignwide has-contrast-background-color has-background"
 	style="padding-top:20px;padding-bottom:20px">
 	<!-- wp:group {"align":"wide","layout":{"type":"flex","justifyContent":"space-between","flexWrap":"wrap"}} -->
 	<div class="wp-block-group alignwide">
-		
-		<!-- wp:group {"style":{"spacing":{"blockGap":"var:preset|spacing|20"},"layout":{"selfStretch":"fit","flexSize":null}},"layout":{"type":"flex"}} -->
+		<!-- wp:group {"style":{"spacing":{"blockGap":"var:preset|spacing|77"},"layout":{"selfStretch":"fit","flexSize":null}},"layout":{"type":"flex"}} -->
 		<div class="wp-block-group">
 			<!-- wp:site-logo {"width":60 } /-->
-
-			<!-- wp:group {"style":{"spacing":{"blockGap":"0px"}}} -->
+			<!-- wp:group {"style":{"spacing":{"blockGap":"20px"}}} -->
 			<div class="wp-block-group">
 				<!-- wp:site-title {"level":0} /-->
 			</div>
 			<!-- /wp:group -->
 		</div>
 		<!-- /wp:group -->
-
-		<nav class="autohide navbar fixed-top navbar-expand-lg navbar-dark bg-gwp-grey fs-5">
+		<nav class="wha">
 		<!-- wp:navigation {"layout":{"type":"flex","justifyContent":"right","orientation":"horizontal"},"style":{"spacing":{"margin":{"top":"0"},"blockGap":"var:preset|spacing|30"},"layout":{"selfStretch":"fit","flexSize":null}}} /-->
 		</nav>
 	</div>

BIN
screenshot.png


+ 41 - 17
style-editor.css

@@ -1,5 +1,12 @@
+/* stop bootstrap box-sizing resets on dashboard theme names */
+.theme-name {
+  height: auto !important;
+}
+body {
+  background: #e9e4dc;
+}
 #wp-admin-bar-site-name .ab-item::before {
-  background-image: url(../gwp_block/img/_gwp_icon.svg) !important;
+  background-image: url(../gwp/img/_gwp_icon.svg) !important;
   background: no-repeat;
   display: block;
   width: 30px;
@@ -10,7 +17,7 @@
   display: none !important;
 }
 .edit-site-site-icon {
-  background-image: url(../gwp_block/img/_gwp_icon.svg) !important;
+  background-image: url(../gwp/img/_gwp_icon.svg) !important;
   background: no-repeat;
   display: block;
   width: 30px;
@@ -43,6 +50,16 @@
 }
 
 @media (prefers-color-scheme: dark) {
+  .editor-post-title__block,
+  .editor-default-block-appender,
+  .editor-block-list__block,
+  .editor-block-list__layout,
+  .edit-post-editor__list-view-container,
+  .edit-post-editor__document-overview-panel .edit-post-editor__document-overview-panel__close-button,
+  .edit-post-editor__document-overview-panel__tab-panel,
+  .edit-site-layout__header-container,
+  .edit-post-sidebar__panel-tabs,
+  .edit-post-header,
   .edit-site-layout__content,
   .edit-site-sidebar-navigation-screen__title-icon,
   .edit-site-editor__list-view-panel-content,
@@ -55,33 +72,40 @@
   .edit-site-header-edit-mode,
   .edit-site-layout__sidebar,
   .edit-site-sidebar__content,
+  .media-modal-content,
+  .media-frame-content,
+  .attachments-browser .media-toolbar,
+  .media-sidebar,
+  .document-outline__item-content,
   .block-editor__container,
+  .block-editor-block-toolbar,
   .block-editor-inserter__menu,
+  .block-editor-block-types-list__item-icon,
   .block-editor-block-contextual-toolbar,
-  .editor-post-title__block,
-  .editor-default-block-appender,
-  .editor-block-list__block,
-  .editor-block-list__layout,
-  .edit-post-editor__list-view-container,
-  .edit-post-editor__document-overview-panel__tab-panel,
-  .edit-site-layout__header-container,
-  .edit-post-header,
-  .block-editor-block-toolbar,
-  .components-panel,
-  .components-toolbar-group,
-  .components-panel__body-title,
-  .components-menu-group,
-  .components-toolbar-group .block-editor-block-toolbar__block-controls,
+  .block-editor-block-breadcrumb__button,
+  .block-editor-block-patterns-list,
+  .block-editor-inserter__patterns-category-panel-header,
+  .block-editor-inserter__media-dialog,
+  .block-editor-block-breadcrumb__current,
   .interface-interface-skeleton__body,
   .interface-interface-skeleton__sidebar,
   .interface-complementary-area h2,
   .interface-interface-skeleton__footer,
   .interface-interface-skeleton__footer .block-editor-block-breadcrumb,
-  .edit-post-sidebar__panel-tabs,
+  .components-button, 
+  .components-panel,
+  .components-placeholder,
+  .components-toolbar-group,
+  .components-panel__body-title,
+  .components-menu-group,
+  .components-popover__content,
+  .components-button.block-editor-block-types-list__item,
+  .components-toolbar-group .block-editor-block-toolbar__block-controls,
   .components-base-control,
   .components-form-token-field__suggestion,
   .components-panel__body-toggle.components-button
   {
+    background: #484c57;
     background-color: #484c57;
     color: rgb(213, 213, 213);
   }

+ 7 - 3
style.css

@@ -1,10 +1,14 @@
 /*!
-Theme Name: gwp
+Theme Name: GWP
 Theme URI: https://greenwoodpromise.com/
 Author: windhamdavid
+Author URI: https://davidwindham.com
 Description: A Theme for the Greenwood Promise
-Version: 0.1.0
-Tags: fse, 2024, bootstrap, animate.css, 
+Version: 0.2.0
+Tags: Full Site Editing, Blocks, Patterns, Twenty Twenty-Four, Bootstrap, animate.css
+Requires PHP: 7.0
+Tested up to: 6.4.1
+License: GNU General Public License v2 or later
 License URI: http://www.gnu.org/licenses/gpl-2.0.html
 
 Thanks:

+ 6 - 4
theme.json

@@ -6,6 +6,8 @@
 		"color": {
 			"custom": false,
 			"defaultPalette": false,
+			"defaultGradients": false,
+			"customGradient": false,
 			"palette": [
 				{
 					"slug": "base",
@@ -108,13 +110,13 @@
 			"fontSizes": [
 				{
 					"slug": "small",
-					"size": "1.125rem",
+					"size": "1.1rem",
 					"name": "Small",
 					"fluid": false
 				},
 				{
 					"slug": "medium",
-					"size": "1.5rem",
+					"size": "1.2rem",
 					"name": "Medium",
 					"fluid": false
 				},
@@ -129,10 +131,10 @@
 				},
 				{
 					"slug": "x-large",
-					"size": "2.75rem",
+					"size": "2.5rem",
 					"name": "XL",
 					"fluid": {
-						"min": "2.5rem",
+						"min": "2rem",
 						"max": "2.75rem"
 					}
 				},