Skip to content

Commit bb87bc2

Browse files
committed
Update README.md
Clarify settings usage
1 parent b43d0c0 commit bb87bc2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@ Add php-css-parser to your composer.json
1919

2020
To use the CSS Parser, create a new instance. The constructor takes the following form:
2121

22-
new Sabberworm\CSS\Parser($sText, $oSettings = Sabberworm\CSS\Settings::create()->withDefaultCharset('utf-8'));
22+
$oSettings = Sabberworm\CSS\Settings::create()->withDefaultCharset('utf-8');
23+
new Sabberworm\CSS\Parser($sText, $oSettings);
2324

24-
The charset is used only if no @charset declaration is found in the CSS file.
25+
The charset is used only if no @charset declaration is found in the CSS file. UTF-8 is the default, so you won’t have to create a settings object at all if you don’t intend to change that.
2526

2627
To read a file, for example, you’d do the following:
2728

0 commit comments

Comments
 (0)