Polls, surveys & forms
Style your poll with custom CSS
The class names of the poll page and its questions, and CSS examples that change how they look.
Last updatedWhen colors, a font and a logo are not enough, a theme can include its own CSS. It applies to the poll page and the results page of every poll that uses the theme, and to the previews in the editor. Custom CSS is included in the Business plan. See Plans and credits.
Where to add it
- For one poll: open the poll’s Design tab and write your CSS under Custom CSS. Save the design as a theme to keep it.
- In a theme: under Themes, open a theme and fill in Custom CSS. It applies to every poll that uses the theme.
- For your brand: on the Brand page, the CSS becomes part of your brand’s look.
The CSS can be up to 20,000 characters long. It cannot load other stylesheets, so @import lines are removed, and it cannot contain the < character.
Write selectors that take precedence
The page styles its parts with the same class names you use, so a rule with a single class is often overridden by the page’s own rules. Put .vote-theme in front of your selectors: it contains the whole poll, on the poll page, the results page and in the previews, and your CSS takes precedence over the page’s styles when both are equally specific.
/* Too weak: the page keeps its own rounded corners. */
.choice {
border-radius: 0;
}
/* Works: */
.vote-theme .choice {
border-radius: 0;
}If a rule still does not apply, for example on :hover, add another class, such as .vote-theme .vote-step .choice:hover.
The page
| Class | What it is |
|---|---|
.vote-theme | Everything the theme styles. On the poll page also .vote-root. |
.vote-root.embed | The poll when it is embedded on another website. |
.vote-main | The area that holds the poll, below the progress bar. |
.vote-card | The poll itself, as wide as its content allows. |
.vote-card-design | The card, when the theme shows the poll in a card. |
.vote-logo | The theme’s logo above the poll. |
.vote-header | The poll’s title and description. |
.form-title | The poll’s title, an h1. |
.form-description | The text under the poll’s title. |
.deadline | The line saying when the poll closes. |
.progress | The progress bar at the top, with .progress-fill for its filled part. |
.vote-form | The form with all questions and buttons. |
.vote-page | The questions of the page being shown. |
.page-heading | The title of a page in a poll with several pages. |
.vote-actions | The row with the submit, next and back buttons. |
.btn-primary | The main button, like Submit or Next. |
.btn-ghost | The plainer buttons, like Back or View results. |
.notice | Notes to the voter, like a restored response. |
.form-error | An error message for the whole form. |
.status | The end screen after voting, with .responded-title as its title. |
.vote-footer | The line at the bottom of the page. |
Questions
Each question is a section with the class .vote-step. It gets a data-invalid attribute while it shows an error.
| Class | What it is |
|---|---|
.vote-step | One question with its title, description and answers. |
.step-head | The row with the question’s title. |
.step-title | The question’s title, an h2 (an h1 when the poll has no title). |
.required | The * after the title of a required question. |
.optional | The Optional label next to a question’s title. |
.step-description | The text under the question’s title. |
.step-error | The error message under a question. |
Answers
| Class | What it is |
|---|---|
.choice | One option of a multiple choice or image question. |
.choice.checked | An option the voter picked. |
.choice.disabled | An option that can’t be picked, like a full one. |
.choice .mark | The round or square box in front of an option. |
.choice .label | The option’s text, with .description under it. |
.choice .media | The image of an option in an image question. |
.choice .percent | An option’s share of the votes, when results show while voting. |
.dropdown-select | The box around a dropdown question’s list. |
.text-answer | The field of a text, number, email or date question. |
.stars, .star | A star rating and each of its stars. |
.numbers, .number | A number scale and each of its numbers, .checked when picked. |
.yes-no, .tile | A yes or no question and its two tiles, .tile-yes and .tile-no. |
.ranking | A ranking question’s list of options. |
.matrix | A matrix question’s table, with .matrix-row and .matrix-cell. |
The results page
| Class | What it is |
|---|---|
.results | The results of all questions. |
.bars | The bars of one question. |
.bar-name | An option’s name. |
.bar-track | The bar’s background, with .bar-fill inside. |
.bar-value | An option’s votes and share. |
Change the colors everywhere
The page takes its colors from a few CSS variables. Setting them changes everything that uses them at once, such as borders, hover states and selected options:
.vote-theme,
.vote-theme .vote-card-design {
--vote-accent: #0f766e; /* selected options, focus rings, links */
--vote-button: #0f766e; /* the main button */
--vote-button-text: #ffffff;
--vote-border: #d6d3d1; /* borders of options and fields */
--vote-surface: #fafaf9; /* the background of options and fields */
}--vote-bg and --vote-text are the page’s background and text color, --vote-muted the color of lighter text. For most colors, it is simpler to set them in the theme itself.
Examples
Square options with a thicker border when selected:
.vote-theme .choice {
border-radius: 0;
}
.vote-theme .choice.checked {
border-width: 3px;
}A larger poll title in capitals:
.vote-theme .form-title {
font-size: 2.5rem;
text-transform: uppercase;
letter-spacing: 0.05em;
}A line between questions:
.vote-theme .vote-step + .vote-step {
padding-top: 1.5rem;
border-top: 1px solid var(--vote-border);
}A pill-shaped button across the whole width:
.vote-theme .vote-actions .btn-primary {
width: 100%;
border-radius: 999px;
}A wider poll:
.vote-theme .vote-card {
max-width: 52rem;
}No logo when the poll is embedded on your website:
.vote-root.embed .vote-logo {
display: none;
}Hide the description under the poll’s title:
.vote-theme .form-description {
display: none;
}Style only the second question:
.vote-theme .vote-step:nth-of-type(2) .step-title {
color: var(--vote-accent);
}Please note
- The previews: the questions and their answers look the same in the Design tab as on the poll page. The parts around them, such as the poll’s title, are rendered differently there, so check them on the poll page itself.
- Dark mode: with a theme in Auto mode, the page follows each visitor’s light or dark mode. To style dark mode only, start a selector with
.dark, for example.dark .vote-theme .choice. - Class names only: other class names on the page, such as
svelte-…and short ones likeflexortext-sm, can change at any time. Use the ones listed here. - Shared themes: a theme shared with a workspace keeps its CSS. It applies when the poll’s plan includes custom CSS.