Plugin Directory

Changeset 2794297


Ignore:
Timestamp:
10/04/2022 11:27:13 PM (3 years ago)
Author:
dennysdionigi
Message:

Version 2.0

Location:
block-styling
Files:
15 added
2 edited

Legend:

Unmodified
Added
Removed
  • block-styling/trunk/README.txt

    r2794027 r2794297  
    3636(Behind the scenes adding small CSS and bytes of code to change Gutenberg **blocks layout** ).
    3737
    38 = May I have any extra heavy resources or bloat ?=
     38= May I have any extra heavy resources or bloat ? =
    3939
    4040Nope. Just, on backend, few bytes of compressed code.
     
    4242== Screenshots ==
    4343
    44 1. The idea
    45 2. This is the second screen shot
    46 3. Third
    47 4. Forth
     441. How it works
     452. Plugin in action on pages
     463. Plugin working on posts
     474. Focus on title and columns
    4848
    4949== Changelog ==
     50
     51= 2.0 =
     52* Added titles to each section
     53* Microinteraction while mouseover blocks
     54* Microinterations on active blocks
     55* Improved code
     56* Improved plugin's bagdes and icons
     57* Plus: fixed Pattern sidebar
    5058
    5159= 1.0 =
  • block-styling/trunk/block-styling-backend.php

    r2794027 r2794297  
    1010 * Plugin URI:        https://www.whynot.media/
    1111 * Description:       Making Blocks Ui more accessible and friendly, someway easier to handle and visually manage.
    12  * Version:           1.0.0
     12 * Version:           2.0.0
    1313 * Author:            Dennys Dionigi
    1414 * Author URI:        https://codepen.io/DedaloD
     
    2727 * Currently plugin version.
    2828 */
    29 define( 'BLOCK_STYLING_BACKEND_VERSION', '1.0.0' );
     29define( 'BLOCK_STYLING_BACKEND_VERSION', '2.0.0' );
    3030
    3131
     
    7979             'type'    => 'hidden',
    8080         ) );
    81         $wp_customize->selective_refresh->add_partial( 'information_links', array(
     81    $wp_customize->selective_refresh->add_partial( 'information_links', array(
    8282        'selector'            => '.edit-post',
    8383        'container_inclusive' => true,
     
    9090  global $post;
    9191  $types = array( 'post', 'page' );
    92    
     92 
    9393  if( isset($_SERVER['HTTP_SEC_FETCH_DEST']) && $_SERVER['HTTP_SEC_FETCH_DEST'] == 'iframe' ) {
    94      
     94   
    9595    if ( $post && in_array( $post->post_type, $types, true ) && current_user_can('administrator') ) {
    96      
     96   
    9797    $edit_link_frontend = '<div id="id-edit-post"><div class="edit-post" onclick="editPost()"> <button onclick="editPost()">Modifica Body</button></div></div>
    98       <script async>
     98    <script async>
    9999      document.getElementById("id-edit-post").onclick = function() {messageSuccess()};
    100100
     
    102102      document.getElementById("id-edit-post").innerHTML = "Caricamento in corso... Attendere";
    103103      }
    104      
     104   
    105105      let getUrl;
    106      
     106   
    107107      function editPost() {
    108108      getUrl = window.location.href ="'.admin_url().'post.php?post='.get_the_ID().'&action=edit";
    109      
     109   
    110110      }
    111111      </script>';
    112112
    113113    $content = $edit_link_frontend.$content;
    114      
     114   
    115115      }
    116    
    117     }
    118    
     116 
     117  }
     118 
    119119  return $content;
    120120}
     
    138138add_action( 'admin_head', 'custom_css_edit_post' );
    139139function custom_css_edit_post() {
    140    
    141     if( isset($_SERVER['HTTP_SEC_FETCH_DEST']) && $_SERVER['HTTP_SEC_FETCH_DEST'] == 'iframe' ) {
     140 
     141  if( isset($_SERVER['HTTP_SEC_FETCH_DEST']) && $_SERVER['HTTP_SEC_FETCH_DEST'] == 'iframe' ) {
    142142
    143     $display = '<style>.edit-post-fullscreen-mode-close.has-icon {display: none !important;}
     143  $display = '<style>.edit-post-fullscreen-mode-close.has-icon {display: none !important;}
    144144                       .components-editor-notices__snackbar {display: none !important;}
    145                        .editor-post-publish-panel__content {display:none!important;}
    146                 </style>';
     145             .editor-post-publish-panel__content {display:none!important;}
     146          </style>';
    147147    echo $display;
    148148
    149149              }
    150     }
    151    
     150  }
     151 
    152152
    153153//** Grazie a Dennys Dionigi e Roberto B.
     
    155155/*css admin*/
    156156add_action('enqueue_block_editor_assets','my_custom_css_admin');
    157 function my_custom_css_admin(){echo '<style>.wp-block-group[role=group]>*{border:1px solid #000!important}.editor-styles-wrapper .wp-block-columns>.wp-block-column>.wp-block{border:1px solid rgb(0 0 0/70%)!important}@media (min-width:769px){.editor-styles-wrapper .wp-block-columns>.wp-block-column>.wp-block{width:-webkit-fill-available!important}}:is(.editor-styles-wrapper .wp-block-columns >.wp-block-column >.wp-block-html,iframe.components-sandbox){width:fit-content;max-height:35vh;overflow-y:scroll;border:1px solid #000!important;color:#000}:is(.block-library-html__edit .block-editor-plain-text,iframe.components-sandbox)::-webkit-scrollbar{width:5px}:is(.block-library-html__edit .block-editor-plain-text,iframe.components-sandbox)::-webkit-scrollbar-track{background:rgb(0 0 0/5%)}:is(.block-library-html__edit .block-editor-plain-text,iframe.components-sandbox)::-webkit-scrollbar-thumb{background:rgb(9 207 136/60%)}:is(.block-library-html__edit,iframe.components-sandbox):is(:hover,:focus) .block-editor-plain-text::-webkit-scrollbar-thumb{background:#000}.edit-post-layout__metaboxes:not(:empty) .edit-post-meta-boxes-area{padding:0 0 2.5rem!important}.block-editor-rich-text__editable:is(:hover,:active,:focus,:focus-within){z-index:5}.whynot-block-slider{height:min-content}div img{backdrop-filter:contrast(.8)}.block-editor-block-list__layout .block-editor-block-list__block:after{box-shadow:0 0 0 .5px rgb(0 0 0/50%)!important}.wp-block[data-align=full]{display:flex;flex-direction:column}.wp-block-columns.are-vertically-aligned-center{align-items:center;display:flex;justify-content:center}</style>';}
     157function my_custom_css_admin(){echo '<style>.wp-block-group[role=group]>*{border:1px solid #000!important}.editor-styles-wrapper .wp-block-columns>.wp-block-column>.wp-block{border:.6px dashed rgb(0 0 0/70%)!important}@media (min-width:769px){.editor-styles-wrapper .wp-block-columns>.wp-block-column>.wp-block{width:-webkit-fill-available!important}}:is(.editor-styles-wrapper .wp-block-columns >.wp-block-column >.wp-block-html,iframe.components-sandbox){width:fit-content;max-height:35vh;overflow-y:scroll;border:1px solid #000!important;color:#000}:is(.block-library-html__edit .block-editor-plain-text,iframe.components-sandbox)::-webkit-scrollbar{width:5px}:is(.block-library-html__edit .block-editor-plain-text,iframe.components-sandbox)::-webkit-scrollbar-track{background:rgb(0 0 0/5%)}:is(.block-library-html__edit .block-editor-plain-text,iframe.components-sandbox)::-webkit-scrollbar-thumb{background:rgb(9 207 136/60%)}:is(.block-library-html__edit,iframe.components-sandbox):is(:hover,:focus) .block-editor-plain-text::-webkit-scrollbar-thumb{background:#000}.edit-post-layout__metaboxes:not(:empty) .edit-post-meta-boxes-area{padding:0 0 2.5rem!important}.block-editor-rich-text__editable:is(:hover,:active,:focus,:focus-within){z-index:5}.whynot-block-slider{height:min-content}div img{backdrop-filter:contrast(.8)}.block-editor-block-list__layout .block-editor-block-list__block:after{box-shadow:0 0 0 .5px rgb(0 0 0/50%)!important}.wp-block[data-align=full]{display:flex;flex-direction:column}.wp-block-columns.are-vertically-aligned-center{align-items:center;display:flex;justify-content:center}:is(.wp-admin) [data-title]:not([data-title=""]):before{--white-hwb:hwb(0deg 100% 0%);--black-hwb:hwb(0deg 0% 100%);--invert-hwb:invert(1);--limegreen-hwb:hwb(120deg 20% 20%);--royalblue-hwb:hwb(225deg 25% 12%);--orangered-hwb:hwb(33deg 0% 0%);;content:attr(data-title);position:relative;display:flex;place-content:center;place-items:center;top:-1.5ch;left:-1ch;width:fit-content;height:fit-content;padding:3px;font:600 .99ex sans-serif;letter-spacing:.7px;background:var(--black-hwb);color:hwb(0deg 100% 0%);border:2.5px var(--white-hwb) solid;text-rendering:geometricprecision;-webkit-font-smoothing:subpixel-antialiased;-moz-osx-font-smoothing:subpixel-antialiased;white-space:nowrap;z-index:2;filter:drop-shadow(0 0 1px var(--black-hwb)) drop-shadow(2px 4px 10px var(--white-hwb));transition:all .6s ease-in-out;-webbkit-transition:all .6s ease-in-out;will-change:filter,text-shadow,background;speak:never}@supports (font-smooth){[data-title]:not([data-title=""]):before{font-smooth:always}}[data-title]:not([data-title=""]):hover:before{filter:invert(1);text-shadow:.5px .5px 3ch var(--white-hwb);transition:all .5s ease}.is-selected[data-title]:not([data-title=""]):before{background:var(--royalblue-hwb);filter:unset}[data-title]:not([data-title=""]) :has([data-title]):before{border-bottom:1px var(--limegreen-hwb) dashed}.is-selected[data-title][data-type="core/spacer"]:before{position:absolute;background:var(--orangered-hwb)}:is(.is-selected,.rich-text.is-selected:focus){-webkit-box-shadow:0 0 0 1px hwb(0deg 0% 100%);box-shadow:0 0 0 1px hwb(0deg 0% 100%)}:is(.wp-admin) .block-editor-block-patterns-list__item {height:auto;}</style>';}
    158158function admin_style(){echo '<style>.CodeMirror-code{font-family:sans-serif;font-size:12px;word-spacing:3px;letter-spacing:.5px}.cm-qualifier,.cm-tag{-webkit-text-fill-color:#000;font-weight:700}.cm-variable-3,[role=presentation] .cm-builtin:nth-child(1){font-weight:700}</style>';}
    159159add_action('admin_enqueue_scripts','admin_style');
Note: See TracChangeset for help on using the changeset viewer.