Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
v2.3.0
======

#7: Add support for a ``calc()`` within a ``calc()``.

v2.2.0
======

Expand Down
2 changes: 1 addition & 1 deletion cssutils/css/csspagerule.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def S(expected, seq, token, tokenizer=None):
return expected

def IDENT(expected, seq, token, tokenizer=None):
""
""" """
val = self._tokenvalue(token)
if 'page' == expected:
if self._normalize(val) == 'auto':
Expand Down
4 changes: 3 additions & 1 deletion cssutils/css/value.py
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,9 @@ def _setCssText(self, cssText):
),
)

_operant = lambda: Choice(_DimensionProd(self), _CSSVariableProd(self)) # noqa
_operant = lambda: Choice( # noqa:E731
_DimensionProd(self), _CalcValueProd(self), _CSSVariableProd(self)
)

prods = Sequence(
Prod(
Expand Down
10 changes: 10 additions & 0 deletions cssutils/tests/test_value.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,16 @@ def test_cssText(self):
'calc(1 / 1px )': ('calc(1 / 1px)', 1, 'calc(1 / 1px)'),
'calc( 1*1px )': ('calc(1 * 1px)', 1, 'calc(1 * 1px)'),
'calc( 1 / 1px )': ('calc(1 / 1px)', 1, 'calc(1 / 1px)'),
'calc(calc(1px + 5px) * 4)': (
'calc(calc(1px + 5px) * 4)',
1,
'calc(calc(1px + 5px) * 4)',
),
'calc( calc(1px + 5px)*4 )': (
'calc(calc(1px + 5px) * 4)',
1,
'calc(calc(1px + 5px) * 4)',
),
'calc(var(X))': (None, 1, None),
'calc(2 * var(X))': (None, 1, None),
'calc(2px + var(X))': (None, 1, None),
Expand Down