Global CSS API: Fields - Choice (Checkbox, Radio, Image, & Consent)

The following CSS custom properties are used for the choice based field UI, such as checkbox, radio, consent, and image choice fields.

Choice Field Base

Properties used for base choice based field UI.

PropertyDescriptionDefault
--gf-field-choice-gapGap.var(--gf-label-space-x-secondary)
--gf-field-choice-align-x-gap-yVertical (top/bottom) gap for horizontal choice field alignment.var(--gf-field-choice-gap)
--gf-field-choice-align-x-gap-xHorizontal (left/right) gap for horizontal choice field alignment.16px
--gf-field-choice-meta-margin-y-startVertical start (top) margin for choice field meta.4px
--gf-field-choice-meta-spaceSpacer for choice field meta.16px
--gf-field-choice-other-ctrl-max-widthMax width for other field control.256px

Image Choice Field

Properties used for the image choice field UI.

PropertyDescriptionDefault
Base
--gf-field-img-choice-aspect-ratioImage aspect ratio.1/1
--gf-field-img-choice-gapGap.var(--gf-field-gap-x)
--gf-field-img-choice-margin-y-endVertical end (bottom) margin for image.12px
--gf-field-img-choice-placeholder-icon-font-sizeImage placeholder icon font size.60px
--gf-field-img-choice-radius-squareImage border radius when using square style.var(--gf-ctrl-radius-max-sm)
--gf-field-img-choice-radius-roundImage border radius when using round style.50%
--gf-field-img-choice-shadowImage box shadow.0 0 0 rgba(18, 25, 97, 0.05), 0 2px 5px rgba(18, 25, 97, 0.1), 0 1px 1px rgba(18, 25, 97, 0.15)
--gf-field-img-choice-shadow-hoverImage box shadow on hover.0 0 1px rgba(18, 25, 97, 0.24), 0 24px 24px rgba(18, 25, 97, 0.03), 0 2px 2px rgba(18, 25, 97, 0.03), 0 4px 4px rgba(18, 25, 97, 0.03), 0 8px 8px rgba(18, 25, 97, 0.03), 0 16px 16px rgba(18, 25, 97, 0.03)
--gf-field-img-choice-size-smSmall image choice size.125px
--gf-field-img-choice-size-mdMedium image choice size.200px
--gf-field-img-choice-size-lgLarge image choice size.300px
--gf-field-img-choice-sizeImage choice size.var(--gf-field-img-choice-size-md)
Appearance - Card
--gf-field-img-choice-card-placeholder-bg-colorImage placeholder background color.rgba(var(--gf-color-in-ctrl-light-rgb), 0.05)
--gf-field-img-choice-card-placeholder-colorImage placeholder color.rgba(var(--gf-color-in-ctrl-dark-rgb), 0.4)
--gf-field-img-choice-card-check-ind-bg-colorChecked indicator background color.var(--gf-color-in-ctrl-primary)
--gf-field-img-choice-card-check-ind-icon-colorChecked indicator icon color.var(--gf-color-in-ctrl-primary-contrast)
--gf-field-img-choice-card-space-smSpacer for small image choice UI.8px
--gf-field-img-choice-card-space-mdSpacer for medium image choice UI.12px
--gf-field-img-choice-card-space-lgSpacer for large image choice UI.16px
--gf-field-img-choice-card-spaceSpacer for image choice UI.var(--gf-field-img-choice-card-space-md)
Appearance - No Card
--gf-field-img-choice-no-card-placeholder-bg-colorImage placeholder background color.rgba(var(--gf-color-out-ctrl-light-rgb), 0.05)
--gf-field-img-choice-no-card-placeholder-colorImage placeholder color.rgba(var(--gf-color-out-ctrl-dark-rgb), 0.4)
--gf-field-img-choice-no-card-check-ind-bg-colorChecked indicator background color.var(--gf-color-in-ctrl-primary)
--gf-field-img-choice-no-card-check-ind-icon-colorChecked indicator icon color.var(--gf-color-in-ctrl-primary-contrast)
Checked Indicator
--gf-field-img-choice-check-ind-iconIcon.var(--gf-icon-ctrl-checkbox)
--gf-field-img-choice-check-ind-radiusBorder radius.50%
--gf-field-img-choice-check-ind-shadowBox shadow.drop-shadow(0 1px 1px rgba(18, 25, 97, 0.15)) drop-shadow(0 2px 5px rgba(18, 25, 97, 0.1)) drop-shadow(0 0 0 rgba(18, 25, 97, 0.05))
--gf-field-img-choice-check-ind-size-smChecked indicator size for small image choice.24px
--gf-field-img-choice-check-ind-size-mdChecked indicator size for medium image choice.38px
--gf-field-img-choice-check-ind-size-lgChecked indicator size for large image choice.64px
--gf-field-img-choice-check-ind-sizeChecked indicator size.var(--gf-field-img-choice-check-ind-size-md)
--gf-field-img-choice-check-ind-icon-size-smIcon size for small image choice.12px
--gf-field-img-choice-check-ind-icon-size-mdIcon size for medium image choice.var(--gf-icon-font-size)
--gf-field-img-choice-check-ind-icon-size-lgIcon size for large image choice.30px
--gf-field-img-choice-check-ind-icon-sizeIcon size.var(--gf-field-img-choice-check-ind-icon-size-md)
Miscellaneous UI
--gf-field-img-choice-ctrl-opacityControl opacity.1
--gf-field-img-choice-ctrl-opacity-disabledControl opacity when disabled.0.5
--gf-field-img-choice-other-ctrl-margin-y-startVertical start (top) margin for other control.16px