Style your form

A form embedded on your website takes your site's text colour, a plain system font, and the button colours and corners from your brand (Settings → Brand). The form's own Appearance settings in the CRM come on top. To go further, style it from your own site's CSS: every part of the form has a fixed class, and the look is built from CSS variables you can set.

Your CSS always wins over the form's defaults. The form's built-in rules have zero specificity, so a plain .cf-button { … } in your stylesheet replaces them without any special tricks.

Which setting wins

From weakest to strongest:

  1. The form's defaults.
  2. The brand and the form's Appearance settings in the CRM.
  3. Your site's CSS.
  4. Settings on the embed's <script> tag (below).

CSS variables

Set them on .cf-root (every form) or #codefab-signup-<form id> (one form).

VariableWhat it setsDefault
--cf-fontFont familyThe visitor's system font (data-font="inherit" for your site's)
--cf-font-sizeText and input size14px
--cf-textText colourYour site's text colour
--cf-labelLabels and headingsSame as the text
--cf-mutedHints and help textThe text colour, a little lighter
--cf-bgBackground behind the formtransparent
--cf-input-bgInput background#fff
--cf-input-borderInput border#ccc
--cf-radiusCorners of inputs and the buttonFrom your brand
--cf-accentTicked boxes, chosen scores, focus ring, the thank-you check markYour brand's button colour
--cf-button-bgButton backgroundYour brand's button colour
--cf-button-textButton textYour brand's button text colour
--cf-errorError messages and required marks#e03131
--cf-gapSpace between fields10px
--cf-max-widthWidest the form gets420px
--cf-paddingSpace inside the form's edge0

Classes

ClassPart
.cf-rootThe box the form sits in
.cf-formThe form
.cf-bannerThe banner image
.cf-headingThe headline
.cf-textA text block
.cf-fieldA contact field with its label (data-field holds the field's key)
.cf-questionA survey question (data-question holds its key, data-type its type)
.cf-labelA field's or question's label
.cf-hintHelp text and "Choose 1–2." under a label
.cf-input, .cf-textareaText inputs, lists and text areas
.cf-choiceOne option of a choice, yes/no or score
.cf-scaleThe row of scores of a rating or NPS question
.cf-consentThe consent checkbox and its text
.cf-buttonThe send button
.cf-errorAn error message
.cf-successThe thank-you message after sending
.cf-closedThe message of a switched-off form

Settings on the script tag

Add these to the embed's <script> tag. Each one is optional, and a value that isn't a plain colour, size or font name is ignored.

AttributeWhat it does
data-theme="dark"Light text and dark inputs for a dark page. auto follows the visitor's device; light is the default. The CAPTCHA check follows it.
data-accent="#0b7285"Accent and button colour
data-font="inherit"Your site's font instead of the form's own. A font name also works.
data-max-width="600px"Widest the form gets (none for the full width)
data-unstyledLeaves out the form's own look completely, for a site that styles every part itself
data-prefill-<key>="…"Fills in a field or answers a question in advance (below)

Filling in answers in advance

data-prefill-<key> on the script tag, or ?cf_<key>= in the page's address, puts a value in the field or question with that key. The address wins when both are set. The keys are the contact fields' keys (email, first_name) and the questions' key, as the API returns them (GET /api/v1/signup-forms/{id}).

<script src="https://crm.codefab.dev/public/signup/{id}/embed.js" async
data-prefill-email="anna@example.com" data-prefill-shop="Web"></script>

A value is only used when it fits: one of the options of a choice (ignoring upper and lower case), several options separated by commas for a multiple choice, a score in range, yes or no for a yes/no question, a real date for a date. Anything else, and any key the form doesn't have, is left out. Prefilled values are only suggestions: the visitor can change them before sending.

Example: match your site's colours

HTML
<style>
.cf-root {
--cf-font: "Inter", sans-serif;
--cf-accent: #0b7285;
--cf-button-bg: #0b7285;
--cf-radius: 2px;
--cf-max-width: 520px;
}
.cf-button {
text-transform: uppercase;
letter-spacing: 0.04em;
padding: 12px 28px;
}
.cf-label {
font-weight: 500;
}
</style>
<script src="https://crm.codefab.dev/public/signup/{id}/embed.js" async></script>

Example: a dark section of your site

HTML
<section style="background: #111827; padding: 32px">
<script src="https://crm.codefab.dev/public/signup/{id}/embed.js" async
data-theme="dark" data-accent="#f59e0b"></script>
</section>
<style>
.cf-root {
--cf-input-bg: #1f2937;
--cf-input-border: #374151;
--cf-button-text: #111827;
}
</style>

On the form's own page (the /public/f/… link) the form wears your whole brand: its font, colours and button. The same variables apply there, through the form's Appearance settings in the CRM.