Skip to main content
Every question component supported by humanize has edsl-* CSS classes so you can customise the survey appearance.

Applying custom CSS

When creating a human survey

Pass your CSS string in the humanize_schema under survey.custom_css.
Pass "survey": {"custom_css": None} (or omit custom_css) to create the survey without any custom CSS.

Updating CSS on an existing human survey

Use Coop.patch_human_survey_css to set or clear the CSS on a human survey that already exists.

Survey-level classes

Progress indicator

The progress indicator sits above the question. Depending on how the survey is configured, it shows as a bar or as a row of step markers. A survey can also hide it, in which case nothing is rendered and there is nothing to style. Both renderings put edsl-progress on their outer element. Use that class for rules that should apply whichever one a survey uses.

Bar

Recolor the fill, don’t resize it. The fill is always as wide as the whole track, and it slides sideways to reveal only the finished portion. Setting width on it will not shorten it. Set background, border-radius, or transition instead.

Steps

Each step is one <li> holding a marker, half of the connecting line on either side of it, and an optional label below.
Style markers and labels through their step. Every <li> says whether its step is complete, current, or upcoming, so those classes are how you give the current marker a different look from the finished ones. Style the line through its own classes. Each half carries its own filled or unfilled class, which does not match the status of the step it belongs to. The half arriving at the current step is filled as soon as the step before it is done, so the current step normally holds one filled half and one empty one. Select the filled line with .edsl-progress-connector-complete. Reaching for .edsl-progress-step-complete .edsl-progress-connector instead leaves that first half gray, and the line stops short of where the respondent actually is.
To reach a single segment, combine a step class with a connector class. Include the position class as well, since a step’s two halves are otherwise identical. The rule below picks out the filled half arriving at the step the respondent is on, and gives it a gradient so the line brightens as it reaches them:
Finally, markers come in two shapes: numbered circles and small dots. The survey’s configuration picks the shape, not your CSS. A rule that assumes a size, such as a fixed width, will look wrong under the other shape, so check the survey renders with the shape you expect.

Common question classes

These classes are present on every question regardless of type.

Question-specific HTML

Budget

Checkbox

EDSL object

File upload

Free text

Linear scale

When humanize format is radio (default):

Likert five

When humanize format is radio (default):

List

Matrix

Multiple choice

When humanize format is radio (default):

Multiple choice with other

Numerical

When humanize format is input (default):

Rank

Top K

Yes/no

When humanize format is radio (default):

Comment field

If a question has comment configured in the humanize schema, an additional comment input is rendered under that question.