'fill-white',
'label' => __('Fill White', 'blockpress'),
)
);
register_block_style(
'core/button',
array(
'name' => 'outline-black',
'label' => __('Outline Black', 'blockpress'),
)
);
register_block_style(
'core/button',
array(
'name' => 'outline-white',
'label' => __('Outline White', 'blockpress'),
)
);
register_block_style(
'core/button',
array(
'name' => 'system-btn',
'label' => __('System button', 'blockpress'),
)
);
register_block_style(
'core/button',
array(
'name' => 'cubebtnwhite',
'label' => __('3d Button light', 'blockpress'),
)
);
register_block_style(
'core/button',
array(
'name' => 'cubebtndark',
'label' => __('3d Button dark', 'blockpress'),
)
);
// Add group styles: Boxshadow.
register_block_style(
'core/group',
array(
'name' => 'boxshadow',
'label' => __('Boxshadow', 'blockpress'),
)
);
register_block_style(
'core/group',
array(
'name' => 'lightshadow',
'label' => __('Light Shadow', 'blockpress'),
)
);
register_block_style(
'core/group',
array(
'name' => 'middleshadow',
'label' => __('Middle Shadow', 'blockpress'),
)
);
register_block_style(
'core/group',
array(
'name' => 'harddarkshadow',
'label' => __('Hard dark Shadow', 'blockpress'),
)
);
register_block_style(
'core/group',
array(
'name' => 'hardprimaryshadow',
'label' => __('Hard primary Shadow', 'blockpress'),
)
);
register_block_style(
'core/group',
array(
'name' => 'full-height',
'label' => __('Full-height', 'blockpress'),
)
);
register_block_style(
'core/group',
array(
'name' => 'hovershadow',
'label' => __('Shadow on hover', 'blockpress'),
)
);
register_block_style(
'core/group',
array(
'name' => 'hoverprimarycolor',
'label' => __('Sliding primary hover', 'blockpress'),
)
);
register_block_style(
'core/group',
array(
'name' => 'no-margin',
'label' => __('No Margin', 'blockpress'),
)
);
register_block_style(
'core/post-navigation-link',
array(
'name' => 'hovershadow',
'label' => __('Shadow on hover', 'blockpress'),
)
);
// Add image styles: Margin.
register_block_style(
'core/image',
array(
'name' => 'no-margin',
'label' => __('No Margin', 'blockpress'),
)
);
register_block_style(
'core/post-featured-image',
array(
'name' => 'fr-half-image-offset',
'label' => __('Half negative offset', 'blockpress'),
)
);
register_block_style(
'core/post-featured-image',
array(
'name' => 'fr-shadowradius',
'label' => __('Shadow radius', 'blockpress'),
)
);
// Add paragraph styles: Margin.
register_block_style(
'core/paragraph',
array(
'name' => 'no-margin',
'label' => __('No Margin', 'blockpress'),
)
);
register_block_style(
'core/paragraph',
array(
'name' => 'nounderline',
'label' => __('No underline for links', 'blockpress'),
)
);
register_block_style(
'core/paragraph',
array(
'name' => 'roundbig',
'label' => __('Circle shape', 'blockpress'),
)
);
register_block_style(
'core/paragraph',
array(
'name' => 'roundsmall',
'label' => __('Circle shape small', 'blockpress'),
)
);
// Add navigation styles: Fill, Outline.
register_block_style(
'core/navigation-link',
array(
'name' => 'fill-black',
'label' => __('Fill Black', 'blockpress'),
)
);
register_block_style(
'core/navigation-link',
array(
'name' => 'outline-black',
'label' => __('Outline Black', 'blockpress'),
)
);
register_block_style(
'core/navigation-link',
array(
'name' => 'fill-white',
'label' => __('Fill White', 'blockpress'),
)
);
register_block_style(
'core/navigation-link',
array(
'name' => 'outline-white',
'label' => __('Outline White', 'blockpress'),
)
);
register_block_style(
'core/navigation-link',
array(
'name' => 'accentbutton',
'label' => __('Accent Button', 'blockpress'),
)
);
register_block_style(
'core/navigation-link',
array(
'name' => 'primarybtn',
'label' => __('Primary Color Button', 'blockpress'),
)
);
register_block_style(
'core/navigation-link',
array(
'name' => 'secondarybtn',
'label' => __('Secondary Color Button', 'blockpress'),
)
);
register_block_style(
'core/navigation-link',
array(
'name' => 'cubeprimarybtn',
'label' => __('Primary 3d Button', 'blockpress'),
)
);
register_block_style(
'core/post-terms',
array(
'name' => 'blockpress-tags-primary',
'label' => __('Colored tags', 'blockpress'),
)
);
register_block_style(
'core/post-terms',
array(
'name' => 'blockpress-tags-secondary',
'label' => __('Colored Secondary tags', 'blockpress'),
)
);
register_block_style(
'core/post-terms',
array(
'name' => 'fr-tags-rounded',
'label' => __('Rounded border', 'blockpress'),
)
);
register_block_style(
'core/post-terms',
array(
'name' => 'blockpress-tags-nounder',
'label' => __('Underline on hover', 'blockpress'),
)
);
register_block_style(
'core/categories',
array(
'name' => 'listcategories',
'label' => __('Inline List', 'blockpress'),
)
);
register_block_style(
'woocommerce/product-categories',
array(
'name' => 'listcategories',
'label' => __('Inline List', 'blockpress'),
)
);
register_block_style(
'core/post-author',
array(
'name' => 'img-h-25',
'label' => __('Small image', 'blockpress'),
)
);
register_block_style(
'core/list',
array(
'name' => 'nounderline',
'label' => __('Unstyled view', 'blockpress'),
)
);
register_block_style(
'core/heading',
array(
'name' => 'line-separator',
'label' => __('Line Separator', 'blockpress'),
)
);
register_block_style(
'core/search',
array(
'name' => 'floating-white-search',
'label' => __('Floating search bar on click', 'blockpress'),
)
);
register_block_style('core/query', [
'name' => 'fr-borderquery',
'label' => __('Bordered block', 'blockpress'),
]);
register_block_style('core/query', [
'name' => 'fr-innerborderquery',
'label' => __('Inner Border', 'blockpress'),
]);
register_block_style('core/query', [
'name' => 'fr-bordernopaddquery',
'label' => __('No padding for image', 'blockpress'),
]);
register_block_style('core/query', [
'name' => 'fr-brdnpaddradius',
'label' => __('Rounded border box', 'blockpress'),
]);
register_block_style('core/query', [
'name' => 'fr-smartscrollitems',
'label' => __('Smart scroll carousel', 'blockpress'),
]);
register_block_style('core/query', [
'name' => 'fr-box-on-image',
'label' => __('Box intersection', 'blockpress'),
]);
register_block_style('core/query', [
'name' => 'fr-box-creative',
'label' => __('Box intersection 2', 'blockpress'),
]);
register_block_style(
'core/query',
array(
'name' => 'fr-shadowradius-query',
'label' => __('Shadow radius', 'blockpress'),
)
);
register_block_style('core/column', [
'name' => 'no-gap',
'label' => __('No gap', 'blockpress'),
]);
register_block_style(
'core/post-excerpt',
array(
'name' => 'text-clamp-two',
'label' => __('Show two lines', 'blockpress'),
)
);
register_block_style(
'core/post-excerpt',
array(
'name' => 'text-clamp-three',
'label' => __('Show three lines', 'blockpress'),
)
);
register_block_style(
'core/post-title',
array(
'name' => 'text-clamp-two',
'label' => __('Show two lines', 'blockpress'),
)
);
register_block_style(
'core/post-title',
array(
'name' => 'text-clamp-three',
'label' => __('Show three lines', 'blockpress'),
)
);
register_block_style(
'core/navigation-submenu',
array(
'name' => 'mega-menu-right',
'label' => __('Mega columned menu', 'blockpress'),
)
);
register_block_style(
'core/navigation-submenu',
array(
'name' => 'mega-menu-left',
'label' => __('Mega menu Open on left', 'blockpress'),
)
);
register_block_style(
'woocommerce/product-search',
array(
'name' => 'theme-search-main',
'label' => __('Theme search style', 'blockpress'),
)
);
register_block_style(
'woocommerce/product-search',
array(
'name' => 'theme-search-round',
'label' => __('Theme search with round corners', 'blockpress'),
)
);
register_block_style(
'core/site-logo',
array(
'name' => 'hideontabletdown',
'label' => __('Hide on mobile and tablets', 'blockpress'),
)
);
register_block_style(
'core/site-tagline',
array(
'name' => 'hideontabletdown',
'label' => __('Hide on mobile and tablets', 'blockpress'),
)
);
register_block_style(
'core/site-title',
array(
'name' => 'hideontabletdown',
'label' => __('Hide on mobile and tablets', 'blockpress'),
)
);
//Include conditional assets
add_filter('render_block', 'blockpress_theme_conditional_assets', 10, 2);
function blockpress_theme_conditional_assets($html, $block)
{
$block_style = '';
if(!is_admin()){//prevent loading conditional assets in admin
//We use checking by class name until Wordpress will have proper inline style registration for block styles
if (isset($block['blockName'])) {
if (!empty($block['attrs']['className'])) {
if ($block['blockName'] == 'core/button') {
if (str_contains($block['attrs']['className'], 'is-style-fill-white') !== false) {
$block_style .= '.wp-block-button.is-style-fill-white .wp-block-button__link {background-color: var(--wp--custom--color--white);border: 1px solid var(--wp--custom--color--white);color: var(--wp--custom--color--black);}
.wp-block-button.is-style-fill-white .wp-block-button__link:focus,.wp-block-button.is-style-fill-white .wp-block-button__link:hover {background-color: transparent;border: 1px solid var(--wp--custom--color--white);color: var(--wp--custom--color--white);}';
}
else if (str_contains($block['attrs']['className'], 'is-style-outline-black') !== false) {
$block_style .= '.wp-block-button.is-style-outline-black .wp-block-button__link{background-color:transparent;border:1px solid;border-color:currentColor;color:var(--wp--custom--color--black);padding:10px 25px}
.wp-block-button.is-style-outline-black .wp-block-button__link:focus,.wp-block-button.is-style-outline-black .wp-block-button__link:hover{background-color:var(--wp--custom--color--black);border-color:var(--wp--custom--color--black);color:var(--wp--custom--color--white)}';
}
else if (str_contains($block['attrs']['className'], 'is-style-outline-white') !== false) {
$block_style .= '.wp-block-button.is-style-outline-white .wp-block-button__link{background-color:transparent;border:1px solid;border-color:var(--wp--custom--color--white);color:var(--wp--custom--color--white)}
.wp-block-button.is-style-outline-white .wp-block-button__link:focus,.wp-block-button.is-style-outline-white .wp-block-button__link:hover{background-color:var(--wp--custom--color--white);color:var(--wp--custom--color--black)}';
}
else if (str_contains($block['attrs']['className'], 'is-style-system-btn') !== false) {
$block_style .= '.is-style-system-btn .wp-block-button__link{background-color: #f6f6f6;color: #111;box-shadow: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 2px rgba(0, 0, 0, 0.08); -webkit-font-smoothing: antialiased}
.is-style-system-btn .wp-block-button__link:hover {background-color: #f2f2f2; box-shadow: 0 -1px 2px 0 rgba(60,64,67,0.1), 0 5px 10px 0 rgba(60,64,67,0.14);}.is-style-system-btn .wp-block-button__link:active {box-shadow: 0 1px 1px 0 rgba(60,64,67,0.2), 0 1px 1px 0 rgba(60,64,67,0.2); background: #e9e9e9; outline: 0}';
}
else if (str_contains($block['attrs']['className'], 'is-style-cubebtnwhite') !== false) {
$block_style .= '.is-style-cubebtnwhite .wp-block-button__link{border:none !important; box-shadow: 0px 2px 4px rgb(45 35 66 / 10%), 0px 7px 13px -3px rgb(45 35 66 / 30%), inset 0px -3px 0px #d6d6e7}.is-style-cubebtnwhite .wp-block-button__link:hover{transform: translateY(-2px);}.is-style-cubebtnwhite .wp-block-button__link:active{transform: translateY(2px);box-shadow: 0px 2px 2px rgb(45 35 66 / 15%)}';
}
else if (str_contains($block['attrs']['className'], 'is-style-cubebtndark') !== false) {
$block_style .= '.is-style-cubebtndark .wp-block-button__link{border:none !important;box-shadow: 0px 2px 4px rgb(45 35 66 / 20%), 0px 7px 13px -3px rgb(45 35 66 / 30%), inset 0px -3px 0px rgb(58 65 111 / 50%);
text-shadow: 0 1px 0 rgb(0 0 0 / 40%);}.is-style-cubebtndark .wp-block-button__link:hover{transform: translateY(-2px);}.is-style-cubebtndark .wp-block-button__link:active{transform: translateY(2px);box-shadow: 0px 2px 2px rgb(45 35 66 / 15%)}';
}
} else if ($block['blockName'] == 'core/group') {
if (str_contains($block['attrs']['className'], 'is-style-boxshadow') !== false) {
$block_style .= '.is-style-boxshadow {box-shadow: 0 0 50px rgb(0 0 0 / 10%);}';
}
else if (str_contains($block['attrs']['className'], 'is-style-lightshadow') !== false) {
$block_style .= '.is-style-lightshadow {box-shadow: 0px 5px 20px 0 rgb(0 0 0 / 3%);}';
}
else if (str_contains($block['attrs']['className'], 'is-style-middleshadow') !== false) {
$block_style .= '.is-style-middleshadow {box-shadow: 0 5px 23px rgb(188 207 219 / 35%);border-top: 1px solid #f8f8f8;}';
}
else if (str_contains($block['attrs']['className'], 'is-style-harddarkshadow') !== false) {
$block_style .= '.is-style-harddarkshadow {box-shadow: 5px 5px var(--wp--custom--color--black);}';
}
else if (str_contains($block['attrs']['className'], 'is-style-hardprimaryshadow') !== false) {
$block_style .= '.is-style-hardprimaryshadow {box-shadow: 5px 5px var(--wp--preset--color--primary);}';
}
if (str_contains($block['attrs']['className'], 'is-style-hovershadow') !== false) {
$block_style .= '.is-style-hovershadow:hover {box-shadow: 0 3px 40px rgb(188 207 219 / 35%);}.is-style-hovershadow{transition: box-shadow 0.5s var(--blockpress-transition)}';
}
if (str_contains($block['attrs']['className'], 'is-style-hoverprimarycolor') !== false) {
$block_style .= '.is-style-hoverprimarycolor {transition: color 0.8s var(--blockpress-transition);position:relative; overflow:hidden}.is-style-hoverprimarycolor:after{transition: width 0.6s var(--blockpress-transition);position: absolute;top: 0;left: 0;right: 0;bottom: 0;width: 0;height: 100%;background: var(--wp--preset--color--primary);z-index: -1;content: "";}.is-style-hoverprimarycolor:hover:after{width:100%}.is-style-hoverprimarycolor:hover{color:var(--wp--preset--color--textonprimary) !important}.is-style-hoverprimarycolor:hover a{color:var(--wp--preset--color--textonprimary) !important}';
}
if (str_contains($block['attrs']['className'], 'fr-page-preloader') !== false) {
$block_style .= '.fr-page-preloader{margin:0 !important; padding:0 !important;position: fixed;top: 0;left: 0;width: 100vw;height: 100vh;display: block;background: #FFFFFF;pointer-events: none;transform: scaleX(1);transition: transform .3s cubic-bezier(.27,.76,.38,.87);transform-origin: right center;z-index: 99999999999999999999;display:flex; justify-content:center; align-items:center;}.fr-page-preloader:empty:after{height: 48px ;width: 48px ;color: rgba(140, 2, 232, 0.08);display: inline-block;border: 4px solid;border-radius: 50%;border-right-color: rgb(140 2 232 / 28%);transform: rotate(0);animation: fr-loading-rotate 1s ease-in-out infinite;pointer-events: none;content:"";will-change: transform;}@keyframes fr-loading-rotate {0% {transform: rotate(0);}100% {transform: rotate(360deg);}}body.fr-rendered .fr-page-preloader {transform: scaleX(0);transform-origin: left center;}';
wp_enqueue_script('blockpress-pagepreload');
}
if (str_contains($block['attrs']['className'], 'fr-scaleup-small') !== false) {
$block_style .= '.fr-scaleup-small{transform: scale(1.07)}';
}
// if (str_contains($block['attrs']['className'], 'fr-lottieloader') !== false) {
// wp_enqueue_script('fr-lottieloader');
// $block_style .='.fr-lottieloader.lottie-loaded lottie-player{display:inline-block}';
// }
if (str_contains($block['attrs']['className'], 'is-style-full-height') !== false) {
$block_style .= '.is-style-full-height {align-items: center;display: grid;min-height: 100vh;}';
}
if (str_contains($block['attrs']['className'], 'is-style-no-margin') !== false) {
$block_style .= '.is-style-no-margin {margin:0 !important;}';
}
if (str_contains($block['attrs']['className'], 'fr-negative-margin-5') !== false) {
$block_style .= '.fr-negative-margin-5{margin-top:-5rem !important;position: relative;z-index: 2;}';
}
else if (str_contains($block['attrs']['className'], 'fr-negative-margin-3') !== false) {
$block_style .= '.fr-negative-margin-3{margin-top:-3rem !important;position: relative;z-index: 2;}';
}
else if (str_contains($block['attrs']['className'], 'fr-negative-margin-10') !== false) {
$block_style .= '.fr-negative-margin-10{margin-top:-10rem !important;position: relative;z-index: 2;}';
}
else if (str_contains($block['attrs']['className'], 'fr-negative-margin-bottom-3') !== false) {
$block_style .= '.fr-negative-margin-bottom-3{margin-bottom:-3rem !important;position: relative;z-index: 2;}';
}
else if (str_contains($block['attrs']['className'], 'fr-negative-margin-bottom-5') !== false) {
$block_style .= '.fr-negative-margin-bottom-5{margin-bottom:-5rem !important;position: relative;z-index: 2;}';
}
else if (str_contains($block['attrs']['className'], 'fr-negative-margin-bottom-10') !== false) {
$block_style .= '.fr-negative-margin-bottom-10{margin-bottom:-10rem !important;position: relative;z-index: 2;}';
}
if (str_contains($block['attrs']['className'], 'is-style-border-bottom') !== false) {
$block_style .= '.is-style-border-bottom {border-bottom:1px solid var(--wp--preset--color--lightborder)}';
}
}else if ($block['blockName'] == 'core/post-navigation-link') {
if (str_contains($block['attrs']['className'], 'is-style-hovershadow') !== false) {
$block_style .= '.wp-block-post-navigation-link.is-style-hovershadow:before{position: absolute;top: 0;right: 0;left: 0;bottom: 0;transition: box-shadow 0.5s var(--blockpress-transition);content: "";border-radius: 5px;border: 1px solid #eee;}.wp-block-post-navigation-link.is-style-hovershadow:hover:before{box-shadow: 0 3px 40px rgb(188 207 219 / 35%);}.wp-block-post-navigation-link.is-style-hovershadow:empty:before{display:none}.wp-block-post-navigation-link.is-style-hovershadow{padding:20px}.wp-block-post-navigation-link.is-style-hovershadow a{text-decoration:none}';
}
} else if ($block['blockName'] == 'core/post-featured-image') {
if (str_contains($block['attrs']['className'], 'is-style-fr-half-image-offset') !== false) {
$block_style .= '.is-style-fr-half-image-offset::before {content: "";position: absolute;left: 0;bottom: 0;height: 50%;background-color: white;width:100vw;margin-left: calc(-100vw / 2 + 100% / 2);margin-right: calc(-100vw / 2 + 100% / 2);}.is-style-fr-half-image-offset, .is-style-fr-half-image-offset img{position:relative; margin-top:0; margin-bottom:0}';
}
else if (str_contains($block['attrs']['className'], 'is-style-fr-shadowradius') !== false) {
$block_style .= '.is-style-fr-shadowradius{box-shadow: 0 0 50px rgb(49 45 161 / 12%);border-radius: 20px;}';
}
if (str_contains($block['attrs']['className'], 'fr-hover-scale-img') !== false) {
$block_style .= '.fr-hover-scale-img {overflow:hidden}.fr-hover-scale-img img{transition: transform .6s var(--blockpress-transition);}.fr-hover-scale-img:hover img {transform: scale(1.05);}.fr-hover-scale-img a{display:block}';
}
}else if ($block['blockName'] == 'core/image') {
if (str_contains($block['attrs']['className'], 'is-style-no-margin') !== false) {
$block_style .= '.wp-block-image.is-style-no-margin {margin:0 !important;}';
}
if (str_contains($block['attrs']['className'], 'fr-negative-margin-5') !== false) {
$block_style .= '.fr-negative-margin-5{margin-top:-5rem !important;position: relative;z-index: 2;}';
}
else if (str_contains($block['attrs']['className'], 'fr-negative-margin-3') !== false) {
$block_style .= '.fr-negative-margin-3{margin-top:-3rem !important;position: relative;z-index: 2;}';
}
else if (str_contains($block['attrs']['className'], 'fr-negative-margin-10') !== false) {
$block_style .= '.fr-negative-margin-10{margin-top:-10rem !important;position: relative;z-index: 2;}';
}
else if (str_contains($block['attrs']['className'], 'fr-negative-margin-bottom-3') !== false) {
$block_style .= '.fr-negative-margin-bottom-3{margin-bottom:-3rem !important;position: relative;z-index: 2;}';
}
else if (str_contains($block['attrs']['className'], 'fr-negative-margin-bottom-5') !== false) {
$block_style .= '.fr-negative-margin-bottom-5{margin-bottom:-5rem !important;position: relative;z-index: 2;}';
}
else if (str_contains($block['attrs']['className'], 'fr-negative-margin-bottom-10') !== false) {
$block_style .= '.fr-negative-margin-bottom-10{margin-bottom:-10rem !important;position: relative;z-index: 2;}';
}
}
else if ($block['blockName'] == 'core/list') {
if (str_contains($block['attrs']['className'], 'is-style-nounderline') !== false) {
$block_style .= 'ul.is-style-nounderline {margin:0; padding:0;list-style:none}ul.is-style-nounderline a{text-decoration:none}ul.is-style-nounderline li{list-style:none}';
}
} else if ($block['blockName'] == 'core/navigation-link') {
if (str_contains($block['attrs']['className'], 'is-style-fill-black') !== false) {
$block_style .= '.wp-block-navigation-item.is-style-fill-black a{background-color:var(--wp--custom--color--black);color:var(--wp--custom--color--white);padding:5px 15px !important; line-height: 1.8 }
.wp-block-navigation-item.is-style-fill-black a:focus,.wp-block-navigation-item.is-style-fill-black a:hover{background-color:var(--wp--custom--color--white);color:var(--wp--custom--color--black)}';
}
else if (str_contains($block['attrs']['className'], 'is-style-outline-black') !== false) {
$block_style .= '.wp-block-navigation-item.is-style-outline-black a{border:1px solid var(--wp--custom--color--black); background-color:transparent;color:var(--wp--custom--color--black);padding:5px 15px !important; line-height: 1.8}
.wp-block-navigation-item.is-style-outline-black a:focus,.wp-block-navigation-item.is-style-outline-black a:hover{background-color:var(--wp--custom--color--black);color:var(--wp--custom--color--white)}';
}
else if (str_contains($block['attrs']['className'], 'is-style-fill-white') !== false) {
$block_style .= '.wp-block-navigation-item.is-style-fill-white a{background-color:var(--wp--custom--color--white);color:var(--wp--custom--color--black);padding:5px 15px !important; line-height: 1.8 }
.wp-block-navigation-item.is-style-fill-white a:focus,.wp-block-navigation-item.is-style-fill-white a:hover{background-color:var(--wp--custom--color--black);color:var(--wp--custom--color--white)}';
}
else if (str_contains($block['attrs']['className'], 'is-style-outline-white') !== false) {
$block_style .= '.wp-block-navigation-item.is-style-outline-white a{border:1px solid var(--wp--custom--color--white); background-color:transparent;color:var(--wp--custom--color--white);padding:5px 15px !important; line-height: 1.8}
.wp-block-navigation-item.is-style-outline-white a:focus,.wp-block-navigation-item.is-style-outline-white a:hover{background-color:var(--wp--custom--color--white);color:var(--wp--custom--color--black)}';
}
else if (str_contains($block['attrs']['className'], 'is-style-accentbutton') !== false) {
$block_style .= '.wp-block-navigation-item.is-style-accentbutton a{background-color:var(--wp--preset--color--button);color:var(--wp--preset--color--textonbutton);padding:5px 15px !important; line-height: 1.8 }';
}
else if (str_contains($block['attrs']['className'], 'is-style-primarybtn') !== false) {
$block_style .= '.wp-block-navigation-item.is-style-primarybtn a{background-color:var(--wp--preset--color--primary);color:var(--wp--preset--color--textonprimary);padding:5px 15px !important; line-height: 1.8 }';
}
else if (str_contains($block['attrs']['className'], 'is-style-cubeprimarybtn') !== false) {
$block_style .= '.wp-block-navigation-item.is-style-cubeprimarybtn a{background-color:var(--wp--preset--color--primary);color:var(--wp--preset--color--textonprimary);padding:5px 15px !important; line-height: 1.8;border:none !important;box-shadow: 0px 2px 4px rgb(45 35 66 / 20%), 0px 7px 13px -3px rgb(45 35 66 / 30%), inset 0px -3px 0px rgb(58 65 111 / 50%);text-shadow: 0 1px 0 rgb(0 0 0 / 40%); border-radius:5px}.wp-block-navigation-item.is-style-cubeprimarybtn a:after{display:none}.wp-block-navigation-item.is-style-cubeprimarybtn a:active{transform: translateY(2px);box-shadow: 0px 2px 2px rgb(45 35 66 / 15%)}.wp-block-navigation-item.is-style-cubeprimarybtn a:hover{transform: translateY(-2px);}.wp-block-navigation-item.fr-cubebtndark a:hover{transform: translateY(-2px);}';
}
else if (str_contains($block['attrs']['className'], 'is-style-secondarybtn') !== false) {
$block_style .= '.wp-block-navigation-item.is-style-secondarybtn a{background-color:var(--wp--preset--color--secondary);color:var(--wp--preset--color--textonprimary);padding:5px 15px !important; line-height: 1.8 }';
}
if (str_contains($block['attrs']['className'], 'fr-soft-rounded') !== false) {
$block_style .= '.wp-block-navigation-item.fr-soft-rounded a{border-radius:5px}';
}
if (str_contains($block['attrs']['className'], 'fr-hard-rounded') !== false) {
$block_style .= '.wp-block-navigation-item.fr-hard-rounded a{border-radius:100px}';
}
if (str_contains($block['attrs']['className'], 'fr-cubebtnwhite') !== false) {
$block_style .= '.wp-block-navigation-item.fr-cubebtnwhite a{border:none !important; box-shadow: 0px 2px 4px rgb(45 35 66 / 10%), 0px 7px 13px -3px rgb(45 35 66 / 30%), inset 0px -3px 0px #d6d6e7}.wp-block-navigation-item.fr-cubebtnwhite a:hover{transform: translateY(-2px);}.wp-block-navigation-item.fr-cubebtnwhite a:active{transform: translateY(2px);box-shadow: 0px 2px 2px rgb(45 35 66 / 15%)}.wp-block-navigation-item.fr-cubebtnwhite a:after{display:none}';
}
else if (str_contains($block['attrs']['className'], 'fr-cubebtndark') !== false) {
$block_style .= '.wp-block-navigation-item.fr-cubebtndark a{border:none !important;box-shadow: 0px 2px 4px rgb(45 35 66 / 20%), 0px 7px 13px -3px rgb(45 35 66 / 30%), inset 0px -3px 0px rgb(58 65 111 / 50%);
text-shadow: 0 1px 0 rgb(0 0 0 / 40%);}.wp-block-navigation-item.fr-cubebtndark a:hover{transform: translateY(-2px);}.wp-block-navigation-item.fr-cubebtndark a:active{transform: translateY(2px);box-shadow: 0px 2px 2px rgb(45 35 66 / 15%)}.wp-block-navigation-item.fr-cubebtndark a:after{display:none}';
}
} else if ($block['blockName'] == 'core/post-terms') {
if (str_contains($block['attrs']['className'], 'is-style-blockpress-tags-primary') !== false) {
$block_style .= '.is-style-blockpress-tags-primary.wp-block-post-terms a{display:inline-block;margin:0 .25rem;background:var(--wp--preset--color--lighttag);padding:5px 10px;font-size:var(--wp--preset--font-size--xsmall);text-decoration:none;border-radius:5px; line-height:var(--wp--custom--line-height--normal);color:currentColor;}.is-style-blockpress-tags-primary.wp-block-post-terms .wp-block-post-terms__separator{display:none}';
}
else if (str_contains($block['attrs']['className'], 'is-style-blockpress-tags-secondary') !== false) {
$block_style .= '.is-style-blockpress-tags-secondary.wp-block-post-terms a{display:inline-block;margin:0 .25rem;background:var(--wp--preset--color--lightsecondarytag);padding:5px 10px;font-size:var(--wp--preset--font-size--xsmall);text-decoration:none;border-radius:5px;line-height:var(--wp--custom--line-height--normal);color:currentColor;}.is-style-blockpress-tags-secondary.wp-block-post-terms .wp-block-post-terms__separator{display:none}';
}
else if (str_contains($block['attrs']['className'], 'is-style-fr-tags-rounded') !== false) {
$block_style .= '.is-style-fr-tags-rounded.wp-block-post-terms a{display:inline-block;margin:0 .25rem .25rem .25rem;padding:2px 10px;text-decoration:none;border-radius:50px;color:currentColor;border:1px solid currentColor; opacity:0.8; transition: opacity 0.5s ease }.is-style-fr-tags-rounded.wp-block-post-terms .wp-block-post-terms__separator{display:none}.is-style-fr-tags-rounded.wp-block-post-terms a:hover{opacity:1}';
}
else if (str_contains($block['attrs']['className'], 'is-style-blockpress-tags-nounder') !== false) {
$block_style .= '.is-style-blockpress-tags-nounder.wp-block-post-terms a{text-decoration: none;display:inline;background-repeat:no-repeat;background-image:linear-gradient(transparent calc(100% - 1px),currentColor 1px);transition:.7s var(--blockpress-transition);background-size:0 95%;}.is-style-blockpress-tags-nounder.wp-block-post-terms a:hover{background-size:100% 95%}';
}
} else if ($block['blockName'] == 'core/author') {
if (str_contains($block['attrs']['className'], 'is-style-img-h-25') !== false) {
$block_style .= '.is-style-img-h-25.wp-block-post-author img{height:25px; width:25px}';
}
}else if ($block['blockName'] == 'core/categories') {
if (str_contains($block['attrs']['className'], 'is-style-listcategories') !== false) {
$block_style .= 'ul.is-style-listcategories, .is-style-listcategories ul{display:flex; flex-wrap:wrap;
padding: 0 !important; gap:12px; font-size:17px}.is-style-listcategories li{list-style:none;padding:5px 10px;background:var(--wp--preset--color--lightsecondarytag); transition: transform 0.3s var(--blockpress-transition)}.is-style-listcategories li a{ text-decoration:none}.is-style-listcategories li:hover{transform: scale(1.07)}';
}
}else if ($block['blockName'] == 'woocommerce/product-categories') {
if (str_contains($block['attrs']['className'], 'is-style-listcategories') !== false) {
$block_style .= 'ul.is-style-listcategories, .is-style-listcategories ul{display:flex; flex-wrap:wrap;
padding: 0 !important; gap:12px; font-size:17px}.is-style-listcategories li{list-style:none;padding:5px 10px;background:var(--wp--preset--color--lightsecondarytag); transition: transform 0.3s var(--blockpress-transition)}.is-style-listcategories li a{ text-decoration:none}.is-style-listcategories li:hover{transform: scale(1.07)}';
}
} else if ($block['blockName'] == 'core/query') {
if (str_contains($block['attrs']['className'], 'is-style-fr-borderquery') !== false) {
$block_style .= '.is-style-fr-borderquery > ul > li{border:1px solid #eee; padding:15px;box-sizing: border-box; margin-bottom:1.25em}.is-style-fr-borderquery figure{margin-top:0}';
}
else if (str_contains($block['attrs']['className'], 'is-style-fr-bordernopaddquery') !== false) {
$block_style .= '.is-style-fr-bordernopaddquery > ul > li{border:1px solid #eee; padding:15px;box-sizing: border-box;margin-bottom:1.25em}.editor-styles-wrapper .is-style-fr-bordernopaddquery figure.wp-block-post-featured-image, .is-style-fr-bordernopaddquery figure.wp-block-post-featured-image{margin:-15px -15px 12px -15px !important}';
}
else if (str_contains($block['attrs']['className'], 'is-style-fr-shadowradius-query') !== false) {
$block_style .= '.is-style-fr-shadowradius-query > ul > li{box-shadow: 0 0 50px rgb(49 45 161 / 16%);border-radius: 20px;overflow:hidden}';
}
else if (str_contains($block['attrs']['className'], 'is-style-fr-innerborderquery') !== false) {
$block_style .= '.is-style-fr-innerborderquery > ul > li{position:relative;transition: transform .5s ease}.is-style-fr-innerborderquery > ul > li:before{position: absolute;top: 12px;right: 12px;z-index: 2;opacity: 1;transform: scale(1);bottom: 12px;left: 12px;border: 1px solid #e1e3ed69;content: "";pointer-events: none;transition: opacity .35s,transform .6s;}.is-style-fr-innerborderquery > ul > li:hover:before{transform: scale(1.25);opacity:0}.is-style-fr-innerborderquery > ul > li:hover{transform: translateY(-5px)}';
}
else if (str_contains($block['attrs']['className'], 'is-style-fr-brdnpaddradius') !== false) {
$block_style .= '.is-style-fr-brdnpaddradius > ul > li{border-radius:8px; padding:15px;box-sizing: border-box;box-shadow:-2px 3px 10px 1px rgb(202 202 202 / 26%);margin-bottom:1.25em}.editor-styles-wrapper .is-style-fr-brdnpaddradius figure.wp-block-post-featured-image, .is-style-fr-brdnpaddradius figure.wp-block-post-featured-image{margin:-15px -15px 12px -15px !important;border-radius:8px 8px 0 0}';
}
else if (str_contains($block['attrs']['className'], 'is-style-fr-box-on-image') !== false) {
$block_style .= '.is-style-fr-box-on-image > ul > li > .wp-block-group{margin:-100px 30px 50px 30px; position:relative; box-shadow:0 0 50px rgb(0 0 0 / 10%); border-radius:10px}.is-style-fr-box-on-image > ul > li .wp-block-post-featured-image{border-radius:10px}.is-style-fr-box-creative > ul.is-flex-container > li > .wp-block-group{margin: -50px 30px 0 30px}';
}
else if (str_contains($block['attrs']['className'], 'is-style-fr-box-creative') !== false) {
$block_style .= '.is-style-fr-box-creative > ul > li > .wp-block-group{margin:-80px 50px 50px 0; position:relative; box-shadow:0 0 50px rgb(0 0 0 / 10%); border-radius:0 18px 18px 18px}.is-style-fr-box-creative > ul > li .wp-block-post-featured-image{border-radius:18px}.is-style-fr-box-creative > ul.is-flex-container > li > .wp-block-group{margin: -50px 50px 0 0}';
}
if (str_contains($block['attrs']['className'], 'is-style-fr-smartscrollitems') !== false) {
$block_style .= '.is-style-fr-smartscrollitems{overflow-x: auto !important;overflow-y: hidden;white-space: nowrap; -webkit-overflow-scrolling: touch;scroll-behavior: smooth;scroll-snap-type: x mandatory;}.is-style-fr-smartscrollitems > ul{flex-wrap: nowrap !important;}.is-style-fr-smartscrollitems > ul > li{border-radius:8px; padding:15px;box-sizing: border-box;border:1px solid #eee;margin-bottom:1.25em; min-width:230px;display: inline-block;margin: 0 13px 0px 0 !important;white-space: normal !important;scroll-snap-align: start;}.editor-styles-wrapper .is-style-fr-smartscrollitems figure.wp-block-post-featured-image, .is-style-fr-smartscrollitems figure.wp-block-post-featured-image{margin:-15px -15px 12px -15px !important}.is-style-fr-smartscrollitems figure.wp-block-post-featured-image img{border-radius:8px 8px 0 0}.is-style-fr-smartscrollitems::-webkit-scrollbar-track{background-color:transparent;border-radius:20px}.is-style-fr-smartscrollitems::-webkit-scrollbar-thumb{background-color:transparent;border-radius:20px;border:1px solid transparent}.is-style-fr-smartscrollitems:hover::-webkit-scrollbar-thumb{background-color:#ddd;}.is-style-fr-smartscrollitems:hover{scrollbar-color: #ddd #fff;}';
}
} else if ($block['blockName'] == 'core/paragraph') {
if (str_contains($block['attrs']['className'], 'is-style-no-margin') !== false) {
$block_style .= '.is-style-no-margin {margin:0 !important;}';
}
else if (str_contains($block['attrs']['className'], 'is-style-nounderline') !== false) {
$block_style .= 'p.is-style-nounderline a{text-decoration:none}';
}
else if (str_contains($block['attrs']['className'], 'is-style-roundbig') !== false) {
$block_style .= 'p.is-style-roundbig{width: 50px;height: 50px;line-height: 50px;text-align: center;border-radius: 50%;padding:0 !important}';
}
else if (str_contains($block['attrs']['className'], 'is-style-roundsmall') !== false) {
$block_style .= 'p.is-style-roundsmall{width: 33px;height: 33px;line-height: 33px;text-align: center;border-radius: 50%;padding:0 !important}';
}
}else if ($block['blockName'] == 'core/columns') {
if (str_contains($block['attrs']['className'], 'fr-tablet-collapse') !== false) {
$block_style .= '@media only screen and (max-width: 992px){.fr-tablet-collapse{display:block !important}.fr-tablet-collapse.wp-block-columns:not(.is-not-stacked-on-mobile)>.wp-block-column:not(:first-child){margin-left:0}}';
}
}else if ($block['blockName'] == 'core/heading') {
if (str_contains($block['attrs']['className'], 'is-style-line-separator') !== false) {
$block_style .= '.is-style-line-separator{display:flex; align-items:center; gap:10px}.is-style-line-separator:before{content: "";width: 50px;border-top-width: 2px;border-top-color: var(--wp--preset--color--primary);border-top-style: solid;display: inline-block;}';
}
}else if ($block['blockName'] == 'core/search') {
if (str_contains($block['attrs']['className'], 'is-style-floating-white-search') !== false) {
if(!is_admin()){
wp_enqueue_style('blockpress-floating-search');
wp_enqueue_script('blockpress-floating-search');
}
}
}else if ($block['blockName'] == 'core/column') {
if (str_contains($block['attrs']['className'], 'fr-scaleup-small') !== false) {
$block_style .= '.fr-scaleup-small{transform: scale(1.07)}';
}
if (str_contains($block['attrs']['className'], 'is-style-no-gap') !== false) {
$block_style .= '.is-style-no-gap{margin-left:0 !important; margin-right:0 !important; margin-top:0 !important}';
}
}else if ($block['blockName'] == 'core/post-excerpt' || $block['blockName'] == 'core/post-title') {
if (str_contains($block['attrs']['className'], 'is-style-text-clamp-two') !== false) {
$block_style .= '.is-style-text-clamp-two p, .wp-block-post-title.is-style-text-clamp-two{display: -webkit-box;-webkit-line-clamp: 2;-webkit-box-orient: vertical; overflow: hidden; margin:0}';
}
else if (str_contains($block['attrs']['className'], 'is-style-text-clamp-three') !== false) {
$block_style .= '.is-style-text-clamp-three p, .wp-block-post-title.is-style-text-clamp-three{display: -webkit-box;-webkit-line-clamp: 3;-webkit-box-orient: vertical; overflow: hidden; margin:0}';
}
}else if ($block['blockName'] == 'core/navigation-submenu') {
if (str_contains($block['attrs']['className'], 'is-style-mega-menu-right') !== false || str_contains($block['attrs']['className'], 'is-style-mega-menu-left') !== false) {
wp_enqueue_style('blockpress-mega-menu');
}
}else if ($block['blockName'] == 'core/template-part') {
if (str_contains($block['attrs']['className'], 'fr-position-absolute') !== false) {
$block_style .= '.fr-position-absolute > div{position:absolute; left: var(--wp--custom--spacing--outer);right: var(--wp--custom--spacing--outer);z-index:999;}.has-modal-open .fr-position-absolute > div{z-index: 100001;} .fr-sticky-enable.fr-position-absolute > div{background:black !important;color:white; left:0; right:0}.fr-sticky-enable.fr-position-absolute.animate-to-white > div{background:white !important; color:black}.fr-sticky-enable.fr-position-absolute.animate-to-primary > div{background:var(--wp--preset--color--primary) !important; color:white}';
}
}else if ($block['blockName'] == 'woocommerce/product-search') {
if (str_contains($block['attrs']['className'], 'is-style-theme-search-main') !== false) {
$block_style .= '.is-style-theme-search-main button{background-color: var(--wp--preset--color--primary);border: 1px solid transparent;border-radius: 3px;color: var(--wp--preset--color--textonprimary);font-family: var(--wp--preset--font-family--primary);font-size: var(--wp--preset--font-size--small);padding-left:16px !important;padding-right:16px !important;text-decoration: none;white-space: normal;width: auto;transition: all 0.3s var(--blockpress-transition);display: inline-block;white-space: nowrap;}.is-style-theme-search-round input{border-radius: 3px;}';
}else if (str_contains($block['attrs']['className'], 'is-style-theme-search-round') !== false) {
$block_style .= '.is-style-theme-search-round button{background-color: var(--wp--preset--color--primary);border: 1px solid transparent;border-radius: 0 50px 50px 0;color: var(--wp--preset--color--textonprimary);font-family: var(--wp--preset--font-family--primary);font-size: var(--wp--preset--font-size--small);padding-left:20px !important;padding-right:20px !important;text-decoration: none;white-space: normal;width: auto;transition: all 0.3s var(--blockpress-transition);display: inline-block;white-space: nowrap;}.is-style-theme-search-round input{border-radius: 50px 0 0 50px;padding-left: 20px !important;}';
}
}else if ($block['blockName'] == 'core/site-logo' || $block['blockName'] == 'core/site-title' || $block['blockName'] == 'core/site-tagline') {
if (str_contains($block['attrs']['className'], 'is-style-hideontabletdown') !== false) {
$block_style .= '@media(max-width:991.98px){.is-style-hideontabletdown{display:none !important}}';
}
}
if (str_contains($block['attrs']['className'], 'fr-animate') !== false) {
if(!is_admin()){
wp_enqueue_style('blockpress-animate');
wp_enqueue_script('blockpress-animate');
}
}
}
if (!empty($block['attrs'])) {
if ($block['blockName'] == 'core/cover' || $block['blockName'] == 'core/column' || $block['blockName'] == 'core/columns' || $block['blockName'] == 'core/group'|| $block['blockName'] == 'core/template-part' || $block['blockName'] == 'core/image' || $block['blockName'] == 'core/button' || $block['blockName'] == 'core/site-title' || $block['blockName'] == 'core/site-logo') {
if (!empty($block['attrs']['frhideOnMobile'])) {
$block_style .= '@media(max-width:575.98px){.fr-mobile-hide{display:none !important}}';
}
if (!empty($block['attrs']['frhideOnTablet'])) {
$block_style .= '@media(max-width:991.98px) and (min-width:576px){.fr-tablet-hide{display:none !important}}';
}
if (!empty($block['attrs']['frhideOnDesktop'])) {
$block_style .= '@media(min-width:992px){.fr-desktop-hide{display:none !important}}';
}
if ($block['blockName'] == 'core/column' || $block['blockName'] == 'core/group') {
if (!empty($block['attrs']['frsetSticky'])) {
$block_style .= '@media(min-width:992px){.fr-position-sticky{position:sticky !important; top: calc(30px + var(--blockpress-sticky-height, 0px));align-self: flex-start !important;}}';
}
if (!empty($block['attrs']['frMobCentertext'])) {
$block_style .= '@media(max-width:575.98px){.fr-mobile-textcenter, .fr-mobile-textcenter > *{text-align: center !important;justify-content: center !important;}}';
}
if (!empty($block['attrs']['frMobPaddingDisable'])) {
$block_style .= '@media(max-width:575.98px){.fr-mobile-paddingdisable{padding:0 !important;}}';
}
if ($block['blockName'] == 'core/group' && !empty($block['attrs']['frStickyHeader'])) {
wp_enqueue_style('blockpress-stickyheader');
wp_enqueue_script('blockpress-stickyheader');
}
}
}
}
if($block['blockName'] == 'blockpress/lottie'){
$block_style .='.fr-lottieloader img{transition: opacity 1s ease-in}.fr-lottieloader lottie-player:empty{display:none}.fr-lottieloader.lottie-loaded lottie-player{display:inline-block}.fr-lottieloader.lottie-loaded img{opacity:0}';
if(!empty($block['attrs']['widthMobile'])){
$block_style .='@media(max-width:768px){.'.$block['attrs']['id'].' img, .'.$block['attrs']['id'].' lottie-player{width: '.$block['attrs']['widthMobile'].'px!important}}';
}
if(!empty($block['attrs']['heightMobile'])){
$block_style .='@media(max-width:768px){.'.$block['attrs']['id'].' img, .'.$block['attrs']['id'].' lottie-player{height: '.$block['attrs']['heightMobile'].'px!important}}';
}
wp_enqueue_script('blockpress-lottieloader');
}
}
if ($block_style) {
$html = $html . '';
}
}
return $html;
}
////////////////////////////////////////////////////////////////
//Woocommerce conditional assets
////////////////////////////////////////////////////////////////
if(!function_exists('blockpress_generate_incss')) {
function blockpress_generate_incss($type='', $random = '', $atts=array()) {
$output = '';
return apply_filters('fr_generate_incss_filter', $output );
}
}