Custom Layout & CSS
A basic introduction to this topic can be found in Benutzer-Dokumentation
As you know, under "Design > Layout" you can select a theme for the configurator:
Here, under
Custom Layout
Our layout for the “Standard-Right” theme, for example, looks like this:
<div style="
display:grid;
grid:
'header header header header' min-content
'top-left top-center top-right sidebar' 1fr
'mid-left mid-center mid-right sidebar' 1fr
'bot-left bot-center bot-right sidebar' 1fr
/ 1fr 1fr 1fr 400px;
height: 100%;"
>
<header style="gridArea: header;">
<Header/>
</header>
<section style="gridArea: 2 / 1 / span 3 / span 3">
<Content/>
</section>
<div style="gridArea: top-left; padding: 16px;">
<Logo/>
</div>
<div style="gridArea: top-right; justifySelf: end;">
<SceneButtons/>
</div>
<div style="gridArea: bot-right; padding: 16px; placeSelf: end; display: flex; flexDirection: row; zIndex: 1;">
<Price/>
<ExitButtons/>
</div>
<div style="gridArea: sidebar; overflow: auto; zIndex:1; box-shadow: 6px 0 4px -4px #999, -6px 0 4px -4px #999; height: calc(100vh - 38px - 64px ); display: grid; alignContent: space-between;">
<Sidebar design="topmenu"></Sidebar>
<footer style="position: sticky; bottom: 0; background: white">
<LabelActionsDisplay></LabelActionsDisplay>
<NavigationButtons></NavigationButtons>
</footer>
</div>
</div>
Here, you can make any HTML-compliant adjustments.
We provide the actual application blocks in K3.
These are easy to use and offer responsive functionality:
- Header: This is our header element. All the configurator tabs are displayed here.
- Content: This is the configurator’s visualization. By default, depending on the configurator type, either an image-based 360-degree view or a 3D scene is displayed here.
- Sidebar: This is the configurator’s sidebar. The variables and their values (depending on the tab) are displayed here.
- SceneButtons: These include the AR button and, in the admin panel, the button for creating screenshot cameras.
- Price: The price based on the price calculation for the current state.
- ExitButtons: A group containing the defined actions for completing the configuration.
- Logo: The configurator’s logo
- NavigationButtons: “Back” and “Next” buttons for navigating between tabs.
- LabelActionsDisplay: The area where label actions (see configurator rules) are displayed.
Demo
<div class="oc">Hello from OC!</div>
This layout represents an extreme case and replaces the entire frontend content with a "Hello from OC".
The surrounding div is assigned the class "oc":
The admin panel remains visible and fully functional, of course.
This is ideal for using these class names in CSS:
.oc {
color: red;
}
General CSS
Under “Design > CSS,” you can upload or link to your own CSS file. This CSS can follow the structure below:
Shared Component Classes
Throughout the configurator, recurring components share their CSS classes.
For example, it’s possible to style all buttons in the configurator using the MuiButton-root class.
The best way to view the shared component classes is in the browser’s Developer Console.
Global Classes
In K3, there are global systems that are also classified in a structured manner:
- OrderDialog: Assigned OrderDialog classes.
- InfoSelectionDialog: Assigned InfoSelection classes.
- InvalidSelectionIcon: Assigned InvalidSelection classes.
Variables
Keys
- If developer mode is enabled in the profile, a variable can be assigned a key.
- If a variable has a key, it automatically has a surrounding
divelement with that key as its class name
Checked State
- All variables (provided that multiple selections are visible in the UI) have a class name that is assigned only to the selected element:
MuiChecked. - Variables with dropdown functionality have a marker for the currently active element in the dropdown via the
aria-label=trueattribute.
Navigation Arrows in the Header
With <GroupsNavigation arrows="true" /> in the layout, the step navigation displays page arrows instead of a scrollbar.
You can control the appearance using these CSS variables:
--k3-nav-arrow-color--k3-nav-arrow-size--k3-nav-arrow-background--k3-nav-arrow-background-hover--k3-nav-arrow-hover-opacity--k3-nav-arrow-padding
Groups
- If developer mode is enabled in the profile, a group can be assigned a "key."
- If a group has a key, that key is added to the 'configurator' when that group is active.
It is generally recommended to select elements in CSS using the configurator class, otherwise the admin panel will also be styled.