-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Icon Block: Move default width rule to theme.json instead of block.json #75653
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
cd2708c
233faf4
c04d914
5b03b7c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
…idth and height as expected
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,7 +14,6 @@ import { | |
| ToolbarGroup, | ||
| __experimentalToolsPanel as ToolsPanel, | ||
| __experimentalToolsPanelItem as ToolsPanelItem, | ||
| Placeholder, | ||
| } from '@wordpress/components'; | ||
| import { | ||
| BlockControls, | ||
|
|
@@ -33,11 +32,33 @@ import { useState } from '@wordpress/element'; | |
| /** | ||
| * Internal dependencies | ||
| */ | ||
| import { SVG, Rect, Path } from '@wordpress/primitives'; | ||
|
|
||
| import { useToolsPanelDropdownMenuProps } from '../utils/hooks'; | ||
| import HtmlRenderer from '../utils/html-renderer'; | ||
| import { CustomInserterModal } from './components'; | ||
| import { unlock } from '../lock-unlock'; | ||
|
|
||
| const IconPlaceholder = ( { className, style } ) => ( | ||
| <SVG | ||
| xmlns="http://www.w3.org/2000/svg" | ||
| viewBox="0 0 60 60" | ||
| preserveAspectRatio="none" | ||
| fill="none" | ||
| aria-hidden="true" | ||
| className={ clsx( 'wp-block-icon__placeholder', className ) } | ||
| style={ style } | ||
| > | ||
| <Rect width="60" height="60" fill="currentColor" fillOpacity={ 0.1 } /> | ||
| <Path | ||
| vectorEffect="non-scaling-stroke" | ||
| stroke="currentColor" | ||
| strokeOpacity={ 0.25 } | ||
| d="M60 60 0 0" | ||
| /> | ||
| </SVG> | ||
| ); | ||
|
|
||
| export function Edit( { attributes, setAttributes } ) { | ||
| const { icon, ariaLabel } = attributes; | ||
|
|
||
|
|
@@ -165,8 +186,7 @@ export function Edit( { attributes, setAttributes } ) { | |
| } } | ||
| /> | ||
| ) : ( | ||
| <Placeholder | ||
| withIllustration | ||
| <IconPlaceholder | ||
| className={ clsx( | ||
| borderProps.className, | ||
| spacingProps.className, | ||
|
|
@@ -176,7 +196,7 @@ export function Edit( { attributes, setAttributes } ) { | |
| ...borderProps.style, | ||
| ...spacingProps.style, | ||
| ...dimensionsProps.style, | ||
| aspectRatio: '1', | ||
| height: 'auto', | ||
|
Comment on lines
188
to
198
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. LGTM! Looking at packages/components/src/placeholder/index.tsx I don't see any benefit Kapture.2026-02-18.at.16.37.28.mp4
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, my gut feeling is that the generalised |
||
| } } | ||
| /> | ||
| ) } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.