| @@ -5,11 +5,10 @@ | ||
| 5 | 5 | |
| 6 | 6 | if ( ! isset( $saving ) ) { |
| 7 | 7 | header( 'Content-type: text/css' ); |
| 8 | 8 | |
| 9 | - if ( ! empty( $css ) ) { | |
| 10 | - echo strip_tags( $css, 'all' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 11 | - FrmStylesController::maybe_hide_sample_form_error_message(); | |
| 9 | + if ( isset( $css ) && $css ) { | |
| 10 | + echo strip_tags( $css, 'all' ); // WPCS: XSS ok. | |
| 12 | 11 | die(); |
| 13 | 12 | } |
| 14 | 13 | } |
| 15 | 14 | |
| @@ -16,12 +15,12 @@ | ||
| 16 | 15 | if ( ! isset( $frm_style ) ) { |
| 17 | 16 | $frm_style = new FrmStyle(); |
| 18 | 17 | } |
| 19 | 18 | |
| 20 | -$styles = $frm_style->get_all(); | |
| 19 | +$styles = $frm_style->get_all(); | |
| 21 | 20 | $default_style = $frm_style->get_default_style( $styles ); |
| 22 | -$defaults = FrmStylesHelper::get_settings_for_output( $default_style ); | |
| 23 | -$important = empty( $defaults['important_style'] ) ? '' : ' !important'; | |
| 21 | +$defaults = FrmStylesHelper::get_settings_for_output( $default_style ); | |
| 22 | +$important = empty( $defaults['important_style'] ) ? '' : ' !important'; | |
| 24 | 23 | |
| 25 | 24 | ?> |
| 26 | 25 | .with_frm_style{ |
| 27 | 26 | <?php FrmStylesHelper::output_vars( $defaults ); ?> |
| @@ -75,9 +74,8 @@ | ||
| 75 | 74 | } |
| 76 | 75 | |
| 77 | 76 | .with_frm_style fieldset{ |
| 78 | 77 | min-width:0; |
| 79 | - display: block; /* Override 2021 theme */ | |
| 80 | 78 | } |
| 81 | 79 | |
| 82 | 80 | .with_frm_style fieldset fieldset{ |
| 83 | 81 | border:none; |
| @@ -86,9 +84,9 @@ | ||
| 86 | 84 | background-color:transparent; |
| 87 | 85 | } |
| 88 | 86 | |
| 89 | 87 | .with_frm_style .frm_form_fields > fieldset{ |
| 90 | -<?php if ( isset( $defaults['fieldset'] ) && ( $defaults['fieldset'] || '0' === $defaults['fieldset'] ) ) { ?> | |
| 88 | +<?php if ( ! empty( $defaults['fieldset'] ) ) { ?> | |
| 91 | 89 | border-width:<?php echo esc_html( $defaults['fieldset'] . $important ); ?>; |
| 92 | 90 | border-width:var(--fieldset)<?php echo esc_html( $important ); ?>; |
| 93 | 91 | <?php } ?> |
| 94 | 92 | border-style:solid; |
| @@ -136,9 +134,9 @@ | ||
| 136 | 134 | color:<?php echo esc_html( $defaults['title_color'] . $important ); ?>; |
| 137 | 135 | color:var(--title-color)<?php echo esc_html( $important ); ?>; |
| 138 | 136 | <?php } ?> |
| 139 | 137 | <?php if ( ! empty( $defaults['font'] ) ) { ?> |
| 140 | - font-family:<?php echo FrmAppHelper::kses( $defaults['font'] ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>; | |
| 138 | + font-family:<?php echo FrmAppHelper::kses( $defaults['font'] ); // WPCS: XSS ok. ?>; | |
| 141 | 139 | font-family:var(--font); |
| 142 | 140 | <?php } ?> |
| 143 | 141 | <?php if ( ! empty( $defaults['title_margin_top'] ) ) { ?> |
| 144 | 142 | margin-top:<?php echo esc_html( $defaults['title_margin_top'] . $important ); ?>; |
| @@ -152,9 +150,9 @@ | ||
| 152 | 150 | |
| 153 | 151 | .with_frm_style .frm_form_field.frm_html_container, |
| 154 | 152 | .with_frm_style .frm_form_field .frm_show_it{ |
| 155 | 153 | <?php if ( ! empty( $defaults['font'] ) ) { ?> |
| 156 | - font-family:<?php echo FrmAppHelper::kses( $defaults['font'] ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>; | |
| 154 | + font-family:<?php echo FrmAppHelper::kses( $defaults['font'] ); // WPCS: XSS ok. ?>; | |
| 157 | 155 | font-family:var(--font); |
| 158 | 156 | <?php } ?> |
| 159 | 157 | <?php if ( ! empty( $defaults['form_desc_color'] ) ) { ?> |
| 160 | 158 | color:<?php echo esc_html( $defaults['form_desc_color'] . $important ); ?>; |
| @@ -269,16 +267,10 @@ | ||
| 269 | 267 | .with_frm_style input[type=checkbox]{ |
| 270 | 268 | border-color:<?php echo esc_html( $defaults['border_color'] . $important ); ?>; |
| 271 | 269 | border-color:var(--border-color)<?php echo esc_html( $important ); ?>; |
| 272 | 270 | box-shadow:var(--box-shadow)<?php echo esc_html( $important ); ?>; |
| 273 | - float: none; | |
| 274 | 271 | } |
| 275 | 272 | |
| 276 | -.with_frm_style input[type=radio]:after, | |
| 277 | -.with_frm_style input[type=checkbox]:after { | |
| 278 | - display: none; /* 2021 conflict */ | |
| 279 | -} | |
| 280 | - | |
| 281 | 273 | .with_frm_style input[type=text], |
| 282 | 274 | .with_frm_style input[type=password], |
| 283 | 275 | .with_frm_style input[type=email], |
| 284 | 276 | .with_frm_style input[type=number], |
| @@ -328,9 +320,8 @@ | ||
| 328 | 320 | } |
| 329 | 321 | |
| 330 | 322 | .with_frm_style .wp-editor-container textarea{ |
| 331 | 323 | border:none<?php echo esc_html( $important ); ?>; |
| 332 | - box-shadow:none !important; | |
| 333 | 324 | } |
| 334 | 325 | |
| 335 | 326 | .with_frm_style .mceIframeContainer{ |
| 336 | 327 | background-color:<?php echo esc_html( $defaults['bg_color'] . $important ); ?>; |
| @@ -340,9 +331,8 @@ | ||
| 340 | 331 | .with_frm_style select{ |
| 341 | 332 | width:<?php echo esc_html( $defaults['auto_width'] ); ?>; |
| 342 | 333 | width:var(--auto-width)<?php echo esc_html( $important ); ?>; |
| 343 | 334 | max-width:100%; |
| 344 | - background-position-y: center; | |
| 345 | 335 | } |
| 346 | 336 | |
| 347 | 337 | .with_frm_style input[disabled], |
| 348 | 338 | .with_frm_style select[disabled], |
| @@ -368,9 +358,9 @@ | ||
| 368 | 358 | |
| 369 | 359 | .with_frm_style .frm_primary_label{ |
| 370 | 360 | max-width:100%; |
| 371 | 361 | <?php if ( ! empty( $defaults['font'] ) ) { ?> |
| 372 | - font-family:<?php echo FrmAppHelper::kses( $defaults['font'] ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>; | |
| 362 | + font-family:<?php echo FrmAppHelper::kses( $defaults['font'] ); // WPCS: XSS ok. ?>; | |
| 373 | 363 | font-family:var(--font); |
| 374 | 364 | <?php } ?> |
| 375 | 365 | <?php if ( ! empty( $defaults['font_size'] ) ) { ?> |
| 376 | 366 | font-size:<?php echo esc_html( $defaults['font_size'] . $important ); ?>; |
| @@ -437,104 +427,19 @@ | ||
| 437 | 427 | visibility:hidden; |
| 438 | 428 | white-space:nowrap; |
| 439 | 429 | } |
| 440 | 430 | |
| 431 | +.with_frm_style .frm_inside_container .frm_primary_label{ | |
| 432 | + opacity:0; | |
| 433 | + transition: opacity 0.1s linear; | |
| 434 | +} | |
| 435 | + | |
| 436 | +.with_frm_style .frm_inside_container label.frm_visible, | |
| 441 | 437 | .frm_visible{ |
| 442 | 438 | opacity:1; |
| 443 | 439 | } |
| 444 | 440 | |
| 445 | -/* Floating labels */ | |
| 446 | -.with_frm_style .frm_inside_container { | |
| 447 | - position: relative; | |
| 448 | - padding-top: 16px; | |
| 449 | - padding-top: calc(0.5 * var(--field-height)); | |
| 450 | -} | |
| 451 | - | |
| 452 | -.with_frm_style .frm_inside_container > input, | |
| 453 | -.with_frm_style .frm_inside_container > select, | |
| 454 | -.with_frm_style .frm_inside_container > textarea { | |
| 455 | - display: block; | |
| 456 | -} | |
| 457 | - | |
| 458 | -/* These do not work if they are combined */ | |
| 459 | -.with_frm_style .frm_inside_container > input::-moz-placeholder, | |
| 460 | -.with_frm_style .frm_inside_container > textarea::-moz-placeholder { | |
| 461 | - opacity: 0 !important; | |
| 462 | - transition: opacity 0.3s ease-in; | |
| 463 | -} | |
| 464 | - | |
| 465 | -.with_frm_style .frm_inside_container > input:-ms-input-placeholder, | |
| 466 | -.with_frm_style .frm_inside_container > textarea:-ms-input-placeholder { | |
| 467 | - opacity: 0; | |
| 468 | - transition: opacity 0.3s ease-in; | |
| 469 | -} | |
| 470 | - | |
| 471 | -.with_frm_style .frm_inside_container > input::placeholder, | |
| 472 | -.with_frm_style .frm_inside_container > textarea::placeholder { | |
| 473 | - opacity: 0; | |
| 474 | - transition: opacity 0.3s ease-in; | |
| 475 | -} | |
| 476 | - | |
| 477 | -.with_frm_style .frm_inside_container > label { | |
| 478 | - transition: all 0.3s ease-in; | |
| 479 | - | |
| 480 | - position: absolute; | |
| 481 | - top: 17px; | |
| 482 | - top: calc(1px + .5 * var(--field-height)); | |
| 483 | - left: 3px; | |
| 484 | - width: 100%; | |
| 485 | - | |
| 486 | - line-height: 1.3; | |
| 487 | - text-overflow: ellipsis; | |
| 488 | - overflow: hidden; | |
| 489 | - white-space: nowrap; | |
| 490 | - | |
| 491 | - padding: 6px 10px; | |
| 492 | - padding: var(--field-pad); | |
| 493 | - | |
| 494 | - font-size: 14px; | |
| 495 | - font-size: var(--field-font-size); | |
| 496 | - font-weight: normal; | |
| 497 | - font-weight: var(--field-weight); | |
| 498 | - | |
| 499 | - -ms-pointer-events: none; | |
| 500 | - pointer-events: none; | |
| 501 | -} | |
| 502 | - | |
| 503 | -.with_frm_style.frm_style_lines-no-boxes .frm_inside_container > label { | |
| 504 | - line-height: 1; | |
| 505 | -} | |
| 506 | - | |
| 507 | -.with_frm_style .frm_inside_container.frm_label_float_top > label { | |
| 508 | - top: 0; | |
| 509 | - left: 0; | |
| 510 | - padding: 0; | |
| 511 | - font-size: 12px; | |
| 512 | - font-size: calc(0.85 * var(--field-font-size)); | |
| 513 | -} | |
| 514 | - | |
| 515 | -/* These do not work if they are combined */ | |
| 516 | -.with_frm_style .frm_inside_container.frm_label_float_top > input::-moz-placeholder, | |
| 517 | -.with_frm_style .frm_inside_container.frm_label_float_top > textarea::-moz-placeholder { | |
| 518 | - opacity: 1 !important; | |
| 519 | - transition: opacity 0.3s ease-in; | |
| 520 | -} | |
| 521 | - | |
| 522 | -.with_frm_style .frm_inside_container.frm_label_float_top > input:-ms-input-placeholder, | |
| 523 | -.with_frm_style .frm_inside_container.frm_label_float_top > textarea:-ms-input-placeholder { | |
| 524 | - opacity: 1; | |
| 525 | - transition: opacity 0.3s ease-in; | |
| 526 | -} | |
| 527 | - | |
| 528 | -.with_frm_style .frm_inside_container.frm_label_float_top > input::placeholder, | |
| 529 | -.with_frm_style .frm_inside_container.frm_label_float_top > textarea::placeholder { | |
| 530 | - opacity: 1; | |
| 531 | - transition: opacity 0.3s ease-in; | |
| 532 | -} | |
| 533 | -/* End floating label */ | |
| 534 | - | |
| 535 | -.with_frm_style .frm_description, | |
| 536 | -.with_frm_style .frm_pro_max_limit_desc{ | |
| 441 | +.with_frm_style .frm_description{ | |
| 537 | 442 | clear:both; |
| 538 | 443 | } |
| 539 | 444 | |
| 540 | 445 | .with_frm_style input[type=number][readonly]{ |
| @@ -597,9 +502,9 @@ | ||
| 597 | 502 | font-size:<?php echo esc_html( $defaults['submit_font_size'] . $important ); ?>; |
| 598 | 503 | font-size:var(--submit-font-size)<?php echo esc_html( $important ); ?>; |
| 599 | 504 | <?php } ?> |
| 600 | 505 | <?php if ( ! empty( $defaults['font'] ) ) { ?> |
| 601 | - font-family:<?php echo FrmAppHelper::kses( $defaults['font'] . $important ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>; | |
| 506 | + font-family:<?php echo FrmAppHelper::kses( $defaults['font'] . $important ); // WPCS: XSS ok. ?>; | |
| 602 | 507 | font-family:var(--font)<?php echo esc_html( $important ); ?>; |
| 603 | 508 | <?php } ?> |
| 604 | 509 | <?php if ( ! empty( $defaults['submit_weight'] ) ) { ?> |
| 605 | 510 | font-weight:<?php echo esc_html( $defaults['submit_weight'] . $important ); ?>; |
| @@ -766,12 +671,11 @@ | ||
| 766 | 671 | a.frm_save_draft{ |
| 767 | 672 | cursor:pointer; |
| 768 | 673 | } |
| 769 | 674 | |
| 770 | -.with_frm_style a.frm_save_draft, | |
| 771 | -.with_frm_style a.frm_start_over{ | |
| 675 | +.with_frm_style a.frm_save_draft{ | |
| 772 | 676 | <?php if ( ! empty( $defaults['font'] ) ) { ?> |
| 773 | - font-family:<?php echo FrmAppHelper::kses( $defaults['font'] ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>; | |
| 677 | + font-family:<?php echo FrmAppHelper::kses( $defaults['font'] ); // WPCS: XSS ok. ?>; | |
| 774 | 678 | font-family:var(--font); |
| 775 | 679 | <?php } ?> |
| 776 | 680 | font-size:<?php echo esc_html( $defaults['submit_font_size'] ); ?>; |
| 777 | 681 | font-size:var(--submit-font-size); |
| @@ -838,9 +742,9 @@ | ||
| 838 | 742 | |
| 839 | 743 | .with_frm_style .frm_radio label, |
| 840 | 744 | .with_frm_style .frm_checkbox label{ |
| 841 | 745 | <?php if ( ! empty( $defaults['font'] ) ) { ?> |
| 842 | - font-family:<?php echo FrmAppHelper::kses( $defaults['font'] ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>; | |
| 746 | + font-family:<?php echo FrmAppHelper::kses( $defaults['font'] ); // WPCS: XSS ok. ?>; | |
| 843 | 747 | font-family:var(--font); |
| 844 | 748 | <?php } ?> |
| 845 | 749 | font-size:<?php echo esc_html( $defaults['check_font_size'] . $important ); ?>; |
| 846 | 750 | font-size:var(--check-font-size)<?php echo esc_html( $important ); ?>; |
| @@ -847,9 +751,8 @@ | ||
| 847 | 751 | color:<?php echo esc_html( $defaults['check_label_color'] . $important ); ?>; |
| 848 | 752 | color:var(--check-label-color)<?php echo esc_html( $important ); ?>; |
| 849 | 753 | font-weight:<?php echo esc_html( $defaults['check_weight'] . $important ); ?>; |
| 850 | 754 | font-weight:var(--check-weight)<?php echo esc_html( $important ); ?>; |
| 851 | - line-height: 1.3; | |
| 852 | 755 | } |
| 853 | 756 | |
| 854 | 757 | .with_frm_style .frm_radio input[type=radio], |
| 855 | 758 | .with_frm_style .frm_checkbox input[type=checkbox] { |
| @@ -865,68 +768,29 @@ | ||
| 865 | 768 | margin:5px; |
| 866 | 769 | vertical-align:middle; |
| 867 | 770 | } |
| 868 | 771 | |
| 869 | -.with_frm_style .frm_radio input[type=radio] | |
| 870 | -<?php if ( FrmAppHelper::pro_is_installed() ) : ?> | |
| 871 | -, .with_frm_style .frm_scale input[type=radio] | |
| 872 | -<?php endif; ?> | |
| 873 | -{ | |
| 772 | +.with_frm_style .frm_radio input[type=radio]{ | |
| 773 | + -webkit-appearance:radio; | |
| 874 | 774 | border-radius:50%; |
| 875 | 775 | } |
| 876 | 776 | |
| 877 | 777 | .with_frm_style .frm_checkbox input[type=checkbox]{ |
| 778 | + -webkit-appearance:checkbox; | |
| 878 | 779 | border-radius:0; |
| 879 | 780 | } |
| 880 | 781 | |
| 881 | 782 | .with_frm_style .frm_radio input[type=radio], |
| 882 | -<?php if ( FrmAppHelper::pro_is_installed() ) : ?> | |
| 883 | -.with_frm_style .frm_scale input[type=radio], | |
| 884 | -<?php endif; ?> | |
| 885 | 783 | .with_frm_style .frm_checkbox input[type=checkbox]{ |
| 886 | - -webkit-appearance: none; | |
| 887 | - appearance: none; | |
| 888 | - background-color: var(--bg-color); | |
| 889 | 784 | flex: none; |
| 890 | - display:inline-block !important; | |
| 891 | - margin: 0 5px 0 0; | |
| 892 | - color: var(--border-color); | |
| 893 | - width: 18px; | |
| 894 | - min-width: 18px; | |
| 895 | - height: 18px; | |
| 896 | - border: 1px solid currentColor; | |
| 897 | - border-color: var(--border-color); | |
| 898 | - vertical-align: middle; | |
| 785 | + display:inline-block; | |
| 786 | + margin:4px 5px 0 0; | |
| 787 | + width:auto; | |
| 788 | + border:none; | |
| 789 | + vertical-align:baseline; | |
| 899 | 790 | position: initial; /* override Bootstrap */ |
| 900 | - padding: 0; | |
| 901 | 791 | } |
| 902 | 792 | |
| 903 | -.with_frm_style .frm_radio input[type=radio]:before, | |
| 904 | -<?php if ( FrmAppHelper::pro_is_installed() ) : ?> | |
| 905 | -.with_frm_style .frm_scale input[type=radio]:before, | |
| 906 | -<?php endif; ?> | |
| 907 | -.with_frm_style .frm_checkbox input[type=checkbox]:before { | |
| 908 | - content: ''; | |
| 909 | - width: 12px; | |
| 910 | - height: 12px; | |
| 911 | - border-radius: 50%; | |
| 912 | - transform: scale(0); | |
| 913 | - transition: 120ms transform ease-in-out; | |
| 914 | - box-shadow: inset 10px 10px var(--text-color); | |
| 915 | - display: block; | |
| 916 | - margin: 2px 0 0 2px; | |
| 917 | -} | |
| 918 | - | |
| 919 | -.with_frm_style .frm_checkbox input[type=checkbox]:before{ | |
| 920 | - clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%); | |
| 921 | - border-radius: 0; | |
| 922 | -} | |
| 923 | - | |
| 924 | -.with_frm_style .frm_radio input[type=radio]:checked:before, | |
| 925 | -.with_frm_style .frm_checkbox input[type=checkbox]:checked:before { | |
| 926 | - transform: scale(1); | |
| 927 | -} | |
| 928 | - | |
| 929 | 793 | .with_frm_style :invalid, |
| 930 | 794 | .with_frm_style :-moz-submit-invalid, |
| 931 | 795 | .with_frm_style :-moz-ui-invalid{ |
| 932 | 796 | box-shadow:none; |
| @@ -1237,12 +1101,9 @@ | ||
| 1237 | 1101 | } |
| 1238 | 1102 | |
| 1239 | 1103 | .frm_grid .frm_error, |
| 1240 | 1104 | .frm_grid_first .frm_error, |
| 1241 | -.frm_grid_odd .frm_error, | |
| 1242 | -.frm_grid .frm_limit_error, | |
| 1243 | -.frm_grid_first .frm_limit_error, | |
| 1244 | -.frm_grid_odd .frm_limit_error{ | |
| 1105 | +.frm_grid_odd .frm_error{ | |
| 1245 | 1106 | display:none; |
| 1246 | 1107 | } |
| 1247 | 1108 | |
| 1248 | 1109 | .frm_grid:after, |
| @@ -1575,27 +1436,12 @@ | ||
| 1575 | 1436 | color:<?php echo esc_html( $defaults['repeat_icon_color'] . $important ); ?>; |
| 1576 | 1437 | color:var(--repeat-icon-color)<?php echo esc_html( $important ); ?>; |
| 1577 | 1438 | } |
| 1578 | 1439 | |
| 1579 | -.with_frm_style .frm_combo_inputs_container > .frm_form_subfield-first, | |
| 1580 | -.with_frm_style .frm_combo_inputs_container > .frm_form_subfield-middle, | |
| 1581 | -.with_frm_style .frm_combo_inputs_container > .frm_form_subfield-last { | |
| 1582 | - margin-bottom: 0 !important; | |
| 1583 | -} | |
| 1440 | +/* Fonts */ | |
| 1441 | +<?php readfile( FrmAppHelper::plugin_path() . '/css/font_icons.css' ); ?> | |
| 1442 | +<?php do_action( 'frm_include_front_css', compact( 'defaults' ) ); ?> | |
| 1584 | 1443 | |
| 1585 | -<?php | |
| 1586 | -FrmStylesHelper::maybe_include_font_icon_css(); | |
| 1587 | - | |
| 1588 | -/** | |
| 1589 | - * Call action so other plugins can add additional CSS. | |
| 1590 | - * | |
| 1591 | - * @param array $args { | |
| 1592 | - * @type array $defaults | |
| 1593 | - * } | |
| 1594 | - */ | |
| 1595 | -do_action( 'frm_include_front_css', compact( 'defaults' ) ); | |
| 1596 | -?> | |
| 1597 | - | |
| 1598 | 1444 | /* Responsive */ |
| 1599 | 1445 | |
| 1600 | 1446 | @media only screen and (max-width: 900px) { |
| 1601 | 1447 | .frm_form_field .frm_repeat_grid .frm_form_field.frm_sixth .frm_primary_label, |
| @@ -1649,5 +1495,10 @@ | ||
| 1649 | 1495 | } |
| 1650 | 1496 | } |
| 1651 | 1497 | <?php |
| 1652 | 1498 | |
| 1653 | -echo strip_tags( FrmStylesController::get_custom_css() ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 1499 | +$frm_settings = FrmAppHelper::get_settings(); | |
| 1500 | +if ( $frm_settings->old_css ) { | |
| 1501 | + readfile( dirname( __FILE__ ) . '/frm_old_grids.css' ); | |
| 1502 | +} | |
| 1503 | + | |
| 1504 | +echo strip_tags( $defaults['custom_css'] ); // WPCS: XSS ok. | |