Make WordPress Core


Ignore:
Timestamp:
01/09/2024 02:43:48 AM (17 months ago)
Author:
isabel_brison
Message:

Editor: add CSS var parsing for fontSize and fontFamily.

Adds capability to parse CSS custom properties for fontSize and fontFamily in WP_Style_Engine.

Props ramonopoly.
Fixes #59982.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/style-engine/styleEngine.php

    r56614 r57253  
    253253            'elements_with_css_var_value'                  => array(
    254254                'block_styles'    => array(
    255                     'color' => array(
     255                    'color'      => array(
    256256                        'text' => 'var:preset|color|my-little-pony',
     257                    ),
     258                    'typography' => array(
     259                        'fontSize'   => 'var:preset|font-size|cabbage-patch',
     260                        'fontFamily' => 'var:preset|font-family|transformers',
    257261                    ),
    258262                ),
     
    261265                ),
    262266                'expected_output' => array(
    263                     'css'          => '.wp-selector{color:var(--wp--preset--color--my-little-pony);}',
    264                     'declarations' => array(
    265                         'color' => 'var(--wp--preset--color--my-little-pony)',
    266                     ),
    267                     'classnames'   => 'has-text-color has-my-little-pony-color',
     267                    'css'          => '.wp-selector{color:var(--wp--preset--color--my-little-pony);font-size:var(--wp--preset--font-size--cabbage-patch);font-family:var(--wp--preset--font-family--transformers);}',
     268                    'declarations' => array(
     269                        'color'       => 'var(--wp--preset--color--my-little-pony)',
     270                        'font-size'   => 'var(--wp--preset--font-size--cabbage-patch)',
     271                        'font-family' => 'var(--wp--preset--font-family--transformers)',
     272
     273                    ),
     274                    'classnames'   => 'has-text-color has-my-little-pony-color has-cabbage-patch-font-size has-transformers-font-family',
    268275                ),
    269276            ),
Note: See TracChangeset for help on using the changeset viewer.