Obviously we wont interfere with Form Builder and we'll call the required() function defined within adamwathan/form no matter what. The CSS class will just be added conditionally.
Coverage decreased (-1.6%) to 89.286% when pulling d94265c420ea866934bf511ac98e96ec92ae1523 on Claymm:master into f593c3304c0ff1df9d30c0582301f5519eb43d73 on adamwathan:master.
Coverage increased (+0.2%) to 91.071% when pulling ebd0986145c43721af676dbee0912487b8133b9d on Claymm:master into f593c3304c0ff1df9d30c0582301f5519eb43d73 on adamwathan:master.
By intercepting the
required($conditional)
function here we will add automatically thecontrol-label-required
CSS class to the<label>
HTML element.This way you are able to use CSS to style the
<label>
HTML element however you want, you can even use pseudo-elements to add an asterisk:Obviously we wont interfere with Form Builder and we'll call the
required()
function defined withinadamwathan/form
no matter what. The CSS class will just be added conditionally.