How to use the @wordpress/editor.getFontSizeClass function in @wordpress/editor

To help you get started, we’ve selected a few @wordpress/editor examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Automattic / jetpack / extensions / blocks / testimonial / edit.js View on Github external
render() {
		const { attributes, isSelected, fontSize, setFontSize } = this.props;
		const hasMedia = attributes.mediaUrl && attributes.mediaId;
		const avatarTooltip = hasMedia ? __( 'Change avatar' ) : __( 'Add avatar' );
		const fontSizeClass = getFontSizeClass( attributes.fontSize );
		const styles = {
			fontSize: fontSizeClass ? undefined : attributes.customFontSize,
		};
		const className = classnames( this.props.className, {
			'has-media': hasMedia || isSelected,
			[ `is-aligned-${ attributes.align }` ]: !! attributes.align,
			[ fontSizeClass ]: fontSizeClass,
		} );

		return (
github Automattic / jetpack / extensions / blocks / testimonial / save.js View on Github external
export default ( { attributes, className } ) => {
	const { align, content, name, title, mediaUrl, mediaId, fontSize, customFontSize } = attributes;
	const hasMedia = mediaUrl && mediaId;
	const fontSizeClass = getFontSizeClass( fontSize );
	const styles = {
		fontSize: fontSizeClass ? undefined : customFontSize,
	};
	const blockClassName = classnames( className, {
		'has-media': hasMedia,
		[ `is-aligned-${ align }` ]: !! align,
		[ fontSizeClass ]: fontSizeClass,
	} );

	return (
		<div style="{">
			</div>