Making WordPress.org

Changeset 13571


Ignore:
Timestamp:
04/19/2024 01:53:16 AM (3 years ago)
Author:
dd32
Message:

Support Forums: Blocks: Resovle some style issues in the editor making buttons and functionality invisible.

See #7599, #7593.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-blocks.php

    r13562 r13571  
    2525                // Enable theme compatibility CSS.
    2626                add_filter( 'blocks_everywhere_theme_compat', '__return_true' );
     27                add_action( 'wp_head', [ $this, 'expand_theme_compat' ], 1 );
    2728
    2829                // Theme Tweaks, these should be moved to the theme.
    … …  
    6061        }
    6162
     63        /**
     64         * CSS to expand on Blocks Everywhere support
     65         */
     66        public function expand_theme_compat() {
     67                wp_add_inline_style(
     68                        'blocks-everywhere-compat',
     69                        <<<CSS
     70                                /* Fix the primary block inserter button */
     71                                .blocks-everywhere .components-button.is-primary {
     72                                        --wp-components-color-accent: var(--wp--custom--button--color--background);
     73                                        --wp-components-color-accent-darker-10: var(--wp--custom--button--hover--color--background);
     74                                        --wp-components-color-accent-darker-20: var(--wp--custom--button--hover--color--background);
     75                                }
     76                                .gutenberg-support .iso-editor .edit-post-header__toolbar button.components-button.is-primary:hover svg {
     77                                        fill: #fff;
     78                                }
     79                                .blocks-everywhere .components-button.is-primary {
     80                                        --wp-admin-theme-color: #fff;
     81                                }
     82                                .editor-document-tools .editor-document-tools__left>.components-button.is-primary.has-icon.is-pressed {
     83                                        background: var(--wp--custom--button--color--background);
     84                                }
     85                                /* Fix the inline new-block button */
     86                                .block-editor-default-block-appender .block-editor-inserter__toggle.components-button.has-icon:hover {
     87                                        background: var( --wp--preset--color--charcoal-3 );
     88                                }
     89                                /* Fix the button selected state */
     90                                .gutenberg-support .edit-post-header button:not(:hover):not(:active):not(.has-background):not(.is-primary),
     91                                .gutenberg-support .edit-post-header button.is-pressed:not(.has-background):not(.is-primary) {
     92                                        color: #fff;
     93                                }
     94                                /* Editor toolbar buttons */
     95                                .gutenberg-support .iso-editor .block-editor-block-types-list__list-item:hover span {
     96                                        fill: inherit;
     97                                        color: inherit;
     98                                }
     99                                .gutenberg-support .iso-editor .edit-post-header__toolbar button.is-pressed:hover svg {
     100                                        fill: #fff;
     101                                }
     102                                /* Fix the accessibility navigation block styles */
     103                                .block-editor-list-view-leaf.is-selected .block-editor-list-view-block-contents,
     104                                .block-editor-list-view-leaf.is-selected .components-button.has-icon,
     105                                .gutenberg-support #bbpress-forums fieldset.bbp-form .block-editor-list-view-tree button:focus,
     106                                .gutenberg-support #bbpress-forums fieldset.bbp-form .block-editor-list-view-tree button:hover {
     107                                        color: var( --wp--preset--color--charcoal-1 );
     108                                }
     109                                /* Fix the accessibility block drag handles */
     110                                button.components-button.block-selection-button_drag-handle,
     111                                button.components-button.block-selection-button_select-button {
     112                                        color: #fff !important;
     113                                }
     114                        CSS
     115                );
     116        }
     117
    62118        public function after_setup_theme() {
    63119                // This will make embeds resize properly.
    … …  
    102158                        $settings['iso']['blocks']['allowBlocks'][] = 'core/embed';
    103159                }
    104 
    105                 // Adds a navigation button in the toolbar.
    106                 $settings['toolbar']['navigation'] = false;
    107160
    108161                // We don't need these on the forums.
Note: See TracChangeset for help on using the changeset viewer.