Skip to content

Commit

Permalink
Add __toString method to Style::class
Browse files Browse the repository at this point in the history
`__toString` has been added to render `Style::class` to HTML when the instance is treated as string.
  • Loading branch information
raviks789 committed Jul 17, 2023
1 parent 877d568 commit bac4e7f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Style.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,14 @@ public function render(): string
Text::create($ruleset->renderCss())
);
}

/**
* Render style to HTML when treated like a string
*
* @return string
*/
public function __toString()
{
return $this->render();
}
}

0 comments on commit bac4e7f

Please sign in to comment.