K so I had to go full on beast mode with this one and piece together random pieces of documentation. Here is an example if you want to enable flex box CSS into your CSS.AllowedProperties area (don't even have to configure that).
$config = HTMLPurifier_Config::createDefault();
$config->set('CSS.AllowImportant', true);
$config->set('CSS.AllowTricky', true);
$config->set('CSS.Proprietary', true);
$config->set('CSS.Trusted', true);
$css_definition = $config->getDefinition('CSS');
// redefine this to add the flex attribute
$css_definition->info['display'] = new HTMLPurifier_AttrDef_Enum(
[
'inline',
'block',
'list-item',
'run-in',
'compact',
'marker',
'table',
'inline-block',
'inline-table',
'table-row-group',
'table-header-group',
'table-footer-group',
'table-row',
'table-column-group',
'table-column',
'table-cell',
'table-caption',
'none',
'flex'
]
);
$css_definition->info['flex-direction'] = new HTMLPurifier_AttrDef_Enum(
[
'column',
'column-reverse',
'row',
'row-reverse'
]
);
$css_definition->info['flex-wrap'] = new HTMLPurifier_AttrDef_Enum(
[
'wrap',
'nowrap',
'wrap-reverse'
]
);
$css_definition->info['justify-content'] = new HTMLPurifier_AttrDef_Enum(
[
'center',
'flex-start',
'flex-end',
'space-around',
'space-between'
]
);
$css_definition->info['align-items'] = new HTMLPurifier_AttrDef_Enum(
[
'center',
'flex-start',
'flex-end',
'stretch',
'baseline'
]
);
$css_definition->info['align-content'] = new HTMLPurifier_AttrDef_Enum(
[
'space-between',
'space-around',
'stretch',
'center',
'flex-start',
'flex-end'
]
);
$css_definition->info['flex-basis'] = new HTMLPurifier_AttrDef_CSS_Percentage();
$purifier = new HTMLPurifier($config);