Modifying survey form look and feel
Examples of how to modify the look and feel of surveys using the Digital survey form 2.0, based on our predefined CSS Variables and Classes.
Primary color
Digital survey form 2.0 makes it easier to maintain your stylesheet by allowing you to define a primary color once, and then reusing it across your CSS instead of using specific color definitions.
To set up a primary color, add this snippet to the top of your custom CSS file:
The --palette-core-primary
predefined variable configures these styles:
- the selected component state background color for group components such as checkbox or radio button
- the selected component state, for the background color of the element
- hover or focus component state, for the border of the highlighted element
Setting the the primary color using --palette-core-primary
configures the default value for these variables:
--palette-action-hover
is the box-shadow color upon focus or hover of an element--palette-action-active
is the box-shadow color upon active--palette-group-mark-background
is the color for a activated checkbox--palette-rating-number-hover
is the fill and box-shadow colors in rating components (except emoticons and stars) upon focus or hover--palette-rating-number-selected
is the background-color of selected rating components (except emoticons and stars)
Fonts and typography
Any custom text and fonts are grouped under the “Typography” family of variables.
To use your own custom font for the form:
Use fonts already loaded by a website:
You must make sure that your CORS policy allows font-src from a Medallia domain. See Allow-list guidance.
For example, compare the title of these text boxes:
Using default font (Open sans)
Using custom font (Roboto)
Modifying the component label size
You can modify these properties of the components label’s font.
Example:
Modifying spacing between questions
Modifying survey radio button and checkbox colors
The new survey form offers these controls to modify the checked and unchecked states:
- Inner mark: the color of the inner circle or tick "✓" element.
- Background: the color of the checked state
You can also reuse the primary color by using:
Modifying Rating Scales
Digital Form 2.0 supports these modifications to the rating scales by defining your own custom CSS class (see above) and making these modifications. You can change the HEX color code as required:
For 1-5 Components
For all other rating components
Modifying survey buttons
You can modify the submit and close buttons:
Submit button:
Close button:
To hide the close button use:
To change the button alignment:
To modify all footer buttons override the surveyBtn
class.
Modifying the close(“X”) button
To modify the “X” button:
Make a specific question bold
To make a specific question bold, add a custom CSS class from the Digital Command Center (as described above) and use:
Modifying the color of error message text
To modify the color of an error message use these definition in your custom CSS file:
Modifying the non-numeric scale questions
Survey Form 2.0 offers “Stars” and “Faces” non-numeric rating scales.To modify the background color of the hover or selected state of non-numeric rating questions override these definitions:
Modifying the width of 1 to 5 rating scales
To modify the width of the 1 to 5 rating component, for example to spread it across the entire width of the form:
Modifying the numeric rating scales labels
To modify the numeric rating scales labels, override the “ratingMinLabel” and “ratingMaxLabel” classes:
Modifying survey size on Mobile Web
To modify the form dimensions in mobile web use these class to override the survey size:
Note: Overriding the mobile form dimensions could impact the survey's responsiveness on mobile web devices.
Modifying the scrollbar (Web and Mobile)
To hide the scrollbar add this:
To modify the style, for example color and size:
Modifying the NPS slider color in Digital In-App only
To modify the NPS slider color in the mobile app, override these class:
Language specific customizations
:root
with [lang="<language code>"]
. Use IETF language tags as described in defining languages. The language that is chosen depends on the browser's locale settings. For example:
This changes the rating styling for French language forms. Such changes can be made for multiple language within the same CSS file.
It is important to place these changes after the definitions made in the :root
section. For example:
Hiding the Powered by Medallia logo
To hide the Powered by Medallia logo from the footer:
Customize the Thank you page
The Thank you page image and button can be customized using these variables:
- thank-you-page-button-position aligns the close button to a position. Possible values: Left, Right, center, start, end, flex-start, flex-end.
- thank-you-page-image-position aligns the image to a position. Possible values: Left, Right, center, start, end, flex-start
- thank-you-page-button-visibility displays the close button. Possible values: none, flex, grid, block, inline-grid, inline-block, inline-flex
- thank-you-page-image-spacing configures spacing in pixels around image. Example values: 100px
- thank-you-page-text-spacing configures spacing in pixels between text and image. Example values: 150px 0 150px 0
When configuring the spacing, using pixel (px) values lower than 50 could result in the image or button not being displayed and is not supported.