|
96 | 96 | # Classes that rightfully belong here at the moment |
97 | 97 | 's_col_no_bgcolor', 's_col_no_resize', 's_allow_columns', |
98 | 98 | 's_nb_column_fixed', 's_dialog_preview', |
99 | | - 's_parallax_is_fixed', 's_parallax_bg', 's_parallax_no_overflow_hidden', |
| 99 | + 's_parallax_is_fixed', 's_parallax_bg', 's_parallax_bg_wrap', |
100 | 100 | 's_carousel_cards_card', 's_timeline_card', 's_blog_posts', 's_events', |
101 | 101 | 's_appointments', |
102 | 102 |
|
@@ -347,6 +347,16 @@ def check(theme_name, website): |
347 | 347 | "Using %r, view %r defines a row count on a non-grid mode row" |
348 | 348 | % (theme_name, view.key) |
349 | 349 | ) |
| 350 | + |
| 351 | + for el in html_tree.xpath(".//*[contains(concat(' ', normalize-space(@class), ' '), ' s_parallax_bg ')]"): |
| 352 | + parent = el.getparent() |
| 353 | + parent_classes = parent.attrib.get('class') |
| 354 | + if parent_classes != 's_parallax_bg_wrap': |
| 355 | + errors.append( |
| 356 | + "Using %r, view %r: element with class 's_parallax_bg' must have a direct " |
| 357 | + "parent with 's_parallax_bg_wrap', found parent classes: %r" |
| 358 | + % (theme_name, view.key, parent_classes) |
| 359 | + ) |
350 | 360 | except Exception as e: # noqa: BLE001 |
351 | 361 | _logger.error("Using %r, view %r cannot be rendered (%r)", theme_name, view.key, e) |
352 | 362 | errors.append("Using %r, view %r cannot be rendered (%r)" % (theme_name, view.key, e)) |
|
0 commit comments