nunomaduro / termwind

🍃 In short, it's like Tailwind CSS, but for the PHP command-line applications.
MIT License
2.29k stars 78 forks source link

Add `defaultStyles` capability to the element #71

Closed xiCO2k closed 3 years ago

xiCO2k commented 3 years ago

This PR adds the capability to add defaultStyles to the element.

The way was before it was setting the default at last:

return Components\Dt::fromStyles(
    self::getRenderer(), $content, $styles, $properties
)->fontBold()->block();

The way I suggested here, it will always be set at first, so if a default style needs to be overwritten it will work.

Let me know if you have a better approach for this.