33# __init__.py
44"""
55A μ-library for constructing cascasing style sheets from Python dictionaries.
6-
7- .. latex:vspace:: 10px
8- .. seealso:: `css-parser <https://github.com/ebook-utils/css-parser>`_, which this library builds upon.
96"""
107#
118# Copyright © 2020-2021 Dominic Davis-Foster <dominic@davis-foster.co.uk>
@@ -143,6 +140,7 @@ def dumps(
143140 :return: The style sheet as a string.
144141
145142 .. versionchanged:: 0.2.0 Added support for media at-rules.
143+ .. versionchanged:: 0.5.0 New implementation. Output may differ slightly from previous css-parser based one.
146144 """
147145
148146 serializer = CSSSerializer (
@@ -224,6 +222,8 @@ def dump(
224222 * ``fp`` now accepts :py:obj:`domdf_python_tools.typing.PathLike` objects,
225223 representing the path of a file to write to.
226224 * Added support for media at-rules.
225+
226+ .. versionchanged:: 0.5.0 New implementation. Output may differ slightly from previous css-parser based one.
227227 """
228228
229229 css = dumps (
@@ -247,10 +247,13 @@ def loads(styles: str) -> MutableMapping[str, MutableMapping[str, Any]]:
247247 Parse a style sheet and return its dictionary representation.
248248
249249 .. versionadded:: 0.2.0
250+ .. versionchanged:: 0.5.0 New implementation. Output may differ slightly from previous css-parser based one.
250251
251252 :param styles:
252253
253254 :return: The style sheet as a dictionary.
255+
256+ .. latex:clearpage::
254257 """
255258
256259 stylesheet = tinycss2 .parse_blocks_contents (styles , skip_comments = True , skip_whitespace = True )
@@ -298,6 +301,7 @@ def load(fp: Union[PathLike, IO]) -> MutableMapping[str, MutableMapping[str, Any
298301 Parse a cascading style sheet from the given file and return its dictionary representation.
299302
300303 .. versionadded:: 0.2.0
304+ .. versionchanged:: 0.5.0 New implementation. Output may differ slightly from previous css-parser based one.
301305
302306 :param fp: An open file handle, or the filename of a file to write to.
303307
0 commit comments