HEX
Server: Apache
System: Linux ecngx285.inmotionhosting.com 4.18.0-553.79.1.lve.el8.x86_64 #1 SMP Wed Oct 15 17:59:35 UTC 2025 x86_64
User: zeusxp5 (3862)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: /home/zeusxp5/tour.kamille.us/wp-content/plugins/surecart/app/helpers/block-style-helpers.php
<?php
/**
 * Get the current block styles.
 *
 * @param bool   $combine Whether to combine the styles or not.
 * @param object $block The block object.
 * @return array
 */
function sc_get_block_styles( $combine = true, $block = null ) {
	return \SureCart::block()->styles()->get( $combine, $block );
}

/**
 * Get cart block style.
 *
 * @param  array $attributes
 *
 * @return string
 */
function sc_get_cart_block_style( $attributes ) {
	$style = '';

	// Border style.
	$style .= isset( $attributes['border'] ) && $attributes['border'] !== false ? 'border-bottom: var(--sc-drawer-border);' : '';

	// Padding style.
	$style .= ! empty( $attributes['padding']['top'] ) ? 'padding-top: ' . $attributes['padding']['top'] . ';' : '';
	$style .= ! empty( $attributes['padding']['bottom'] ) ? 'padding-bottom: ' . $attributes['padding']['bottom'] . ';' : '';
	$style .= ! empty( $attributes['padding']['left'] ) ? 'padding-left: ' . $attributes['padding']['left'] . ';' : '';
	$style .= ! empty( $attributes['padding']['right'] ) ? 'padding-right: ' . $attributes['padding']['right'] . ';' : '';

	// Background color style.
	$style .= ! empty( $attributes['backgroundColor'] ) ? 'background-color: ' . $attributes['backgroundColor'] . ';' : '';

	// Text color style.
	$text_color = $attributes['textColor'] ?? 'var(--sc-line-item-title-color, var(--sc-input-label-color))';
	$style .= 'color: ' . $text_color . ';';

	return $style;
}