Skip to content

Commit

Permalink
Update cssstyledeclaration.py
Browse files Browse the repository at this point in the history
  • Loading branch information
APN-Pucky authored Nov 4, 2023
1 parent 82c3444 commit 0808ad0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cssutils/css/cssstyledeclaration.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ def getPropertyCSSValue(self, name, normalize=True):
else:
return None

def getPropertyValue(self, name, normalize=True):
def getPropertyValue(self, name, normalize=True, default=''):
r"""
:param name:
of the CSS property, always lowercase (even if not normalized)
Expand All @@ -511,16 +511,18 @@ def getPropertyValue(self, name, normalize=True):
If ``False`` may return **NOT** the effective value but the
effective for the unnormalized name.
:param default:
value to be returned if the property has not been set.
:returns:
the value of the effective property if it has been explicitly set
for this declaration block. Returns the empty string if the
for this declaration block. Returns `default` if the
property has not been set.
"""
p = self.getProperty(name, normalize)
if p:
return p.value
else:
return ''
return default

def getPropertyPriority(self, name, normalize=True):
r"""
Expand Down

0 comments on commit 0808ad0

Please sign in to comment.