acf blocks: adjust padding and contrast controls
This commit is contained in:
@@ -30,17 +30,17 @@ class CssClasses {
|
|||||||
'tint' => $props['bg_tint'],
|
'tint' => $props['bg_tint'],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if(($knockout && $Colour->is_dark($hex) || $props['contrast'] == 'light'))
|
if(($props['contrast'] && $knockout))
|
||||||
$classes[] = 'knockout';
|
$classes[] = 'knockout';
|
||||||
|
|
||||||
if($props['padding_top'])
|
if(!$props['padding_top'])
|
||||||
$classes[] = 'section-zero-top';
|
$classes[] = 'section-zero-top';
|
||||||
|
|
||||||
if($props['padding_bottom'])
|
if(!$props['padding_bottom'])
|
||||||
$classes[] = 'section-zero-bottom';
|
$classes[] = 'section-zero-bottom';
|
||||||
|
|
||||||
if($props['bg_image'])
|
if($props['bg_image'])
|
||||||
$classes[] = "bg-watermarked";
|
$classes[] = "has-bg-image";
|
||||||
|
|
||||||
return $classes;
|
return $classes;
|
||||||
}
|
}
|
||||||
@@ -89,7 +89,7 @@ class CssClasses {
|
|||||||
if($args['align'])
|
if($args['align'])
|
||||||
$classes[] = 'align-' . $args['align'];
|
$classes[] = 'align-' . $args['align'];
|
||||||
|
|
||||||
if(($Colour->is_dark($hex) || $bg_props['contrast'] == 'light'))
|
if(($bg_props['contrast']))
|
||||||
$classes[] = 'knockout';
|
$classes[] = 'knockout';
|
||||||
|
|
||||||
return $classes;
|
return $classes;
|
||||||
|
|||||||
@@ -17,9 +17,12 @@
|
|||||||
"id": ""
|
"id": ""
|
||||||
},
|
},
|
||||||
"choices": {
|
"choices": {
|
||||||
"0": "auto",
|
"0": "None",
|
||||||
"primary": "<i class=\"fas fa-circle\" style=\"color: #dd3333\"><\/i> Punch",
|
"primary": "<i class=\"fas fa-circle\" style=\"color: #dd3333\"><\/i> Punch",
|
||||||
|
"secondary": "<i class=\"fas fa-circle\" style=\"color: #81d742\"><\/i> Atlantis",
|
||||||
|
"tertiary": "<i class=\"fas fa-circle\" style=\"color: #8224e3\"><\/i> Purple Heart",
|
||||||
"white": "<i class=\"fas fa-circle\" style=\"color: #FFFFFF\"><\/i> White",
|
"white": "<i class=\"fas fa-circle\" style=\"color: #FFFFFF\"><\/i> White",
|
||||||
|
"grey": "<i class=\"fas fa-circle\" style=\"color: #808080\"><\/i> Gray",
|
||||||
"black": "<i class=\"fas fa-circle\" style=\"color: #000000\"><\/i> Black"
|
"black": "<i class=\"fas fa-circle\" style=\"color: #000000\"><\/i> Black"
|
||||||
},
|
},
|
||||||
"default_value": 0,
|
"default_value": 0,
|
||||||
@@ -91,10 +94,10 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "field_67350f526abf1",
|
"key": "field_67350f526abf1",
|
||||||
"label": "Text Contrast",
|
"label": "",
|
||||||
"name": "contrast",
|
"name": "contrast",
|
||||||
"aria-label": "",
|
"aria-label": "",
|
||||||
"type": "select",
|
"type": "true_false",
|
||||||
"instructions": "",
|
"instructions": "",
|
||||||
"required": 0,
|
"required": 0,
|
||||||
"conditional_logic": 0,
|
"conditional_logic": 0,
|
||||||
@@ -103,20 +106,12 @@
|
|||||||
"class": "",
|
"class": "",
|
||||||
"id": ""
|
"id": ""
|
||||||
},
|
},
|
||||||
"choices": {
|
"message": "Text Contrast",
|
||||||
"0": "Auto",
|
|
||||||
"dark": "Force dark text",
|
|
||||||
"light": "Force light text"
|
|
||||||
},
|
|
||||||
"default_value": 0,
|
"default_value": 0,
|
||||||
"return_format": "value",
|
"allow_in_bindings": 0,
|
||||||
"multiple": 0,
|
"ui_on_text": "Light",
|
||||||
"allow_null": 0,
|
"ui_off_text": "Dark",
|
||||||
"ui": 0,
|
"ui": 1
|
||||||
"ajax": 0,
|
|
||||||
"placeholder": "",
|
|
||||||
"create_options": 0,
|
|
||||||
"save_options": 0
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"location": [
|
"location": [
|
||||||
@@ -137,5 +132,6 @@
|
|||||||
"active": true,
|
"active": true,
|
||||||
"description": "",
|
"description": "",
|
||||||
"show_in_rest": 0,
|
"show_in_rest": 0,
|
||||||
"modified": 1765746167
|
"display_title": "",
|
||||||
|
"modified": 1767548180
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,56 +36,6 @@
|
|||||||
},
|
},
|
||||||
"layout": "block",
|
"layout": "block",
|
||||||
"sub_fields": [
|
"sub_fields": [
|
||||||
{
|
|
||||||
"key": "field_67350eb62cdf9",
|
|
||||||
"label": "Top Padding",
|
|
||||||
"name": "padding_top",
|
|
||||||
"aria-label": "",
|
|
||||||
"type": "radio",
|
|
||||||
"instructions": "",
|
|
||||||
"required": 0,
|
|
||||||
"conditional_logic": 0,
|
|
||||||
"wrapper": {
|
|
||||||
"width": "50",
|
|
||||||
"class": "",
|
|
||||||
"id": ""
|
|
||||||
},
|
|
||||||
"choices": [
|
|
||||||
"On",
|
|
||||||
"Off"
|
|
||||||
],
|
|
||||||
"default_value": "",
|
|
||||||
"return_format": "value",
|
|
||||||
"allow_null": 0,
|
|
||||||
"other_choice": 0,
|
|
||||||
"layout": "horizontal",
|
|
||||||
"save_other_choice": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "field_673510c1dc830",
|
|
||||||
"label": "Bottom Padding",
|
|
||||||
"name": "padding_bottom",
|
|
||||||
"aria-label": "",
|
|
||||||
"type": "radio",
|
|
||||||
"instructions": "",
|
|
||||||
"required": 0,
|
|
||||||
"conditional_logic": 0,
|
|
||||||
"wrapper": {
|
|
||||||
"width": "50",
|
|
||||||
"class": "",
|
|
||||||
"id": ""
|
|
||||||
},
|
|
||||||
"choices": [
|
|
||||||
"On",
|
|
||||||
"Off"
|
|
||||||
],
|
|
||||||
"default_value": "",
|
|
||||||
"return_format": "value",
|
|
||||||
"allow_null": 0,
|
|
||||||
"other_choice": 0,
|
|
||||||
"layout": "horizontal",
|
|
||||||
"save_other_choice": 0
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"key": "field_6800097e61765",
|
"key": "field_6800097e61765",
|
||||||
"label": "Container Width",
|
"label": "Container Width",
|
||||||
@@ -119,6 +69,66 @@
|
|||||||
"create_options": 0,
|
"create_options": 0,
|
||||||
"save_options": 0
|
"save_options": 0
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"key": "field_67350eb62cdf9",
|
||||||
|
"label": "",
|
||||||
|
"name": "padding_top",
|
||||||
|
"aria-label": "",
|
||||||
|
"type": "true_false",
|
||||||
|
"instructions": "",
|
||||||
|
"required": 0,
|
||||||
|
"conditional_logic": 0,
|
||||||
|
"wrapper": {
|
||||||
|
"width": "",
|
||||||
|
"class": "",
|
||||||
|
"id": ""
|
||||||
|
},
|
||||||
|
"message": "Top Padding",
|
||||||
|
"default_value": 1,
|
||||||
|
"allow_in_bindings": 0,
|
||||||
|
"ui_on_text": "On",
|
||||||
|
"ui_off_text": "Off",
|
||||||
|
"ui": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "field_673510c1dc830",
|
||||||
|
"label": "",
|
||||||
|
"name": "padding_bottom",
|
||||||
|
"aria-label": "",
|
||||||
|
"type": "true_false",
|
||||||
|
"instructions": "",
|
||||||
|
"required": 0,
|
||||||
|
"conditional_logic": 0,
|
||||||
|
"wrapper": {
|
||||||
|
"width": "",
|
||||||
|
"class": "",
|
||||||
|
"id": ""
|
||||||
|
},
|
||||||
|
"message": "Bottom Padding",
|
||||||
|
"default_value": 1,
|
||||||
|
"allow_in_bindings": 0,
|
||||||
|
"ui_on_text": "On",
|
||||||
|
"ui_off_text": "Off",
|
||||||
|
"ui": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "field_695aa550e16d4",
|
||||||
|
"label": "Background",
|
||||||
|
"name": "",
|
||||||
|
"aria-label": "",
|
||||||
|
"type": "message",
|
||||||
|
"instructions": "",
|
||||||
|
"required": 0,
|
||||||
|
"conditional_logic": 0,
|
||||||
|
"wrapper": {
|
||||||
|
"width": "",
|
||||||
|
"class": "",
|
||||||
|
"id": ""
|
||||||
|
},
|
||||||
|
"message": "",
|
||||||
|
"new_lines": "wpautop",
|
||||||
|
"esc_html": 0
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"key": "field_67350aeb146ca",
|
"key": "field_67350aeb146ca",
|
||||||
"label": "Background",
|
"label": "Background",
|
||||||
@@ -181,5 +191,5 @@
|
|||||||
"description": "",
|
"description": "",
|
||||||
"show_in_rest": 0,
|
"show_in_rest": 0,
|
||||||
"display_title": "",
|
"display_title": "",
|
||||||
"modified": 1765815052
|
"modified": 1767548583
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user