Hello,
A custom paragraph style can't be applied to ul tags. UL tags allow applying a custom list style; example Core/embedHTML/sample_2.php:
$latinListOptions = array();
$latinListOptions[0]['type'] = 'lowerLetter';
$latinListOptions[0]['format'] = '%1.';
$latinListOptions[1]['type'] = 'lowerRoman';
$latinListOptions[1]['format'] = '%1.%2.';
$docx->createListStyle('latin', $latinListOptions);
$html = '
<ul class="latin">
<li>First item.</li>
<li>Second item with subitems:
<ul>
<li>First subitem.</li>
<li>Second subitem.</li>
</ul>
</li>
<li>Third item.</li>
</ul>';
$docx->embedHTML($html, array('customListStyles' => true));
A custom paragraph style can be applied to block elements such as p and li tags, for example:
$latinListOptions = array();
$latinListOptions[0]['type'] = 'lowerLetter';
$latinListOptions[0]['format'] = '%1.';
$latinListOptions[1]['type'] = 'lowerRoman';
$latinListOptions[1]['format'] = '%1.%2.';
$docx->createListStyle('latin', $latinListOptions);
$style = array(
'italic' => true,
'underline' => 'dash',
);
$docx->createParagraphStyle('myParagraphStyle', $style);
$html = '
<ul class="latin">
<li class="myParagraphStyle">First item.</li>
<li class="myParagraphStyle">Second item with subitems:
<ul>
<li>First subitem.</li>
<li>Second subitem.</li>
</ul>
</li>
<li class="myParagraphStyle">Third item.</li>
</ul>
';
$docx->embedHTML($html, array('customListStyles' => true, 'wordStyles' => array('.myParagraphStyle' => 'myParagraphStyle')));
If you want to avoid adding some default styles (such as the base color) you need to use strictWordStyles or addDefaultStyles options. Otherwise these default styles will have more priority than the ones applied to the custom style.
You can also add a custom numbering style to a custom paragraph style: examples/LayoutAndGeneral/createParagraphStyle/sample_3.php
Regards.