From bf485356d5196ca2636bb4410ec9ac1669fac4d3 Mon Sep 17 00:00:00 2001 From: Aki Hamano <54422211+t-hamano@users.noreply.github.com> Date: Wed, 28 Aug 2024 18:17:42 +0900 Subject: [PATCH] Video Block: Remove custom CSS code for placeholder style (#64861) Co-authored-by: t-hamano Co-authored-by: jasmussen --- packages/block-library/src/video/edit.js | 34 +++++++++--------- packages/block-library/src/video/editor.scss | 37 -------------------- 2 files changed, 17 insertions(+), 54 deletions(-) diff --git a/packages/block-library/src/video/edit.js b/packages/block-library/src/video/edit.js index 05dbcc58e8b8e5..63f633a41adf94 100644 --- a/packages/block-library/src/video/edit.js +++ b/packages/block-library/src/video/edit.js @@ -42,23 +42,6 @@ import TracksEditor from './tracks-editor'; import Tracks from './tracks'; import { Caption } from '../utils/caption'; -// Much of this description is duplicated from MediaPlaceholder. -const placeholder = ( content ) => { - return ( - - { content } - - ); -}; - const ALLOWED_MEDIA_TYPES = [ 'video' ]; const VIDEO_POSTER_ALLOWED_MEDIA_TYPES = [ 'image' ]; @@ -149,6 +132,23 @@ function VideoEdit( { createErrorNotice( message, { type: 'snackbar' } ); } + // Much of this description is duplicated from MediaPlaceholder. + const placeholder = ( content ) => { + return ( + + { content } + + ); + }; + const classes = clsx( className, { 'is-transient': !! temporaryURL, } ); diff --git a/packages/block-library/src/video/editor.scss b/packages/block-library/src/video/editor.scss index 922c6dfd9d04a9..dd50ecc6c066fd 100644 --- a/packages/block-library/src/video/editor.scss +++ b/packages/block-library/src/video/editor.scss @@ -1,40 +1,3 @@ -// Provide special styling for the placeholder. -// @todo this particular minimal style of placeholder could be componentized further. -.wp-block-video.wp-block-video { - // Show Placeholder style on-select. - &.is-selected .components-placeholder { - // Block UI appearance. - color: $gray-900; - background-color: $white; - box-shadow: inset 0 0 0 $border-width $gray-900; - border: none; - - // @todo this should eventually be overridden by a custom border-radius set in the inspector. - border-radius: $radius-block-ui; - - > svg { - opacity: 0; - } - - .components-placeholder__illustration { - display: none; - } - - &::before { - opacity: 0; - } - } - - // Remove the transition while we still have a legacy placeholder style. - // Otherwise the content jumps between the 1px placeholder border, and any inherited custom - // parent border that may get applied when you deselect. - .components-placeholder__label, - .components-placeholder__instructions, - .components-button { - transition: none; - } -} - .wp-block[data-align="center"] > .wp-block-video { text-align: center; }