WAIT: Class settings are dropped without warning on element types that lack the control

Area: Global classes › CSS generation

Environment

  • Bricks 2.4.5
  • WordPress 7.1.4, local install
  • Active plugins: Gravity Forms 3.2.3, WPCodeBox 2 1.4.1 (site CSS/PHP snippets), Disable Comments, WPS Hide Login
  • Custom breakpoints, mobile-first: Mobile portrait is the base breakpoint, then Mobile landscape (min-width 639px), Tablet portrait (1023px), Laptop (1279px), Desktop (1535px)
  • Bricks settings › Performance: CSS loading method set to external files

Summary

A global class only outputs CSS for settings that exist as controls on the element type the class is applied to. Any other setting stored in the class is skipped, and nothing in the builder, the class manager or the abilities shows that it was skipped.

Steps to reproduce

  1. Create a global class with a custom selector targeting the slide images, and set Object fit: cover (_objectFit).
  2. Apply the class to a Slider (Nestable) element.
  3. Load the front end.

Expected

object-fit: cover is output for the class selector, or the UI says the setting doesn’t apply to this element type.

Actual

No object-fit rule is output, so the images stretch. The setting is still stored in the class and looks active in the builder.

The same class setting works when the class is applied to an Image element.

Impact

Classes are often shared across element types (a utility or BEM block class used on a Div in one place and a Slider in another). Settings appear saved but do nothing, with no clue why.

Workaround

Put the setting in a separate class applied to the element type that has the control (we added a class on the Image elements inside each slide).

Suggested fix

  • Output every CSS-generating setting stored in a class, whatever element it’s on, or
  • show a warning in the class editor (and in ability responses) when a stored setting won’t output on the current element.

Hi Ben,
Where did you create the global class and set Object fit: cover—in the builder, the Class Manager, or through an ability? Please also share the exact custom selector.