Skip to main content

User-interface styling

This document describes how to customize end-user user-interfaces using CSS stylesheets. Instructions provided apply to version 6 of Trivore ID. Customizing management user-interface (/ui/*) is not supported.

Trivore ID user-interface uses Vaadin library version 25. Vaadin provides styling guide which is available at https://vaadin.com/docs/latest/styling.

Here are some direct links to most common components that Trivore ID uses.

Managing stylesheets

Stylesheets can be managed by navigating to System preferences -> Branding -> Web styling. You can also select default stylesheet which is applied to every end-user user-interface when no other selection is made. OpenID clients may choose to use different stylesheets.

Image

Click "Manage styles" button to open dialog where styles are managed. Click "Add" button to add new stylesheet.

Image

Recommendation is to click "Replace editor content with default stylesheet" button and then customize that default stylesheet.

List of user-interfaces

Default stylesheet is applied to following end-user user-interfaces.

User-interfaceDescription
/acceptAccept user invite view.
/rp/suomi.fi-valtuudet/authoriseSuomi.fi authorisation to act on behalf of user (henkilön puolesta-asiointi)
/rp/suomi.fi-valtuudet/authorise/companySuomi.fi authorisation to act on behalf of company (yrityksen puolesta-asiointi).
/verifyemailVerify email address.
/verifysmsVerify mobile number.
/bootstrapService bootstrap (not relevant here).
/changePasswordChange password.
/ldapAuthLDAP user directory authentication.
/openid/logout-uiOpenID sign-out.
/openid/auth-uiOpenID sign-in and registration. Different clients may choose to use different stylesheets, not just the default one.
/personaldataView personal data requests.
/resetPasswordReset password.
/smartCardAuthSmartcard authentication.

List of CSS class names

This section describes CSS class names that can be used to customize parts of the user-interface.

Common CSS classes

Following table describes common CSS class names that are used in most user-interfaces.

CSS classDescription
.ui-rootOuter-most <div> element. All other elements are inside this.
.heading-labelGeneral heading element. Applied to <h1> and <h2> elements.
.info-labelGeneral info element. Applied to <span> elements.
.service-logoService (system-wide) logo <img> element.
.main-contentMain content which is usually <vaadin-vertical-layout> element. Logo images, main panel and language selection are usually inside this. Centered by default and max-width of 700px.
.main-panelMain panel <div> which contains input elements and buttons and has borders by default.
.layout-commonCommon layout usually placed inside .ui-root element.
.language-selectLanguage select <vaadin-select> element available in most views. Label is hidden by default.
.button-mainMain button <vaadin-button> elements such as "Cancel" or "Confirm". Full width by default.
.button-auxAuxiliary button <vaadin-button> element which does NOT define full width by default.
.button-linkButton <vaadin-button> element that looks like link, does not have background or border by default.
.link-commonCommon link <a> element.
.error-labelCommon error label <div> element.
.success-labelCommon success label <div> element.
.field-labelUsed on non-editable fields that only show text, not any input field.
.field-mainUsed on all editable input elements such as <vaadin-text-field> or <vaadin-checkbox>.
.user-wrapperWrapper element to choose user. Used on <vaadin-vertical-layout>elements.
.user-selectorUser selector inside .user-wrapper. Applied to <vaadin-horizontal-layout>.

OpenID login CSS classes

Following table describes CSS class names that are used in OpenID login view (/openid/auth-ui).

CSS classDescription
.loginOuter-most <div> element.
.login-baseLogin base layout inside .login element, applied to <vaadin-vertical-layout>.
.login-logosLogo layout <div> which shows different logo images.
.login-verify-commLayout which shows elements to verify communication method such as email or mobile number. Applied to <vaadin-vertical-layout>.
.login-verify-comm-linkLayout which shows elements to send communication method (email, mobile) verification link. Applied to <vaadin-vertical-layout>.
.login-confirmApplied to <vaadin-vertical-layout> view that confirms OpenID client access.
.login-errorOpenID login error layout. Applied to <vaadin-vertical-layout>.
.login-enter-credentialsOpenID login enter credentials layout. Applied to <vaadin-vertical-layout>.
.login-user-selectOpenID layout to select user to login as. Applied to <vaadin-vertical-layout>.
.login-return-buttonReturn button shown in email/mobile verification layout.
.login-user-photoUser photo <img> shown when confirming OpenID client access.
.login-user-infoLayout <vaadin-horizontal-layout> which shows user information and user photo when confirming OpenID client access.
.login-dividerDivider <hr> element used in OpenID login views.
.login-app-nameApplication (OpenID client) name <h2> element.
.login-app-devApplication (OpenID client) developer information. Applied to <span> element which shows client owner's namespace name.
.login-app-urlLink <a> which shows application (OpenID client) homepage URL.
.login-app-policy-urlLink <a> which shows application (OpenID client) policy URL.
.login-app-tos-linkLink <a> which shows application (OpenID client) terms of service URL.
.login-scope-detailsField <vaadin-custom-field> which shows information about OpenID scope (information and permissions the client is requesting).
.login-headerLogin header which shows information where user is logging in. Uses <vaadin-custom-field>.
.login-ext-login-layoutExternal login layout <vaadin-vertical-layout> in OpenID login view.
.login-ext-login-contentLayout <vaadin-vertical-layout> inside .login-ext-login-layout which holds external login buttons or other components to initiate external login via user directory.
.login-ext-login-buttonButton <vaadin-button> to initiate external login.
.login-ext-login-linkLink <a> to initiate external login.
.login-ext-login-iconExternal login icon used with buttons, links or combo box.
.login-ext-login-selectExternal login <vaadin-select> component.
.login-ext-login-comboboxExternal login <vaadin-combo-box> component.

OpenID logout CSS classes

Following table describes CSS class names that are used in OpenID logout view (/openid/logout-ui).

CSS classDescription
.logoutOuter-most <div> element.
.logout-contentLayout <vaadin-vertical-layout> inside .logout element.
.logout-formLayout <vaadin-vertical-layout> inside .logout-content which contains buttons and information text about logout.

Reset password CSS classes

Following table describes CSS class names that are used in reset password view (/resetPassword).

CSS classDescription
.reset-passwordOuter-most <div> element.
.reset-password-baseBase layout <vaadin-vertical-layout> inside .reset-password.
.reset-password-startStart layout <vaadin-vertical-layout> where user enters information.
.reset-password-invalid-linkLayout <vaadin-vertical-layout> which shows information about invalid reset password link.
.reset-password-email-sentLayout <vaadin-vertical-layout> which shows information that reset password email was sent.
.reset-password-name-checkLayout <vaadin-vertical-layout> which asks user to enter their name for checking purposes.
.reset-password-new-passwordLayout <vaadin-vertical-layout> where user enters new password.
.reset-password-changed-infoLayout <vaadin-vertical-layout> which shows information that password was changed.
.reset-password-verify-codeLayout <vaadin-vertical-layout> which asks user to enter code that was sent via email or sms.

Change password CSS classes

Following table describes CSS class names that are used in change password view (/changePassword).

CSS classDescription
.change-passwordOuter-most <div> element.
.change-password-baseBase layout <vaadin-vertical-layout> inside .change-password.
.change-password-errorLayout <vaadin-vertical-layout> which shows error information.
.change-password-loginLayout <vaadin-vertical-layout> where user enters login credentials.
.change-password-new-passwordLayout <vaadin-vertical-layout> where user enters new password.
.change-password-successLayout <vaadin-vertical-layout> which shows information about successful password change.

Smartcard authentication CSS classes

Following table describes CSS class names that are used in smartcard authentication view (/smartCardAuth).

CSS classDescription
.smartcardOuter-most <div> element.
.smartcard-baseBase layout <vaadin-vertical-layout> inside .smartcard.
.smartcard-errorLayout <vaadin-vertical-layout> which shows error information.
.smartcard-loginLayout <vaadin-vertical-layout> which asks user to perform smartcard authentication.

Examples

This section provides some examples how to style different components.

Change border-radius for all buttons:

vaadin-button {
border-radius: 30px;
}

Change font-family for all text field input elements.

vaadin-text-field > input {
font-family: monospace;
}

Change background-color for all primary buttons (blue by default).

.ui-root {
--vaadin-button-primary-background: green;
}

Change text color for all buttons.

vaadin-button::part(label) {
color: black;
}

Change width for logout button.

.logout .button-aux {
width: 100%;
}

Center all logos in login page.

.login-logos {
width: 100%;
justify-content: center;
}

Migrating from Trivore ID version 5 to 6

Trivore ID version 5 uses Vaadin 8 and version 6 uses Vaadin 25. There are significant changes between these Vaadin versions and there is no automatic migration available for CSS stylesheets.

Html rendering, CSS class names and shadow DOM usage have all changed between Vaadin 8 and 25 and therefore any migration of existing stylesheet requires manual work, sometimes a lot.

For example, Vaadin 8 uses CSS class names such as .v-button and .v-text-field (and other names using .v- prefix). When migrating existing stylesheet, replace these CSS class names with element names such as vaadin-button and vaadin-text-field. This gets you started but note that shadow DOM usage probably breaks your existing stylesheet because with Vaadin 25 you often need to use ::part() selectors.