| @@ -7,8 +7,10 @@ | ||
| 7 | 7 | * @author Florian Schmitz, Brett Zamir, Nikolay Matsievsky, Cedric Morin, Christopher Finke, Mark Scherer, Tobias Bäthge |
| 8 | 8 | * @since 1.0.0 |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | +declare(strict_types=1); | |
| 12 | + | |
| 11 | 13 | // Prohibit direct script loading. |
| 12 | 14 | defined( 'ABSPATH' ) || die( 'No direct script access allowed!' ); |
| 13 | 15 | |
| 14 | 16 | /** |
| @@ -72,14 +74,15 @@ | ||
| 72 | 74 | '-webkit-viewport' => 'at', |
| 73 | 75 | '-moz-viewport' => 'at', |
| 74 | 76 | '-ms-viewport' => 'at', |
| 75 | 77 | 'supports' => 'at', |
| 78 | + 'container' => 'at', | |
| 76 | 79 | ); |
| 77 | 80 | |
| 78 | 81 | /** |
| 79 | 82 | * Properties that need a value with unit. |
| 80 | 83 | * |
| 81 | - * @TODO CSS3 properties. | |
| 84 | + * @todo CSS3 properties. | |
| 82 | 85 | * @see compress_numbers(); |
| 83 | 86 | */ |
| 84 | 87 | $data['csstidy']['unit_values'] = array( |
| 85 | 88 | 'background', |
| @@ -106,8 +109,14 @@ | ||
| 106 | 109 | 'margin-top', |
| 107 | 110 | 'margin-right', |
| 108 | 111 | 'margin-bottom', |
| 109 | 112 | 'margin-left', |
| 113 | + 'margin-block', | |
| 114 | + 'margin-block-start', | |
| 115 | + 'margin-block-end', | |
| 116 | + 'margin-inline', | |
| 117 | + 'margin-inline-start', | |
| 118 | + 'margin-inline-end', | |
| 110 | 119 | 'max-height', |
| 111 | 120 | 'max-width', |
| 112 | 121 | 'min-height', |
| 113 | 122 | 'min-width', |
| @@ -129,9 +138,9 @@ | ||
| 129 | 138 | |
| 130 | 139 | /** |
| 131 | 140 | * Properties that allow <color> as value. |
| 132 | 141 | * |
| 133 | - * @TODO CSS3 properties | |
| 142 | + * @todo CSS3 properties | |
| 134 | 143 | * @see compress_numbers(); |
| 135 | 144 | */ |
| 136 | 145 | $data['csstidy']['color_values'] = array( 'background-color', 'border-color', 'border-top-color', 'border-right-color', 'border-bottom-color', 'border-left-color', 'color', 'outline-color', 'column-rule-color' ); |
| 137 | 146 | |
| @@ -137,9 +146,9 @@ | ||
| 137 | 146 | |
| 138 | 147 | /** |
| 139 | 148 | * Default values for the background properties. |
| 140 | 149 | * |
| 141 | - * @TODO Possibly property names will change during CSS3 development. | |
| 150 | + * @todo Possibly property names will change during CSS3 development. | |
| 142 | 151 | * @see dissolve_short_bg() |
| 143 | 152 | * @see merge_bg() |
| 144 | 153 | */ |
| 145 | 154 | $data['csstidy']['background_prop_default'] = array(); |
| @@ -300,9 +309,8 @@ | ||
| 300 | 309 | |
| 301 | 310 | /** |
| 302 | 311 | * A list of all shorthand properties that are divided into four properties and/or have four subvalues. |
| 303 | 312 | * |
| 304 | - * @TODO Are there new ones in CSS3? | |
| 305 | 313 | * @see dissolve_4value_shorthands() |
| 306 | 314 | * @see merge_4value_shorthands() |
| 307 | 315 | */ |
| 308 | 316 | $data['csstidy']['shorthands'] = array(); |
| @@ -309,10 +317,11 @@ | ||
| 309 | 317 | $data['csstidy']['shorthands']['border-color'] = array( 'border-top-color', 'border-right-color', 'border-bottom-color', 'border-left-color' ); |
| 310 | 318 | $data['csstidy']['shorthands']['border-style'] = array( 'border-top-style', 'border-right-style', 'border-bottom-style', 'border-left-style' ); |
| 311 | 319 | $data['csstidy']['shorthands']['border-width'] = array( 'border-top-width', 'border-right-width', 'border-bottom-width', 'border-left-width' ); |
| 312 | 320 | $data['csstidy']['shorthands']['margin'] = array( 'margin-top', 'margin-right', 'margin-bottom', 'margin-left' ); |
| 321 | +$data['csstidy']['shorthands']['margin-block'] = array( 'margin-block-start', 'margin-block-end' ); | |
| 322 | +$data['csstidy']['shorthands']['margin-inline'] = array( 'margin-inline-start', 'margin-inline-end' ); | |
| 313 | 323 | $data['csstidy']['shorthands']['padding'] = array( 'padding-top', 'padding-right', 'padding-bottom', 'padding-left' ); |
| 314 | -$data['csstidy']['shorthands']['-moz-border-radius'] = 0; | |
| 315 | 324 | |
| 316 | 325 | /** |
| 317 | 326 | * All CSS Properties. |
| 318 | 327 | * |
| @@ -317,8 +326,9 @@ | ||
| 317 | 326 | * All CSS Properties. |
| 318 | 327 | * |
| 319 | 328 | * @see CSSTidy::property_is_next() |
| 320 | 329 | */ |
| 330 | +$data['csstidy']['all_properties']['accent-color'] = 'CSS3.0'; | |
| 321 | 331 | $data['csstidy']['all_properties']['align-content'] = 'CSS3.0'; |
| 322 | 332 | $data['csstidy']['all_properties']['align-items'] = 'CSS3.0'; |
| 323 | 333 | $data['csstidy']['all_properties']['align-self'] = 'CSS3.0'; |
| 324 | 334 | $data['csstidy']['all_properties']['alignment-adjust'] = 'CSS3.0'; |
| @@ -332,8 +342,9 @@ | ||
| 332 | 342 | $data['csstidy']['all_properties']['animation-name'] = 'CSS3.0'; |
| 333 | 343 | $data['csstidy']['all_properties']['animation-play-state'] = 'CSS3.0'; |
| 334 | 344 | $data['csstidy']['all_properties']['animation-timing-function'] = 'CSS3.0'; |
| 335 | 345 | $data['csstidy']['all_properties']['appearance'] = 'CSS3.0'; |
| 346 | +$data['csstidy']['all_properties']['aspect-ratio'] = 'CSS3.0'; | |
| 336 | 347 | $data['csstidy']['all_properties']['azimuth'] = 'CSS2.0,CSS2.1,CSS3.0'; |
| 337 | 348 | $data['csstidy']['all_properties']['backface-visibility'] = 'CSS3.0'; |
| 338 | 349 | $data['csstidy']['all_properties']['background'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; |
| 339 | 350 | $data['csstidy']['all_properties']['background-attachment'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; |
| @@ -344,9 +355,8 @@ | ||
| 344 | 355 | $data['csstidy']['all_properties']['background-position'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; |
| 345 | 356 | $data['csstidy']['all_properties']['background-repeat'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; |
| 346 | 357 | $data['csstidy']['all_properties']['background-size'] = 'CSS3.0'; |
| 347 | 358 | $data['csstidy']['all_properties']['baseline-shift'] = 'CSS3.0'; |
| 348 | -$data['csstidy']['all_properties']['binding'] = 'CSS3.0'; | |
| 349 | 359 | $data['csstidy']['all_properties']['bleed'] = 'CSS3.0'; |
| 350 | 360 | $data['csstidy']['all_properties']['bookmark-label'] = 'CSS3.0'; |
| 351 | 361 | $data['csstidy']['all_properties']['bookmark-level'] = 'CSS3.0'; |
| 352 | 362 | $data['csstidy']['all_properties']['bookmark-state'] = 'CSS3.0'; |
| @@ -393,8 +403,9 @@ | ||
| 393 | 403 | $data['csstidy']['all_properties']['break-inside'] = 'CSS3.0'; |
| 394 | 404 | $data['csstidy']['all_properties']['caption-side'] = 'CSS2.0,CSS2.1,CSS3.0'; |
| 395 | 405 | $data['csstidy']['all_properties']['clear'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; |
| 396 | 406 | $data['csstidy']['all_properties']['clip'] = 'CSS2.0,CSS2.1,CSS3.0'; |
| 407 | +$data['csstidy']['all_properties']['clip-path'] = 'CSS2.0,CSS2.1,CSS3.0'; | |
| 397 | 408 | $data['csstidy']['all_properties']['color'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; |
| 398 | 409 | $data['csstidy']['all_properties']['color-profile'] = 'CSS3.0'; |
| 399 | 410 | $data['csstidy']['all_properties']['column-count'] = 'CSS3.0'; |
| 400 | 411 | $data['csstidy']['all_properties']['column-fill'] = 'CSS3.0'; |
| @@ -448,8 +459,9 @@ | ||
| 448 | 459 | $data['csstidy']['all_properties']['font-stretch'] = 'CSS2.0,CSS3.0'; |
| 449 | 460 | $data['csstidy']['all_properties']['font-style'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; |
| 450 | 461 | $data['csstidy']['all_properties']['font-variant'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; |
| 451 | 462 | $data['csstidy']['all_properties']['font-weight'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; |
| 463 | +$data['csstidy']['all_properties']['gap'] = 'CSS3.0'; | |
| 452 | 464 | $data['csstidy']['all_properties']['grid'] = 'CSS3.0'; |
| 453 | 465 | $data['csstidy']['all_properties']['grid-area'] = 'CSS3.0'; |
| 454 | 466 | $data['csstidy']['all_properties']['grid-auto-columns'] = 'CSS3.0'; |
| 455 | 467 | $data['csstidy']['all_properties']['grid-auto-flow'] = 'CSS3.0'; |
| @@ -501,8 +513,14 @@ | ||
| 501 | 513 | $data['csstidy']['all_properties']['margin-bottom'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; |
| 502 | 514 | $data['csstidy']['all_properties']['margin-left'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; |
| 503 | 515 | $data['csstidy']['all_properties']['margin-right'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; |
| 504 | 516 | $data['csstidy']['all_properties']['margin-top'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; |
| 517 | +$data['csstidy']['all_properties']['margin-block'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; | |
| 518 | +$data['csstidy']['all_properties']['margin-block-start'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; | |
| 519 | +$data['csstidy']['all_properties']['margin-block-end'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; | |
| 520 | +$data['csstidy']['all_properties']['margin-inline'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; | |
| 521 | +$data['csstidy']['all_properties']['margin-inline-start'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; | |
| 522 | +$data['csstidy']['all_properties']['margin-inline-end'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; | |
| 505 | 523 | $data['csstidy']['all_properties']['marker-offset'] = 'CSS2.0,CSS3.0'; |
| 506 | 524 | $data['csstidy']['all_properties']['marks'] = 'CSS2.0,CSS3.0'; |
| 507 | 525 | $data['csstidy']['all_properties']['marquee-direction'] = 'CSS3.0'; |
| 508 | 526 | $data['csstidy']['all_properties']['marquee-loop'] = 'CSS3.0'; |
| @@ -508,8 +526,16 @@ | ||
| 508 | 526 | $data['csstidy']['all_properties']['marquee-loop'] = 'CSS3.0'; |
| 509 | 527 | $data['csstidy']['all_properties']['marquee-play-count'] = 'CSS3.0'; |
| 510 | 528 | $data['csstidy']['all_properties']['marquee-speed'] = 'CSS3.0'; |
| 511 | 529 | $data['csstidy']['all_properties']['marquee-style'] = 'CSS3.0'; |
| 530 | +$data['csstidy']['all_properties']['mask-clip'] = 'CSS3.0'; | |
| 531 | +$data['csstidy']['all_properties']['mask-composite'] = 'CSS3.0'; | |
| 532 | +$data['csstidy']['all_properties']['mask-image'] = 'CSS3.0'; | |
| 533 | +$data['csstidy']['all_properties']['mask-mode'] = 'CSS3.0'; | |
| 534 | +$data['csstidy']['all_properties']['mask-origin'] = 'CSS3.0'; | |
| 535 | +$data['csstidy']['all_properties']['mask-position'] = 'CSS3.0'; | |
| 536 | +$data['csstidy']['all_properties']['mask-repeat'] = 'CSS3.0'; | |
| 537 | +$data['csstidy']['all_properties']['mask-size'] = 'CSS3.0'; | |
| 512 | 538 | $data['csstidy']['all_properties']['max-height'] = 'CSS2.0,CSS2.1,CSS3.0'; |
| 513 | 539 | $data['csstidy']['all_properties']['max-width'] = 'CSS2.0,CSS2.1,CSS3.0'; |
| 514 | 540 | $data['csstidy']['all_properties']['min-height'] = 'CSS2.0,CSS2.1,CSS3.0'; |
| 515 | 541 | $data['csstidy']['all_properties']['min-width'] = 'CSS2.0,CSS2.1,CSS3.0'; |
| @@ -518,8 +544,10 @@ | ||
| 518 | 544 | $data['csstidy']['all_properties']['nav-index'] = 'CSS3.0'; |
| 519 | 545 | $data['csstidy']['all_properties']['nav-left'] = 'CSS3.0'; |
| 520 | 546 | $data['csstidy']['all_properties']['nav-right'] = 'CSS3.0'; |
| 521 | 547 | $data['csstidy']['all_properties']['nav-up'] = 'CSS3.0'; |
| 548 | +$data['csstidy']['all_properties']['object-fit'] = 'CSS3.0'; | |
| 549 | +$data['csstidy']['all_properties']['object-position'] = 'CSS3.0'; | |
| 522 | 550 | $data['csstidy']['all_properties']['opacity'] = 'CSS3.0'; |
| 523 | 551 | $data['csstidy']['all_properties']['order'] = 'CSS3.0'; |
| 524 | 552 | $data['csstidy']['all_properties']['orphans'] = 'CSS2.0,CSS2.1,CSS3.0'; |
| 525 | 553 | $data['csstidy']['all_properties']['outline'] = 'CSS2.0,CSS2.1,CSS3.0'; |
| @@ -567,8 +595,33 @@ | ||
| 567 | 595 | $data['csstidy']['all_properties']['ruby-align'] = 'CSS3.0'; |
| 568 | 596 | $data['csstidy']['all_properties']['ruby-overhang'] = 'CSS3.0'; |
| 569 | 597 | $data['csstidy']['all_properties']['ruby-position'] = 'CSS3.0'; |
| 570 | 598 | $data['csstidy']['all_properties']['ruby-span'] = 'CSS3.0'; |
| 599 | +$data['csstidy']['all_properties']['scroll-behavior'] = 'CSS3.0'; | |
| 600 | +$data['csstidy']['all_properties']['scroll-margin'] = 'CSS3.0'; | |
| 601 | +$data['csstidy']['all_properties']['scroll-margin-block'] = 'CSS3.0'; | |
| 602 | +$data['csstidy']['all_properties']['scroll-margin-block-end'] = 'CSS3.0'; | |
| 603 | +$data['csstidy']['all_properties']['scroll-margin-block-start'] = 'CSS3.0'; | |
| 604 | +$data['csstidy']['all_properties']['scroll-margin-bottom'] = 'CSS3.0'; | |
| 605 | +$data['csstidy']['all_properties']['scroll-margin-inline'] = 'CSS3.0'; | |
| 606 | +$data['csstidy']['all_properties']['scroll-margin-inline-end'] = 'CSS3.0'; | |
| 607 | +$data['csstidy']['all_properties']['scroll-margin-inline-start'] = 'CSS3.0'; | |
| 608 | +$data['csstidy']['all_properties']['scroll-margin-left'] = 'CSS3.0'; | |
| 609 | +$data['csstidy']['all_properties']['scroll-margin-right'] = 'CSS3.0'; | |
| 610 | +$data['csstidy']['all_properties']['scroll-margin-top'] = 'CSS3.0'; | |
| 611 | +$data['csstidy']['all_properties']['scroll-padding'] = 'CSS3.0'; | |
| 612 | +$data['csstidy']['all_properties']['scroll-padding-block'] = 'CSS3.0'; | |
| 613 | +$data['csstidy']['all_properties']['scroll-padding-block-end'] = 'CSS3.0'; | |
| 614 | +$data['csstidy']['all_properties']['scroll-padding-block-start'] = 'CSS3.0'; | |
| 615 | +$data['csstidy']['all_properties']['scroll-padding-bottom'] = 'CSS3.0'; | |
| 616 | +$data['csstidy']['all_properties']['scroll-padding-inline'] = 'CSS3.0'; | |
| 617 | +$data['csstidy']['all_properties']['scroll-padding-inline-end'] = 'CSS3.0'; | |
| 618 | +$data['csstidy']['all_properties']['scroll-padding-inline-start'] = 'CSS3.0'; | |
| 619 | +$data['csstidy']['all_properties']['scroll-padding-left'] = 'CSS3.0'; | |
| 620 | +$data['csstidy']['all_properties']['scroll-padding-right'] = 'CSS3.0'; | |
| 621 | +$data['csstidy']['all_properties']['scroll-padding-top'] = 'CSS3.0'; | |
| 622 | +$data['csstidy']['all_properties']['scroll-snap-align'] = 'CSS3.0'; | |
| 623 | +$data['csstidy']['all_properties']['scroll-snap-stop'] = 'CSS3.0'; | |
| 571 | 624 | $data['csstidy']['all_properties']['size'] = 'CSS2.0,CSS3.0'; |
| 572 | 625 | $data['csstidy']['all_properties']['speak'] = 'CSS2.0,CSS2.1,CSS3.0'; |
| 573 | 626 | $data['csstidy']['all_properties']['speak-header'] = 'CSS2.0,CSS2.1,CSS3.0'; |
| 574 | 627 | $data['csstidy']['all_properties']['speak-numeral'] = 'CSS2.0,CSS2.1,CSS3.0'; |
| @@ -599,10 +652,12 @@ | ||
| 599 | 652 | $data['csstidy']['all_properties']['text-indent'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; |
| 600 | 653 | $data['csstidy']['all_properties']['text-justify'] = 'CSS3.0'; |
| 601 | 654 | $data['csstidy']['all_properties']['text-outline'] = 'CSS3.0'; |
| 602 | 655 | $data['csstidy']['all_properties']['text-shadow'] = 'CSS2.0,CSS3.0'; |
| 656 | +$data['csstidy']['all_properties']['text-size-adjust'] = 'CSS3.0'; | |
| 603 | 657 | $data['csstidy']['all_properties']['text-space-collapse'] = 'CSS3.0'; |
| 604 | 658 | $data['csstidy']['all_properties']['text-transform'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; |
| 659 | +$data['csstidy']['all_properties']['text-underline-offset'] = 'CSS3.0'; | |
| 605 | 660 | $data['csstidy']['all_properties']['text-underline-position'] = 'CSS3.0'; |
| 606 | 661 | $data['csstidy']['all_properties']['text-wrap'] = 'CSS3.0'; |
| 607 | 662 | $data['csstidy']['all_properties']['top'] = 'CSS2.0,CSS2.1,CSS3.0'; |
| 608 | 663 | $data['csstidy']['all_properties']['transform'] = 'CSS3.0'; |
| @@ -630,9 +685,12 @@ | ||
| 630 | 685 | $data['csstidy']['all_properties']['width'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; |
| 631 | 686 | $data['csstidy']['all_properties']['word-break'] = 'CSS3.0'; |
| 632 | 687 | $data['csstidy']['all_properties']['word-spacing'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; |
| 633 | 688 | $data['csstidy']['all_properties']['word-wrap'] = 'CSS3.0'; |
| 689 | +$data['csstidy']['all_properties']['writing-mode'] = 'CSS3.0'; | |
| 634 | 690 | $data['csstidy']['all_properties']['z-index'] = 'CSS2.0,CSS2.1,CSS3.0'; |
| 691 | +$data['csstidy']['all_properties']['zoom'] = 'CSS3.0'; | |
| 692 | +$data['csstidy']['all_properties']['--custom'] = 'CSS3.0'; // Placeholder for custom properties, used in TablePress_CSSTidy::property_is_valid(). | |
| 635 | 693 | |
| 636 | 694 | /** |
| 637 | 695 | * An array containing all properties that can accept a quoted string as a value. |
| 638 | 696 | */ |
| @@ -648,66 +706,149 @@ | ||
| 648 | 706 | * An array containing all predefined templates. |
| 649 | 707 | * |
| 650 | 708 | * @see CSSTidy::load_template() |
| 651 | 709 | */ |
| 652 | -$data['csstidy']['predefined_templates']['default'][] = '<span class="at">'; //string before @rule | |
| 653 | -$data['csstidy']['predefined_templates']['default'][] = '</span> <span class="format">{</span>' . "\n"; //bracket after @-rule | |
| 654 | -$data['csstidy']['predefined_templates']['default'][] = '<span class="selector">'; //string before selector | |
| 655 | -$data['csstidy']['predefined_templates']['default'][] = '</span> <span class="format">{</span>' . "\n"; //bracket after selector | |
| 656 | -$data['csstidy']['predefined_templates']['default'][] = '<span class="property">'; //string before property | |
| 657 | -$data['csstidy']['predefined_templates']['default'][] = '</span><span class="value">'; //string after property+before value | |
| 658 | -$data['csstidy']['predefined_templates']['default'][] = '</span><span class="format">;</span>' . "\n"; //string after value | |
| 659 | -$data['csstidy']['predefined_templates']['default'][] = '<span class="format">}</span>'; //closing bracket - selector | |
| 660 | -$data['csstidy']['predefined_templates']['default'][] = "\n\n"; //space between blocks {...} | |
| 661 | -$data['csstidy']['predefined_templates']['default'][] = "\n" . '<span class="format">}</span>' . "\n\n"; //closing bracket @-rule | |
| 662 | -$data['csstidy']['predefined_templates']['default'][] = ''; //indent in @-rule | |
| 663 | -$data['csstidy']['predefined_templates']['default'][] = '<span class="comment">'; // before comment | |
| 664 | -$data['csstidy']['predefined_templates']['default'][] = '</span>' . "\n"; // after comment | |
| 665 | -$data['csstidy']['predefined_templates']['default'][] = "\n"; // after each line @-rule | |
| 710 | +$data['csstidy']['predefined_templates']['default'][] = ''; // string before @rule. | |
| 711 | +$data['csstidy']['predefined_templates']['default'][] = " {\n"; // bracket after @-rule. | |
| 712 | +$data['csstidy']['predefined_templates']['default'][] = ''; // string before selector. | |
| 713 | +$data['csstidy']['predefined_templates']['default'][] = " {\n"; // bracket after selector. | |
| 714 | +$data['csstidy']['predefined_templates']['default'][] = "\t"; // string before property. | |
| 715 | +$data['csstidy']['predefined_templates']['default'][] = ' '; // string after property+before value. | |
| 716 | +$data['csstidy']['predefined_templates']['default'][] = ';'; // string after value. | |
| 717 | +$data['csstidy']['predefined_templates']['default'][] = '}'; // closing bracket - selector. | |
| 718 | +$data['csstidy']['predefined_templates']['default'][] = "\n\n"; // space between blocks {...}. | |
| 719 | +$data['csstidy']['predefined_templates']['default'][] = "\n}\n\n"; // closing bracket @-rule. | |
| 720 | +$data['csstidy']['predefined_templates']['default'][] = "\t"; // indent in @-rule. | |
| 721 | +$data['csstidy']['predefined_templates']['default'][] = ''; // before comment. | |
| 722 | +$data['csstidy']['predefined_templates']['default'][] = "\n"; // after comment. | |
| 723 | +$data['csstidy']['predefined_templates']['default'][] = "\n"; // after each line @-rule. | |
| 666 | 724 | |
| 667 | -$data['csstidy']['predefined_templates']['high_compression'][] = '<span class="at">'; | |
| 668 | -$data['csstidy']['predefined_templates']['high_compression'][] = '</span> <span class="format">{</span>' . "\n"; | |
| 669 | -$data['csstidy']['predefined_templates']['high_compression'][] = '<span class="selector">'; | |
| 670 | -$data['csstidy']['predefined_templates']['high_compression'][] = '</span><span class="format">{</span>'; | |
| 671 | -$data['csstidy']['predefined_templates']['high_compression'][] = '<span class="property">'; | |
| 672 | -$data['csstidy']['predefined_templates']['high_compression'][] = '</span><span class="value">'; | |
| 673 | -$data['csstidy']['predefined_templates']['high_compression'][] = '</span><span class="format">;</span>'; | |
| 674 | -$data['csstidy']['predefined_templates']['high_compression'][] = '<span class="format">}</span>'; | |
| 675 | -$data['csstidy']['predefined_templates']['high_compression'][] = "\n"; | |
| 676 | -$data['csstidy']['predefined_templates']['high_compression'][] = "\n" . '<span class="format">}' . "\n" . '</span>'; | |
| 677 | -$data['csstidy']['predefined_templates']['high_compression'][] = ''; | |
| 678 | -$data['csstidy']['predefined_templates']['high_compression'][] = '<span class="comment">'; // before comment | |
| 679 | -$data['csstidy']['predefined_templates']['high_compression'][] = '</span>'; // after comment | |
| 680 | -$data['csstidy']['predefined_templates']['high_compression'][] = "\n"; | |
| 725 | +$data['csstidy']['predefined_templates']['low'][] = '<span class="at">'; | |
| 726 | +$data['csstidy']['predefined_templates']['low'][] = '</span> <span class="format">{</span>' . "\n"; | |
| 727 | +$data['csstidy']['predefined_templates']['low'][] = '<span class="selector">'; | |
| 728 | +$data['csstidy']['predefined_templates']['low'][] = '</span>' . "\n" . '<span class="format">{</span>' . "\n"; | |
| 729 | +$data['csstidy']['predefined_templates']['low'][] = ' <span class="property">'; | |
| 730 | +$data['csstidy']['predefined_templates']['low'][] = '</span><span class="value">'; | |
| 731 | +$data['csstidy']['predefined_templates']['low'][] = '</span><span class="format">;</span>' . "\n"; | |
| 732 | +$data['csstidy']['predefined_templates']['low'][] = '<span class="format">}</span>'; | |
| 733 | +$data['csstidy']['predefined_templates']['low'][] = "\n\n"; | |
| 734 | +$data['csstidy']['predefined_templates']['low'][] = "\n" . '<span class="format">}</span>' . "\n\n"; | |
| 735 | +$data['csstidy']['predefined_templates']['low'][] = ' '; | |
| 736 | +$data['csstidy']['predefined_templates']['low'][] = '<span class="comment">'; | |
| 737 | +$data['csstidy']['predefined_templates']['low'][] = "</span>\n"; | |
| 738 | +$data['csstidy']['predefined_templates']['low'][] = "\n"; | |
| 681 | 739 | |
| 682 | -$data['csstidy']['predefined_templates']['highest_compression'][] = '<span class="at">'; | |
| 683 | -$data['csstidy']['predefined_templates']['highest_compression'][] = '</span><span class="format">{</span>'; | |
| 684 | -$data['csstidy']['predefined_templates']['highest_compression'][] = '<span class="selector">'; | |
| 685 | -$data['csstidy']['predefined_templates']['highest_compression'][] = '</span><span class="format">{</span>'; | |
| 686 | -$data['csstidy']['predefined_templates']['highest_compression'][] = '<span class="property">'; | |
| 687 | -$data['csstidy']['predefined_templates']['highest_compression'][] = '</span><span class="value">'; | |
| 688 | -$data['csstidy']['predefined_templates']['highest_compression'][] = '</span><span class="format">;</span>'; | |
| 689 | -$data['csstidy']['predefined_templates']['highest_compression'][] = '<span class="format">}</span>'; | |
| 690 | -$data['csstidy']['predefined_templates']['highest_compression'][] = ''; | |
| 691 | -$data['csstidy']['predefined_templates']['highest_compression'][] = '<span class="format">}</span>'; | |
| 692 | -$data['csstidy']['predefined_templates']['highest_compression'][] = ''; | |
| 693 | -$data['csstidy']['predefined_templates']['highest_compression'][] = '<span class="comment">'; // before comment | |
| 694 | -$data['csstidy']['predefined_templates']['highest_compression'][] = '</span>'; // after comment | |
| 695 | -$data['csstidy']['predefined_templates']['highest_compression'][] = ''; | |
| 740 | +$data['csstidy']['predefined_templates']['high'][] = '<span class="at">'; | |
| 741 | +$data['csstidy']['predefined_templates']['high'][] = '</span> <span class="format">{</span>' . "\n"; | |
| 742 | +$data['csstidy']['predefined_templates']['high'][] = '<span class="selector">'; | |
| 743 | +$data['csstidy']['predefined_templates']['high'][] = '</span><span class="format">{</span>'; | |
| 744 | +$data['csstidy']['predefined_templates']['high'][] = '<span class="property">'; | |
| 745 | +$data['csstidy']['predefined_templates']['high'][] = '</span><span class="value">'; | |
| 746 | +$data['csstidy']['predefined_templates']['high'][] = '</span><span class="format">;</span>'; | |
| 747 | +$data['csstidy']['predefined_templates']['high'][] = '<span class="format">}</span>'; | |
| 748 | +$data['csstidy']['predefined_templates']['high'][] = "\n"; | |
| 749 | +$data['csstidy']['predefined_templates']['high'][] = "\n" . '<span class="format">}' . "\n" . '</span>'; | |
| 750 | +$data['csstidy']['predefined_templates']['high'][] = ''; | |
| 751 | +$data['csstidy']['predefined_templates']['high'][] = '<span class="comment">'; | |
| 752 | +$data['csstidy']['predefined_templates']['high'][] = "</span>\n"; | |
| 753 | +$data['csstidy']['predefined_templates']['high'][] = "\n"; | |
| 696 | 754 | |
| 697 | -$data['csstidy']['predefined_templates']['low_compression'][] = '<span class="at">'; | |
| 698 | -$data['csstidy']['predefined_templates']['low_compression'][] = '</span> <span class="format">{</span>' . "\n"; | |
| 699 | -$data['csstidy']['predefined_templates']['low_compression'][] = '<span class="selector">'; | |
| 700 | -$data['csstidy']['predefined_templates']['low_compression'][] = '</span>' . "\n" . '<span class="format">{</span>' . "\n"; | |
| 701 | -$data['csstidy']['predefined_templates']['low_compression'][] = ' <span class="property">'; | |
| 702 | -$data['csstidy']['predefined_templates']['low_compression'][] = '</span><span class="value">'; | |
| 703 | -$data['csstidy']['predefined_templates']['low_compression'][] = '</span><span class="format">;</span>' . "\n"; | |
| 704 | -$data['csstidy']['predefined_templates']['low_compression'][] = '<span class="format">}</span>'; | |
| 705 | -$data['csstidy']['predefined_templates']['low_compression'][] = "\n\n"; | |
| 706 | -$data['csstidy']['predefined_templates']['low_compression'][] = "\n" . '<span class="format">}</span>' . "\n\n"; | |
| 707 | -$data['csstidy']['predefined_templates']['low_compression'][] = ' '; | |
| 708 | -$data['csstidy']['predefined_templates']['low_compression'][] = '<span class="comment">'; // before comment | |
| 709 | -$data['csstidy']['predefined_templates']['low_compression'][] = '</span>' . "\n"; // after comment | |
| 710 | -$data['csstidy']['predefined_templates']['low_compression'][] = "\n"; | |
| 755 | +$data['csstidy']['predefined_templates']['highest'][] = '<span class="at">'; | |
| 756 | +$data['csstidy']['predefined_templates']['highest'][] = '</span><span class="format">{</span>'; | |
| 757 | +$data['csstidy']['predefined_templates']['highest'][] = '<span class="selector">'; | |
| 758 | +$data['csstidy']['predefined_templates']['highest'][] = '</span><span class="format">{</span>'; | |
| 759 | +$data['csstidy']['predefined_templates']['highest'][] = '<span class="property">'; | |
| 760 | +$data['csstidy']['predefined_templates']['highest'][] = '</span><span class="value">'; | |
| 761 | +$data['csstidy']['predefined_templates']['highest'][] = '</span><span class="format">;</span>'; | |
| 762 | +$data['csstidy']['predefined_templates']['highest'][] = '<span class="format">}</span>'; | |
| 763 | +$data['csstidy']['predefined_templates']['highest'][] = ''; | |
| 764 | +$data['csstidy']['predefined_templates']['highest'][] = '<span class="format">}</span>'; | |
| 765 | +$data['csstidy']['predefined_templates']['highest'][] = ''; | |
| 766 | +$data['csstidy']['predefined_templates']['highest'][] = '<span class="comment">'; | |
| 767 | +$data['csstidy']['predefined_templates']['highest'][] = "</span>\n"; | |
| 768 | +$data['csstidy']['predefined_templates']['highest'][] = ''; | |
| 711 | 769 | |
| 712 | -// Add TablePress specific modifications. | |
| 713 | -require dirname( __FILE__ ) . '/data-tp.inc.php'; | |
| 770 | +// Support browser prefixes for properties only in the latest CSS draft. | |
| 771 | +foreach ( $data['csstidy']['all_properties'] as $property => $levels ) { | |
| 772 | + if ( ! str_contains( $levels, ',' ) ) { | |
| 773 | + $data['csstidy']['all_properties'][ '-moz-' . $property ] = $levels; | |
| 774 | + $data['csstidy']['all_properties'][ '-webkit-' . $property ] = $levels; | |
| 775 | + $data['csstidy']['all_properties'][ '-ms-' . $property ] = $levels; | |
| 776 | + $data['csstidy']['all_properties'][ '-o-' . $property ] = $levels; | |
| 777 | + | |
| 778 | + if ( in_array( $property, $data['csstidy']['unit_values'], true ) ) { | |
| 779 | + $data['csstidy']['unit_values'][] = '-moz-' . $property; | |
| 780 | + $data['csstidy']['unit_values'][] = '-webkit-' . $property; | |
| 781 | + $data['csstidy']['unit_values'][] = '-ms-' . $property; | |
| 782 | + $data['csstidy']['unit_values'][] = '-o-' . $property; | |
| 783 | + } | |
| 784 | + | |
| 785 | + if ( in_array( $property, $data['csstidy']['color_values'], true ) ) { | |
| 786 | + $data['csstidy']['color_values'][] = '-moz-' . $property; | |
| 787 | + $data['csstidy']['color_values'][] = '-webkit-' . $property; | |
| 788 | + $data['csstidy']['color_values'][] = '-ms-' . $property; | |
| 789 | + $data['csstidy']['color_values'][] = '-o-' . $property; | |
| 790 | + } | |
| 791 | + } | |
| 792 | +} | |
| 793 | + | |
| 794 | +// Allow vendor prefixes for any property that is allowed to be used multiple times inside a single selector. | |
| 795 | +foreach ( $data['csstidy']['multiple_properties'] as $property ) { | |
| 796 | + if ( '-' !== $property[0] ) { | |
| 797 | + $data['csstidy']['multiple_properties'][] = '-o-' . $property; | |
| 798 | + $data['csstidy']['multiple_properties'][] = '-ms-' . $property; | |
| 799 | + $data['csstidy']['multiple_properties'][] = '-webkit-' . $property; | |
| 800 | + $data['csstidy']['multiple_properties'][] = '-moz-' . $property; | |
| 801 | + } | |
| 802 | +} | |
| 803 | + | |
| 804 | +/** | |
| 805 | + * Non-standard CSS properties. They're not part of any spec, but we say | |
| 806 | + * they're in all of them so that we can support them. | |
| 807 | + */ | |
| 808 | +$data['csstidy']['all_properties']['-webkit-user-select'] = 'CSS2.0,CSS2.1,CSS3.0'; | |
| 809 | +$data['csstidy']['all_properties']['-ms-user-select'] = 'CSS2.0,CSS2.1,CSS3.0'; | |
| 810 | +$data['csstidy']['all_properties']['user-select'] = 'CSS2.0,CSS2.1,CSS3.0'; | |
| 811 | +$data['csstidy']['all_properties']['-webkit-filter'] = 'CSS2.0,CSS2.1,CSS3.0'; | |
| 812 | +$data['csstidy']['all_properties']['-moz-filter'] = 'CSS2.0,CSS2.1,CSS3.0'; | |
| 813 | +$data['csstidy']['all_properties']['-ms-filter'] = 'CSS2.0,CSS2.1,CSS3.0'; | |
| 814 | +$data['csstidy']['all_properties']['filter'] = 'CSS2.0,CSS2.1,CSS3.0'; | |
| 815 | +$data['csstidy']['all_properties']['scrollbar-face-color'] = 'CSS2.0,CSS2.1,CSS3.0'; | |
| 816 | +$data['csstidy']['all_properties']['-ms-interpolation-mode'] = 'CSS2.0,CSS2.1,CSS3.0'; | |
| 817 | +$data['csstidy']['all_properties']['text-rendering'] = 'CSS2.0,CSS2.1,CSS3.0'; | |
| 818 | +$data['csstidy']['all_properties']['-webkit-transform-origin-x'] = 'CSS3.0'; | |
| 819 | +$data['csstidy']['all_properties']['-webkit-transform-origin-y'] = 'CSS3.0'; | |
| 820 | +$data['csstidy']['all_properties']['-webkit-transform-origin-z'] = 'CSS3.0'; | |
| 821 | +$data['csstidy']['all_properties']['-webkit-font-smoothing'] = 'CSS3.0'; | |
| 822 | +$data['csstidy']['all_properties']['-moz-osx-font-smoothing'] = 'CSS3.0'; | |
| 823 | +$data['csstidy']['all_properties']['-font-smooth'] = 'CSS3.0'; | |
| 824 | +$data['csstidy']['all_properties']['text-overflow'] = 'CSS3.0'; | |
| 825 | +$data['csstidy']['all_properties']['-o-text-overflow'] = 'CSS3.0'; | |
| 826 | +$data['csstidy']['all_properties']['-ms-touch-action'] = 'CSS3.0'; | |
| 827 | +$data['csstidy']['all_properties']['-webkit-overflow-scrolling'] = 'CSS3.0'; | |
| 828 | +$data['csstidy']['all_properties']['pointer-events'] = 'CSS3.0'; | |
| 829 | +$data['csstidy']['all_properties']['font-feature-settings'] = 'CSS3.0'; | |
| 830 | +$data['csstidy']['all_properties']['font-kerning'] = 'CSS3.0'; | |
| 831 | +$data['csstidy']['all_properties']['font-language-override'] = 'CSS3.0'; | |
| 832 | +$data['csstidy']['all_properties']['font-synthesis'] = 'CSS3.0'; | |
| 833 | +$data['csstidy']['all_properties']['font-variant-alternates'] = 'CSS3.0'; | |
| 834 | +$data['csstidy']['all_properties']['font-variant-caps'] = 'CSS3.0'; | |
| 835 | +$data['csstidy']['all_properties']['font-variant-east-asian'] = 'CSS3.0'; | |
| 836 | +$data['csstidy']['all_properties']['font-variant-ligatures'] = 'CSS3.0'; | |
| 837 | +$data['csstidy']['all_properties']['font-variant-numeric'] = 'CSS3.0'; | |
| 838 | +$data['csstidy']['all_properties']['font-variant-position'] = 'CSS3.0'; | |
| 839 | +$data['csstidy']['all_properties']['font-variation-settings'] = 'CSS3.0'; | |
| 840 | +$data['csstidy']['all_properties']['line-height-step'] = 'CSS3.0'; | |
| 841 | +$data['csstidy']['all_properties']['-webkit-text-fill-color'] = 'CSS3.0'; | |
| 842 | +$data['csstidy']['all_properties']['-webkit-backdrop-filter'] = 'CSS3.0'; | |
| 843 | +$data['csstidy']['all_properties']['backdrop-filter'] = 'CSS3.0'; | |
| 844 | +$data['csstidy']['all_properties']['-webkit-box-orient'] = 'CSS3.0'; | |
| 845 | +$data['csstidy']['all_properties']['-webkit-line-clamp'] = 'CSS3.0'; | |
| 846 | +$data['csstidy']['all_properties']['-webkit-box-orient'] = 'CSS3.0'; | |
| 847 | +$data['csstidy']['all_properties']['contain'] = 'CSS3.0'; | |
| 848 | +$data['csstidy']['all_properties']['contain-intrinsic-size'] = 'CSS3.0'; | |
| 849 | +$data['csstidy']['all_properties']['container'] = 'CSS3.0'; | |
| 850 | +$data['csstidy']['all_properties']['container-name'] = 'CSS3.0'; | |
| 851 | +$data['csstidy']['all_properties']['container-type'] = 'CSS3.0'; | |
| 852 | +$data['csstidy']['all_properties']['content-visibility'] = 'CSS3.0'; | |
| 853 | + | |
| 854 | +return $data; | |