Class BrandingPageStyleValidator

java.lang.Object
io.meeds.layout.util.BrandingPageStyleValidator

public final class BrandingPageStyleValidator extends Object
The vocabulary of the page fields of the branding, as the Page drawer writes them: a width from 100 to 3000 pixels or the full width, a hex colour, one gradient function, and keywords for the background options. Every page field is written into the style of every page's body, and the branding service validates none of them against a grammar of its own.
  • Field Details

  • Method Details

    • isAccepted

      public static boolean isAccepted(String field, String value)
      Parameters:
      field - one of the page fields of ThemeOptions.PAGE_FIELDS
      value - the value to write
      Returns:
      true when the value is in the drawer's vocabulary for the field
    • isAcceptedEffect

      public static boolean isAcceptedEffect(String value)
      Parameters:
      value - the value to write in a background image option, of the page or of a theme area
      Returns:
      true when the value is none or exactly one gradient function, as the drawers' background input writes it: a url function anywhere in the value, in any case, or a second layer, is refused