webcode-tk 1.1.6__tar.gz → 1.1.7__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.3
2
2
  Name: webcode-tk
3
- Version: 1.1.6
3
+ Version: 1.1.7
4
4
  Summary:
5
5
  Home-page: https://github.com/HundredVisionsGuy/webcode-tk
6
6
  License: MIT
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "webcode-tk"
3
- version = "1.1.6"
3
+ version = "1.1.7"
4
4
  description = ""
5
5
  authors = ["hundredvisionsguy <cwinikka@gmail.com>"]
6
6
  keywords = ["html", "validation", "css", ]
@@ -19,4 +19,4 @@ Modules exported by this package:
19
19
  - `validator_tools`: sends HTML or CSS code to the W3C Validator to check
20
20
  for errors.
21
21
  """
22
- __version__ = "1.1.6"
22
+ __version__ = "1.1.7"
@@ -315,6 +315,16 @@ class Element(object):
315
315
  type: the type of color contrast.
316
316
  """
317
317
  col = self.color.get("value")
318
+ if not col:
319
+ for i in range(len(self.ancestors) - 1, -1, -1):
320
+ anc = self.ancestors[i]
321
+ if len(anc) > 2:
322
+ color_details = anc[4]
323
+ col = color_details.split(":")[1]
324
+ col = col.strip()
325
+ col = col.split()[0]
326
+ if color.is_color_value(col):
327
+ break
318
328
  bg = self.background_color.get("value")
319
329
  if color.is_gradient(bg):
320
330
  results = color.get_color_contrast_with_gradients(
@@ -280,10 +280,22 @@ class Stylesheet:
280
280
  ):
281
281
  selector = ruleset.selector
282
282
  for declaration in ruleset.declaration_block.declarations:
283
- if (
283
+ color_counts = (
284
284
  "color" in declaration.property
285
285
  or "background" in declaration.property
286
- ):
286
+ and declaration.property
287
+ not in [
288
+ "border-color",
289
+ "outline-color",
290
+ "text-declaration-color",
291
+ "text-emphasis-color",
292
+ "text-shadow",
293
+ "caret-color",
294
+ "column-rule-color",
295
+ "print-color-adjust",
296
+ ]
297
+ )
298
+ if color_counts:
287
299
  property = declaration.property
288
300
  value = declaration.value
289
301
 
File without changes
File without changes