PluginProbe
The Innovative Form Builder – IvyForms / 1.5.1
The Innovative Form Builder – IvyForms v1.5.1
1.5.1 1.5 1.4.1 1.4 trunk 0.1.2 0.2 0.2.1 0.3 0.3.1 0.4 0.5 0.6 0.6.1 0.6.1-backup 0.6.1.1 0.7 0.8 0.8.1 0.8.2 0.9 0.9.1 1.0 1.1 1.1.1 All 27 releases
ivyforms / backend / src / Services / Form / Style / FieldStyleGenerator.php

FieldStyleGenerator.php in The Innovative Form Builder – IvyForms 1.5.1, at backend/src/Services/Form/Style/FieldStyleGenerator.php

51 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * @copyright © Melograno Venture Studio. All rights reserved.
5 * @licence See LICENCE.md for license details.
6 */
7
8 namespace IvyForms\Services\Form\Style;
9
10 // phpcs:disable PSR1.Files.SideEffects
11
12 if (!defined('ABSPATH')) {
13 exit; // Exit if accessed directly
14 }
15
16 /**
17 * Class FieldStyleGenerator
18 *
19 * Generates CSS for form fields
20 *
21 * @package IvyForms\Services\Form\StyleHelpers
22 */
23 class FieldStyleGenerator implements StyleGeneratorInterface
24 {
25 /**
26 * Generate field styles
27 *
28 * @param CssBuilder $css
29 * @param StyleContext $context
30 * @return void
31 */
32 public function generate(CssBuilder $css, StyleContext $context): void
33 {
34 $baseStylesApplier = new FieldBaseStylesApplier();
35 $stateStylesApplier = new FieldStateStylesApplier();
36
37 $baseStylesApplier->apply(
38 $css,
39 $context->getBaseSelector(),
40 $context->getActiveColors(),
41 $context->getActiveStyles()
42 );
43
44 $stateStylesApplier->apply(
45 $css,
46 $context->getBaseSelector(),
47 $context->getStyleSettings()
48 );
49 }
50 }
51