Bemærk
Adgang til denne side kræver godkendelse. Du kan prøve at logge på eller ændre mapper.
Adgang til denne side kræver godkendelse. Du kan prøve at ændre mapper.
Use CSS to style your control add-ins so that they complement the Business Central experience. This article provides example colors, font families, and text sizes, followed by an HTML and CSS example with labeled inputs and a button.
Note
This guidance is for developers who build control add-ins. It doesn't change the appearance of the rest of the Business Central client. To help users distinguish companies and environments, learn more in Display a company badge.
Design for the Business Central experience
Control add-ins can display charts, maps, third-party controls, and content from other data sources alongside business data. They help users work with related information without switching to another application. To make that content fit the surrounding experience:
- Use familiar patterns for commands, navigation, and data presentation.
- Keep the focus on the content rather than decorative elements.
- Design content that adapts to the available space and supports mouse, touch, and keyboard input.
- Associate labels with inputs, use standard HTML controls, and provide visible keyboard focus.
- Use text or another visual indicator as well as color to communicate status.
- Keep users in control and make interactions predictable.
Style the HTML content of your control add-in with CSS. Use the StyleSheets property to include stylesheet files. Don't depend on the surrounding client's DOM structure, CSS classes, or internal theme tokens.
Learn more about implementation and sizing in Control add-in object.
Choose colors for add-in content
Consistent colors help create visual continuity. You can use color to communicate information, indicate interactivity, and provide feedback. Apply colors to an element's background, border, or text according to its purpose.
The following tables provide example colors for control add-in content. They aren't an exhaustive specification of the Business Central client. Rendered colors can vary by component, background, and interaction state.
Check contrast for each combination you use. For normal text, use a contrast ratio of at least 4.5:1 between the text and its background. Learn more in WCAG contrast guidance.
Example main colors
| Color | Name | Use | Hex value |
|---|---|---|---|
|
Primary | Prominent UI elements and areas. | #00B7C3 |
|
Secondary | UI elements and areas in a default or subdued state. | #505C6D |
Example status colors
These colors can help communicate status or draw attention to conditions and user activity. For example, color can help distinguish Cue values. A color's name doesn't guarantee sufficient contrast with every background. Use text or another indicator alongside color so that the meaning remains clear.
| Color | Name | Hex value |
|---|---|---|
|
Standard | #212121 |
|
Accent | #00B7C3 |
|
Strong | #212121 |
|
Favorable | #35AB22 |
|
Ambiguous | #9F9700 |
|
Unfavorable | #EB6965 |
|
Attention | #EB6965 |
|
Subordinate | #A7ADB6 |
Additional example colors
The following table provides more colors for your add-in's UI elements.
| Color | Name | Hex value |
|---|---|---|
|
Yellow | #C9C472 |
|
Green | #88CE81 |
|
Red | #E97768 |
|
Blue | #75B5E7 |
|
Light green | #59CCB4 |
|
Sky | #75D8E7 |
|
Egg | #EEEA86 |
|
Orange | #E89E63 |
|
Violet | #DBBDEB |
|
Teal | #39B294 |
|
Grass | #73BA5A |
|
Scarlet | #E65E6D |
Example chart colors
Use these example colors for chart series in your control add-in. They don't define the complete palette, order, or opacity used by every Business Central chart. Include labels or other indicators so that users don't have to rely on color alone.
| Color | Name | Hex value |
|---|---|---|
|
Secondary | #505C6D |
|
Dark teal | #008089 |
|
Primary | #00B7C3 |
|
Yellow | #C9C472 |
|
Red | #E97768 |
|
Blue | #75B5E7 |
|
Light green | #59CCB4 |
|
Sky | #75D8E7 |
|
Egg | #EEEA86 |
|
Violet | #DBBDEB |
|
Teal | #39B294 |
|
Grass | #73BA5A |
Apply colors with CSS
Use the following CSS properties to set colors:
| Property | Purpose |
|---|---|
color |
Sets the text color. |
background-color |
Sets the background color. |
border-color |
Sets the border color. A visible border also requires a border style and width. |
For example, the following rule pairs dark text with a white background:
.addin {
color: #212121;
background-color: #ffffff;
}
To use the Secondary color as a background, pair it with white text:
.my-ui-part {
color: #ffffff;
background-color: #505C6D;
}
You can also apply a palette color to a caption. The following example uses Primary text on a dark background. Check contrast again if you change either color.
.my-caption {
color: #00B7C3;
background-color: #212121;
}
Choose fonts and text sizes
Typography helps make text readable and communicate hierarchy. Use font families, weights, and sizes consistently for headings, captions, and messages.
Choose readable fonts and test them on the devices your users work with. Font availability varies by device. End each font-family list with a generic family such as sans-serif so that the browser can choose a fallback.
Example font families
The following font stacks are examples, not required settings for a control add-in. The browser uses the list order to select an available font.
| Example | Name | CSS font-family value |
|---|---|---|
|
Segoe UI | "Segoe UI", "Segoe WP", Segoe, device-segoe, Tahoma, Helvetica, Arial, sans-serif |
|
Segoe UI Light | "Segoe UI Light", "Segoe WP Light", device-segoe-light, "Segoe WP Semilight", "Segoe UI", "Segoe WP", Segoe, Tahoma, Helvetica, Arial, sans-serif |
|
Segoe UI Semilight | "Segoe UI Semilight", "Segoe WP Semilight", device-segoe-semilight, "Segoe UI", "Segoe WP", Segoe, Tahoma, Helvetica, Arial, sans-serif |
|
Segoe UI Semibold | "Segoe UI Semibold", "Segoe WP Semibold", device-segoe-semibold, "Segoe UI", "Segoe WP", Segoe, Tahoma, Helvetica, Arial, sans-serif |
Keep the listed font order when using one of these stacks. Removing or reordering fonts changes which available font the browser selects.
Learn more about fallback selection in the CSS font-family reference.
Example font sizes
The following table shows example text sizes. The names are descriptive labels, not public CSS variables or a complete client-wide size scale. The same font family can appear at different sizes on different clients.
| Example | Name | Value |
|---|---|---|
|
Largest plus | 37.5pt |
|
Largest | 30pt |
|
Large plus | 22.5pt |
|
Large | 18pt |
|
Medium plus | 15pt |
|
Medium | 13.5pt |
|
Small plus | 12pt |
|
Small | 10.5pt |
|
Smallest | 9pt |
Use relative units such as rem or em for your add-in's text sizes. Test the result with enlarged text and browser zoom. Learn more in the CSS font-size reference.
Apply fonts with CSS
Set font-family and font-size on your add-in content. For example:
.addin {
font-family: "Segoe UI", Arial, sans-serif;
font-size: 1rem;
line-height: 1.5;
}
To use the Segoe UI Light stack and the Small size from the tables, specify both properties:
.my-ui-part {
font-family: "Segoe UI Light", "Segoe WP Light", device-segoe-light, "Segoe WP Semilight", "Segoe UI", "Segoe WP", Segoe, Tahoma, Helvetica, Arial, sans-serif;
font-size: 10.5pt;
}
This example shows how the table values map to CSS. For your add-in's layout, prefer relative text sizes and test readability on the target devices.
Example: Style labeled inputs and a button
The following example styles only the content of a control add-in. Its colors, font stack, and sizes are illustrative choices, not a specification of the Business Central client.
The HTML uses a label for each input and a standard button. This example shows styling only. The button doesn't submit data or call AL.
<div class="addin">
<div class="control">
<label for="given-name">First name</label>
<input id="given-name" name="givenName" type="text" autocomplete="given-name">
</div>
<div class="control">
<label for="family-name">Last name</label>
<input id="family-name" name="familyName" type="text" autocomplete="family-name">
</div>
<button type="button">Submit</button>
</div>
The CSS provides readable text, spacing, and a visible focus outline. The form controls inherit the add-in's font settings.
.addin {
padding: 1rem;
color: #212121;
background-color: #ffffff;
font-family: "Segoe UI", Arial, sans-serif;
font-size: 1rem;
line-height: 1.5;
}
.addin .control {
margin-bottom: 1rem;
}
.addin label {
display: block;
margin-bottom: 0.25rem;
}
.addin input {
box-sizing: border-box;
width: 100%;
padding: 0.5rem;
border: 1px solid #616161;
color: inherit;
background-color: #ffffff;
font: inherit;
}
.addin button {
padding: 0.5rem 1rem;
border: 1px solid #006f78;
color: #ffffff;
background-color: #006f78;
font: inherit;
cursor: pointer;
}
.addin input:focus-visible,
.addin button:focus-visible {
outline: 2px solid #212121;
outline-offset: 2px;
}
Before publishing your add-in, test keyboard navigation, screen reader labels, text contrast, forced-color modes, and layout at different sizes and zoom levels.
Related information
Control add-in object
StyleSheets property
Control add-in performance best practices
Labeling form controls