resource(); $formatter = $wpw->formatter(); $storage = $wpw->storage(); unset($wpw); $primary_text_color = '#555'; $divider_color = 'rgba(0,0,0,.3)'; $accent_color = '#ffab00'; $class_name = !empty($config['class_name']) ? '.' . $config['class_name'] : '.project-input_textarea-primary'; $default_paddings = [ 'top' => [ 'number' => 10, ], 'bottom' => [ 'number' => 10, ], 'right' => [ 'number' => 10, ], 'left' => [ 'number' => 10, ], ]; $default_border = [ 'top' => [ 'number' => 1, ], 'bottom' => [ 'number' => 1, ], 'right' => [ 'number' => 1, ], 'left' => [ 'number' => 1, ], ]; // secondary color $secondary_color = 'rgba(0,0,0,0.6)'; // disabled color $disabled_color = 'rgba(0,0,0,.3)'; $icon_font = Wpw::inst()->storage()->get('default_icon_font'); /** * Form defaults */ // indents $form_default_padding = $default_paddings; $form_default_margins = []; // border $form_default_border_style = 'solid'; $form_default_border_model = $default_border; $form_default_border_radius = []; $form_default_border_style_hover = 'solid'; $form_default_border_model_hover = $default_border; $form_default_border_radius_hover = []; $form_default_border_style_focus = 'solid'; $form_default_border_model_focus = $default_border; $form_default_border_radius_focus = []; // colors $form_default_border_color = $divider_color; $form_default_control_color = $accent_color; $form_default_border_color_hover = $divider_color; $form_default_control_color_hover = $accent_color; $form_default_border_color_focus = $divider_color; $form_default_control_color_focus = $accent_color; // background // shadow $form_default_bs_hl = ''; $form_default_bs_vl = ''; $form_default_bs_br = ''; $form_default_bs_sr = ''; $form_default_bs_color = ''; $form_default_bs_hl_hover = ''; $form_default_bs_vl_hover = ''; $form_default_bs_br_hover = ''; $form_default_bs_sr_hover = ''; $form_default_bs_color_hover = ''; $form_default_bs_hl_focus = ''; $form_default_bs_vl_focus = ''; $form_default_bs_br_focus = ''; $form_default_bs_sr_focus = ''; $form_default_bs_color_focus = ''; $textarea_padding = !empty($config['textarea_padding']) ? $config['textarea_padding'] : $form_default_padding; $textarea_padding = $formatter->css_spacing($textarea_padding); $textarea_margin = !empty($config['textarea_margin']) ? $config['textarea_margin'] : $form_default_margins; $textarea_margin = $formatter->css_spacing($textarea_margin); $textarea_use_icon_glyph = !empty($config['textarea_use_icon_glyph']) ? $config['textarea_use_icon_glyph'] : 'on'; $textarea_glyph = $textarea_hover_glyph = $textarea_focus_glyph = ''; $textarea_typography = !empty($config['textarea_typography']) ? $config['textarea_typography'] : 'main'; $_textarea_typography = $formatter->dynamic_typography($textarea_typography, $class_name.'.project-input.project-input_textarea ::placeholder'); $_webkit_textarea_typography = $formatter->dynamic_typography($textarea_typography, $class_name.'.project-input.project-input_textarea ::-webkit-textarea-placeholder'); $_ms_textarea_typography = $formatter->dynamic_typography($textarea_typography, $class_name.'.project-input.project-input_textarea ::-ms-textarea-placeholder'); $_ms2_textarea_typography = $formatter->dynamic_typography($textarea_typography, $class_name.'.project-input.project-input_textarea :-ms-textarea-placeholder'); $textarea_typography = $formatter->dynamic_typography($textarea_typography, $class_name.'.project-input.project-input_textarea, '.$class_name.'.project-input.project-input_textarea textarea'); // default =========================================== // border $textarea_border_style = !empty($config['textarea_border_style']) ? $config['textarea_border_style'] : $form_default_border_style; $textarea_border_model = !empty($config['textarea_border_model']) ? $config['textarea_border_model'] : $form_default_border_model; $border_model_alter = $formatter->from_spacing($textarea_border_model); $textarea_border_model = $formatter->css_spacing($textarea_border_model); $textarea_border_radius = !empty($config['textarea_border_radius']) ? $config['textarea_border_radius'] : $form_default_border_radius; $textarea_border_radius = $formatter->css_spacing($textarea_border_radius); // color $textarea_use_default_color = !empty($config['textarea_use_default_color']) ? $config['textarea_use_default_color'] : 'on'; $textarea_border_color = !empty($config['textarea_border_color']) ? $config['textarea_border_color'] : ''; $textarea_border_color = Wpw::inst()->storage()->get($textarea_border_color); $textarea_placeholder_color = !empty($config['textarea_placeholder_color']) ? $config['textarea_placeholder_color'] : ''; $textarea_placeholder_color = $storage->get($textarea_placeholder_color); $textarea_text_color = !empty($config['textarea_text_color']) ? $config['textarea_text_color'] : ''; $textarea_text_color = $storage->get($textarea_text_color); // bg $textarea_bg = !empty($config['textarea_bg']) ? $config['textarea_bg'] : ''; $textarea_bg = $formatter->from_bg($textarea_bg); // shadow $textarea_bs_hl = !empty($config['textarea_bs_hl']) ? $config['textarea_bs_hl'] : $form_default_bs_hl; $textarea_bs_hl = $formatter->css_scalar($textarea_bs_hl); $textarea_bs_vl = !empty($config['textarea_bs_vl']) ? $config['textarea_bs_vl'] : $form_default_bs_vl; $textarea_bs_vl = $formatter->css_scalar($textarea_bs_vl); $textarea_bs_br = !empty($config['textarea_bs_br']) ? $config['textarea_bs_br'] : $form_default_bs_br; $textarea_bs_br = $formatter->css_scalar($textarea_bs_br); $textarea_bs_sr = !empty($config['textarea_bs_sr']) ? $config['textarea_bs_sr'] : $form_default_bs_sr; $textarea_bs_sr = $formatter->css_scalar($textarea_bs_sr); $textarea_bs_color = !empty($config['textarea_bs_color']) ? $config['textarea_bs_color'] : ''; $textarea_bs_color = Wpw::inst()->storage()->get($textarea_bs_color); $textarea_bs = " box-shadow: {$textarea_bs_hl} {$textarea_bs_vl} {$textarea_bs_br} {$textarea_bs_sr} {$textarea_bs_color}; "; // hover =========================================== // border $textarea_hover_border_style = !empty($config['textarea_hover_border_style']) ? $config['textarea_hover_border_style'] : $form_default_border_style_hover; $textarea_hover_border_model = !empty($config['textarea_hover_border_model']) ? $config['textarea_hover_border_model'] : $form_default_border_model_hover; $border_model_hover_alter = $formatter->from_spacing($textarea_hover_border_model); $textarea_hover_border_model = $formatter->css_spacing($textarea_hover_border_model); $textarea_hover_border_radius = !empty($config['textarea_hover_border_radius']) ? $config['textarea_hover_border_radius'] : $form_default_border_radius_hover; $textarea_hover_border_radius = $formatter->css_spacing($textarea_hover_border_radius); // color $textarea_hover_use_default_color = !empty($config['textarea_hover_use_default_color']) ? $config['textarea_hover_use_default_color'] : 'on'; $textarea_hover_border_color = !empty($config['textarea_hover_border_color']) ? $config['textarea_hover_border_color'] : ''; $textarea_hover_border_color = Wpw::inst()->storage()->get($textarea_hover_border_color); $textarea_hover_placeholder_color = !empty($config['textarea_hover_placeholder_color']) ? $config['textarea_hover_placeholder_color'] : ''; $textarea_hover_placeholder_color = $storage->get($textarea_hover_placeholder_color); $textarea_hover_text_color = !empty($config['textarea_hover_text_color']) ? $config['textarea_hover_text_color'] : ''; $textarea_hover_text_color = $storage->get($textarea_hover_text_color); // bg $textarea_hover_bg = !empty($config['textarea_hover_bg']) ? $config['textarea_hover_bg'] : ''; $textarea_hover_bg = $formatter->from_bg($textarea_hover_bg); // shadow $textarea_hover_bs_hl = !empty($config['textarea_hover_bs_hl']) ? $config['textarea_hover_bs_hl'] : $form_default_bs_hl_hover; $textarea_hover_bs_hl = $formatter->css_scalar($textarea_hover_bs_hl); $textarea_hover_bs_vl = !empty($config['textarea_hover_bs_vl']) ? $config['textarea_hover_bs_vl'] : $form_default_bs_vl_hover; $textarea_hover_bs_vl = $formatter->css_scalar($textarea_hover_bs_vl); $textarea_hover_bs_br = !empty($config['textarea_hover_bs_br']) ? $config['textarea_hover_bs_br'] : $form_default_bs_br_hover; $textarea_hover_bs_br = $formatter->css_scalar($textarea_hover_bs_br); $textarea_hover_bs_sr = !empty($config['textarea_hover_bs_sr']) ? $config['textarea_hover_bs_sr'] : $form_default_bs_sr_hover; $textarea_hover_bs_sr = $formatter->css_scalar($textarea_hover_bs_sr); $textarea_hover_bs_color = !empty($config['textarea_hover_bs_color']) ? $config['textarea_hover_bs_color'] : ''; $textarea_hover_bs_color = Wpw::inst()->storage()->get($textarea_hover_bs_color); $textarea_hover_bs = " box-shadow: {$textarea_hover_bs_hl} {$textarea_hover_bs_vl} {$textarea_hover_bs_br} {$textarea_hover_bs_sr} {$textarea_hover_bs_color}; "; // focus =========================================== // border $textarea_focus_border_style = !empty($config['textarea_focus_border_style']) ? $config['textarea_focus_border_style'] : $form_default_border_style_focus; $textarea_focus_border_model = !empty($config['textarea_focus_border_model']) ? $config['textarea_focus_border_model'] : $form_default_border_model_focus; $border_model_focus_alter = $formatter->from_spacing($textarea_focus_border_model); $textarea_focus_border_model = $formatter->css_spacing($textarea_focus_border_model); $textarea_focus_border_radius = !empty($config['textarea_focus_border_radius']) ? $config['textarea_focus_border_radius'] : $form_default_border_radius_focus; $textarea_focus_border_radius = $formatter->css_spacing($textarea_focus_border_radius); // color $textarea_focus_use_default_color = !empty($config['textarea_focus_use_default_color']) ? $config['textarea_focus_use_default_color'] : 'on'; $textarea_focus_border_color = !empty($config['textarea_focus_border_color']) ? $config['textarea_focus_border_color'] : ''; $textarea_focus_border_color = Wpw::inst()->storage()->get($textarea_focus_border_color); $textarea_focus_placeholder_color = !empty($config['textarea_focus_placeholder_color']) ? $config['textarea_focus_placeholder_color'] : ''; $textarea_focus_placeholder_color = $storage->get($textarea_focus_placeholder_color); $textarea_focus_text_color = !empty($config['textarea_focus_text_color']) ? $config['textarea_focus_text_color'] : ''; $textarea_focus_text_color = $storage->get($textarea_focus_text_color); // bg $textarea_focus_bg = !empty($config['textarea_focus_bg']) ? $config['textarea_focus_bg'] : ''; $textarea_focus_bg = $formatter->from_bg($textarea_focus_bg); // shadow $textarea_focus_bs_hl = !empty($config['textarea_focus_bs_hl']) ? $config['textarea_focus_bs_hl'] : $form_default_bs_hl_focus; $textarea_focus_bs_hl = $formatter->css_scalar($textarea_focus_bs_hl); $textarea_focus_bs_vl = !empty($config['textarea_focus_bs_vl']) ? $config['textarea_focus_bs_vl'] : $form_default_bs_vl_focus; $textarea_focus_bs_vl = $formatter->css_scalar($textarea_focus_bs_vl); $textarea_focus_bs_br = !empty($config['textarea_focus_bs_br']) ? $config['textarea_focus_bs_br'] : $form_default_bs_br_focus; $textarea_focus_bs_br = $formatter->css_scalar($textarea_focus_bs_br); $textarea_focus_bs_sr = !empty($config['textarea_focus_bs_sr']) ? $config['textarea_focus_bs_sr'] : $form_default_bs_sr_focus; $textarea_focus_bs_sr = $formatter->css_scalar($textarea_focus_bs_sr); $textarea_focus_bs_color = !empty($config['textarea_focus_bs_color']) ? $config['textarea_focus_bs_color'] : ''; $textarea_focus_bs_color = Wpw::inst()->storage()->get($textarea_focus_bs_color); $textarea_focus_bs = " box-shadow: {$textarea_focus_bs_hl} {$textarea_focus_bs_vl} {$textarea_focus_bs_br} {$textarea_focus_bs_sr} {$textarea_focus_bs_color}; "; echo /** @lang CSS */ ' body '.$class_name.'.project-input.project-input_textarea, '.$class_name.'.project-input.project-input_textarea { color: '.$textarea_text_color.'; padding: ' . $textarea_padding . '; margin: ' . $textarea_margin . '; } '.$class_name.'.project-input.project-input_textarea .background { border-style: ' . $textarea_border_style . '; border-width: ' . $textarea_border_model . '; border-color: ' . $textarea_border_color . '; border-radius: ' . $textarea_border_radius . '; ' . $textarea_bs . ' } '.$textarea_typography.' '.$_textarea_typography.' '.$_webkit_textarea_typography.' '.$_ms_textarea_typography.' '.$_ms2_textarea_typography.' '.$class_name.'.project-input.project-input_textarea ::-webkit-textarea-placeholder { color: '.$textarea_placeholder_color.'; } '.$class_name.'.project-input.project-input_textarea :-ms-textarea-placeholder { color: '.$textarea_placeholder_color.'; } '.$class_name.'.project-input.project-input_textarea ::-ms-textarea-placeholder { color: '.$textarea_placeholder_color.'; } '.$class_name.'.project-input.project-input_textarea ::placeholder { color: '.$textarea_placeholder_color.'; } body '.$class_name.' .project-input.project-input_textarea .background > .color-layer, '.$class_name.'.project-input.project-input_textarea .background > .color-layer { ' . $textarea_bg['fill'] . ' } body '.$class_name.' .project-input.project-input_textarea .background > .image-layer, '.$class_name.'.project-input.project-input_textarea .background > .image-layer { background-image: url("' . $textarea_bg['image'] . '"); } body '.$class_name.'.project-input.project-input_textarea:hover, '.$class_name.'.project-input.project-input_textarea:hover { color: '.$textarea_hover_text_color.'; padding: ' . $textarea_padding . '; margin: ' . $textarea_margin . '; } '.$class_name.'.project-input.project-input_textarea:hover .background { border-style: ' . $textarea_hover_border_style . '; border-width: ' . $textarea_hover_border_model . '; border-color: ' . $textarea_hover_border_color . '; border-radius: ' . $textarea_hover_border_radius . '; ' . $textarea_hover_bs . ' } '.$class_name.'.project-input.project-input_textarea:hover ::-webkit-textarea-placeholder { color: '.$textarea_hover_placeholder_color.'; } '.$class_name.'.project-input.project-input_textarea:hover :-ms-textarea-placeholder { color: '.$textarea_hover_placeholder_color.'; } '.$class_name.'.project-input.project-input_textarea:hover ::-ms-textarea-placeholder { color: '.$textarea_hover_placeholder_color.'; } '.$class_name.'.project-input.project-input_textarea:hover ::placeholder { color: '.$textarea_hover_placeholder_color.'; } body '.$class_name.' .project-input.project-input_textarea:hover .background > .color-layer, '.$class_name.'.project-input.project-input_textarea:hover .background > .color-layer { ' . $textarea_hover_bg['fill'] . ' } body '.$class_name.' .project-input.project-input_textarea:hover .background > .image-layer, '.$class_name.'.project-input.project-input_textarea:hover .background > .image-layer { background-image: url("' . $textarea_hover_bg['image'] . '"); } body '.$class_name.' .project-input.project-input_textarea.project-input_focused, '.$class_name.'.project-input.project-input_textarea.project-input_focused { color: '.$textarea_focus_text_color.'; padding: ' . $textarea_padding . '; margin: ' . $textarea_margin . '; } '.$class_name.'.project-input.project-input_textarea.project-input_focused .background { border-style: ' . $textarea_focus_border_style . '; border-width: ' . $textarea_focus_border_model . '; border-color: ' . $textarea_focus_border_color . '; border-radius: ' . $textarea_focus_border_radius . '; ' . $textarea_focus_bs . ' } '.$class_name.'.project-input.project-input_textarea.project-input_focused ::-webkit-textarea-placeholder { color: '.$textarea_focus_placeholder_color.'; } '.$class_name.'.project-input.project-input_textarea.project-input_focused :-ms-textarea-placeholder { color: '.$textarea_focus_placeholder_color.'; } '.$class_name.'.project-input.project-input_textarea.project-input_focused ::-ms-textarea-placeholder { color: '.$textarea_focus_placeholder_color.'; } '.$class_name.'.project-input.project-input_textarea.project-input_focused ::placeholder { color: '.$textarea_focus_placeholder_color.'; } body '.$class_name.' .project-input.project-input_textarea.project-input_focused .background > .color-layer, '.$class_name.'.project-input.project-input_textarea.project-input_focused .background > .color-layer { ' . $textarea_focus_bg['fill'] . ' } body '.$class_name.' .project-input.project-input_textarea.project-input_focused .background > .image-layer, '.$class_name.'.project-input.project-input_textarea.project-input_focused .background > .image-layer { background-image: url("' . $textarea_focus_bg['image'] . '"); } ';