Styles
Styles help you create and scale user-facing screens while adhering to your brand's guidelines. You can add your brand's logo, colors, and other design elements in a central location within the Descope Console. Any screens you create with the Screen Builder will take on the brand elements from your pre-defined styles.
We offer the option to customize your user experience through the styles page. Those options consist of varying properties as the logo of your company, the fonts that the components will inherit, and much more.
You are also able to customize your users' experience with custom fonts and self-defined CSS styling configurations. This doc will show you the basics of how to use Descope's gui/code mode on the styling page.
Creating and Managing Styles
To manage styles:
- Navigate to the Styles tab in your Descope Console.
- Click the dropdown and select
+ New styles file
to create a new style.
Creating a New Style
- Give your style a unique name—this automatically generates a corresponding Style ID.
- Click
Add
to create the new style in your project.
You can now customize the style using the GUI or Code Mode, adjusting any UI component's appearance.
Based on your primary and secondary color selections, Descope automatically generates a full color palette.
Deleting a Style
If a style is no longer needed, simply delete it using the delete icon next to the file.
Styles Per Application
If you want to customize the styling for the same flow based on the application rendering the flow, you can do that one of two ways:
Using the Descope SDKs
Please refer to our Descope SDK documentation for more details on other frameworks.
You can pass the styleId
parameter into the component like this:
This allows you to use a single flow across multiple branded applications, with a custom style in each.
If you're using Auth Hosting
This is typically done for customers using Descope as a federated identity provider across multiple Federated Apps.
Append the style
parameter to your Flow Hosting URL from the Application Configuration page:
GUI Mode
Descope has Styles divided into two tabs. Theme tab provides global styling option that affect the overall screens and individual components. With the Components tab, you can configure each component in detail.
Styling Themes
Under the Theme tab, we have three sections that we can customize according to our brand. Each of these sections are available for both Light and Dark themes.
Logo
You can upload your company's logo under this field with a simple drag and drop. Same goes for the dark theme option as well.
Colors
In this section, you can select your brand colors to match brand consistency. You have options of designing Primary, Secondary, Greys, Success and Error.
When you select a primary color for example, Descope will create the rest of the palette for you.
Typography
In this section, you can choose font families for all the text related components. You have a list of fonts available from the dropdown. Additionally, all the way at the top of the dropdown, Descope provides an option to add a custom font.
Each of the different sections like Headings, Subtitles, Body can be customized with different font, size and weight.
Custom Font
Each font family allows one custom font setting. To configure a custom font, click the + Add Font
from the font dropdown, then provide a family name and a url to the hosted font file. Descope also allows editing the custom font after its been initially set.
Styling Components
Under the Components tab, you can set the buttons according to your branding in more detail. Every button/component has an editable action provided on the right side.
You can configure options for Font Family, Border Radius, Border Width, Text/Background color etc for your primary or secondary buttons. It also gives you a choice to add custom configurations.
For OAuth buttons, you can customize each button by provider name. Example: Here for provider Apple, you can customize the button accordingly or just leave it to default.
Once all the changes are made, you can click Apply and view your changes in preview mode by clicking the Preview button.
Code Mode
Enable code mode editor with a toggle button. Clicking the button will switch the styles page to code mode:
The styles page should look like this:
Note
Styles between light and dark theme will not persist, meaning each theme holds different values.
Best Practices
Most of the fields inside code mode are self explained by name, and can be tested right away in the flow builder. Some best practices and odd features are documented here:
Components
- Badge: Is the styling of the component of the options you get inside a multi-select field:
- Logo: Contains the values of the URL's for the company logo that will be used, including the fallback URL:
- TOTP Image: Holds the placeholder image for TOTP button
- Required Attribute: If a component supports using the required boolean, the
_required
attribute will appear in code mode, stating which component will it use to indicate it:
- Notification Card: can alter the style of the notification toast you and other Descopers will get, also how different types of modes will be displayed, such as errors and success messages for actions performed in Descope:
- Special Attributes: Some components hold styling states for states of the components. Altering the attributes listed below will change how the component will look in different states:
Globals
- Direction: Possible inputs:
ltr
/rtl
- a global variable that will determine if your components will be Right To Left or Left To Right. - Fonts: You can add a url to both 'font1' and font2' to use a custom font, make sure you create a label that you will remember.
- Typography: You can determine what component types will take which font.
Exporting and Importing Theme from Console
Once you have defined your styles, you can export or import the styles using the up and down arrows at the top right of the styles page. This feature allows you to backup your current styles, or migrate them between your projects.
Exporting and Importing Styles from the Management SDK
The Descope SDK allows you to import and export themes.
Install SDK
Import and initialize Management SDK
Export Theme
Use the code below to export a theme:
Import Theme
Use the code below to import a theme: