Design System Studio¶
Warning
API version 1 components cannot be styled by configuring a design system in the Design System Studio, they must be styled using themes.
Visual styles for pages in Skuid’s v2 API are handled via design systems, which are edited in the Design System Studio (DSS) workspace.
A design system is a file containing the variables and style variants that compose overarching style rules for all visual elements. The DSS is accessed by configuring an individual design system, so the first step to styling an application is to create a design system that will contain the app’s custom style rules.
You can access your Skuid instance’s design systems by clicking Design systems in the top navigation bar.
From the Design Systems screen¶
Access the following options on the Design Systems screen.
Create a design system [[]]¶
Click Create to create a new design system. The dialog box lets you create either a Design System or Themes.
- Select Create under For v2 pages
Customize the design system:
- Name: Give the design system a distinct name.
- Clone styles from: Select a design system to serve as the base for the new system.
Note
Skuid’s base design system, Ink, is selected by default.
- Click Create.
Import a design system [[]]¶
Click the
more options menu next to Create.Click Import.
The dialog box lets you upload a .sktheme file (for v1), a .designsystem file (for v2), or a zip file.
- Select Upload to search for and select the file.
Click Open.
The uploaded design system file displays in the list.
Set design system defaults [[]]¶
Click the
more options menu next to Create.Click Set Defaults, then customize:
- Default design system: Sets a previously-created design system as the default for all v2 pages. Select from the dropdown menu.
- Default theme: Sets a previously-created theme system as the default for all v1 pages. Select from the dropdown menu.
- Default composer theme: Sets the theme for the Composer, irrespective of API version. Select from the dropdown menu.
Click Save.
Set a specific design system as default [[]]¶
- In the more options menu on the design system you wish to designate as the default, click Set as default.
In the list, Skuid adds the default label to the design system.
Clone a design system [[]]¶
- In the more options menu on the design system you wish to clone, click Clone.
- Customize the design system with a distinct name.
Note
The name of the design system you are cloning from is indicated by default, appended with _Clone.
- Click Create.
Hide a design system [[]]¶
To make a design system inactive in the composer, so builders cannot select it:
- In the more options menu on the design system you wish to hide, click Hide in composer.
In the list, the design system is grayed out and tagged as hidden. When builders select a design system for a page, the hidden design system does not appear in the selectable dropdown.
Delete a design system [[]]¶
- In the more options menu next to the design system you with to delete, then click Delete.
- Click Yes, delete design system to confirm the deletion.
Design System Concepts¶
Design systems are made up of two elements: variables (saved values for design properties) and style variants (saved style configurations for individual components and subcomponents, which typically use variables for most of their properties).
Variables¶
When an app builder adds any component to their page in the Composer, the component uses a set of default Skuid styles—called variables.
Similar to CSS style rules, variables are global style declarations (separated by categories), based on the general purpose of the variable (Color, Typography, etc.). Variables are used, along with component-specific property configurations, to create component style variants.
Every component uses a different combination of variables depending on the component’s function and purpose, so not every variable will be used in a component.
Component styles are customized in the DSS to either:
- Change the default style variables
- Create new style variables
Once a variable is created, it can then be applied to a component style variant.
Style variants in components and subcomponents¶
Components are made up of components and subcomponents, and both are all listed under the Components header.
Selecting a component in the DSS will display all the configuration properties associated with the selected item. Most configuration properties require the use of variables as values, while some use property-specific values. If a component has any component dependencies, they will be listed under the Nested Components tab found in the properties pane.
Even if global variables have been configured, the unique properties of components require the creation of variables (and style variant) to use in the component. It’s normal for a workflow in the DSS to include a lot of interplay between variable creation and component configuration.
Note
To effectively style component elements—those components and subcomponents that comprise a specific component—go to the component/subcomponent’s own style variant.
Working in the Design System Studio¶
When you edit a design system, you’re in the Design System Studio. This workspace is made up of three primary areas:
- The left panel is for navigation. Here you select whether you want to view Variables or Components. After choosing a tab, this panel lists the categories of variables or the types of components/subcomponents available to edit. Selecting a variable or component/subcomponent here updates the center area.
- The center area displays the variables or style variants available to edit, reflecting whichever is selected in the left navigation pane. Clicking a variable or style variant will open its properties in the right panel.
- The right panel is for setting properties for the selected variable or style variant, similar to the Properties pane in the Composer.
Above these three areas are Save and Cancel, as well as
Undo and Redo.Note
The Design System Studio’s undo-redo history is stored in browser memory. Because of this, it does not have a defined limit, and it persists as long as you don’t navigate to a new page. It’s even possible to save your changes, and then undo them to a state before the save, as long as you do not refresh the page.
Variables¶
Add custom variables [[]]¶
In the design system, click the Variables tab.
Click the category to customize.
Click Add.
- Give the new variable a Name. See best practices for creating names for custom variables.
Configure the properties of the new variable.
- Make adjustments as desired.
Apply variables to style variants [[]]¶
Once a variable is created, it is available to be used on any categorically-related property in all style variants. Color variables may be used in color properties, spacing variables in space properties, etc. Click the variant, then click its properties and locate the one to configure. Click the dropdown list for that property to see the available variables.
For example:
- In the Components accordion, select Button.
- Select the Default style variant.
- In the properties pane, click the menu under General > Background color.
- Select your custom variable.
Style variants for components and subcomponents¶
Preview With…:¶
Some components have a property called Preview With, which provides the option to view a customized component with common configurations available within the Composer. This property is key to understanding how custom styles will apply to an app in runtime.
Create style variants within DSS components¶
There are three ways to create new style variants for component elements:
- create a net-new base variant
- clone a variant
- create a child variant
Once the new variant is created, you can name and configure it. Configure new style variants by choosing between component-specific property options listed in the property panel. In some cases, you can also pass in Variables.
Create a net-new style variant [[]]¶
All variants are based on the component element’s default variant, which is essentially a “base” variant. Creating a style variant establishes a new base variant that you, as a builder, can freely style and apply to Skuid pages.
To add a new Style variant that can be used in the Composer:
- Select the component you’d like to style.
- Click Add.
- Give the new Style Variant a Name.
- Configure.
Note
Newly created style variants can be cloned or have children.
Clone an existing style variant [[]]¶
Cloning a style variant makes a copy of the variant. This copy is a new base variant that starts with all the same property settings of the variant it was cloned from. The builder can then customize the newly cloned style variant.
While the cloned variant and the original variant (that it was cloned from) start as identical, they are _not linked_. Changes to the original _do not affect_ the clone, and changes to the clone _do not affect_ the original. They are independent of one another.
To clone a Style variant:
- Select the component you’d like to style.
- Within that component, select the style variant you want to clone from.
- From the more options menu, click Clone.
- Give the new Style Variant a Name.
- Configure.
Note
Cloned style variants can themselves be cloned or be used to create child variants..
Create a child variant from an existing style variant [[]]¶
Creating a child from another style variant creates a relationship between the two. The child inherits properties from the parent. This means that when a property changes in the parent, that change ripples through to the child variant.
The one exception to this inheritance rule is for properties in the child that have already been overwritten (customized) in the child style variant. Changes to those properties in the parent do not ripple through: the customization in the child supersedes any changes in the parent.
For properties that are inheriting from the parent, the value indicated in that property is - - Inherit - -.
The design system indicates child variants with an icon and a tool tip noting which variant the child is inheriting from. This icon and tooltip also display in the property pane.
To create a child variant:
- Select the component you’d like to style.
- Within that component, select the style variant you want to create a child from. .. warning:: This cannot be another child variant.
- From the more options menu, click Create Child.
- Give the new Style Variant a Name.
- Configure.
Warning
Child variants cannot be cloned or be used to create child variants.
Delete a style variant¶
- Select the style variant to delete.
- From the menu, click Remove.
Applying a Design System to a Skuid Page¶
Create a design system in the DSS.
Navigate to the Skuid page that contains the component you want to style.
Click on the Page header in the canvas.
In the Properties pane, under Design system:
- Select the name of the desired design system from the dropdown.
Warning
Selecting your design system on Page Properties is critical. If you skip this step, your style variants will not be loaded into the page.
Apply Style Variants to Skuid Components¶
Style variants are applied within the Composer by clicking a component on the canvas and navigating to its Styles properties. Style variants, and other style properties, can then be adjusted:
- In the Properties pane, select the Styles tab.
- Select your style variant in the Style Variant dropdown.
Use Style Variants for Conditional Styling¶
Though style variants can be applied within the Composer at the component level, they are also used as parameters for conditional styling logic.
Conditional styling allows builders to define a set of criteria that, when met, will change the visual design of a component or component element by applying a new style variant.
For more about configuring style conditions, see the conditional styling documentation.
Naming¶
Once a new design system, variable, or variant is created, you can name it. Give each style element a name that provides context and makes the purpose of the element distinct from others in the same category.
For example: consider two Button style variants, one used only for Form submission, the other to refresh a Form component. Names like “Form button 1” and “Form Button 2” don’t incorporate function, and aren’t useful for providing context. Names that do incorporate function, like “Form Button - Submit” and “Form Button - Refresh” are clear and purposeful. Someone unfamiliar with the design system would immediately know where those variants should be used and what they’re used for.
There are two main naming conventions, each with pros and cons.
Naming by function [[]]¶
The first convention bases a name around the function represented. Imagine you create a specific color variable for form submission buttons. Following functional name convention, this color could be named “Submission Button Primary Color.”
Pros:
- The Skuid Primary default color variable is already used in most components, so changing color globally is as simple as modifying the default primary color Skuid provides.
- This option allows for context cluing, and gives a new designer working in the design system immediate understanding of that variable’s purpose.
Cons:
- Naming by function doesn’t give visual context. If a color variable is named “Submission Button” it’s not clear what color that actually is, making it difficult to understand the style ramifications of selecting a variable within a property’s dropdown list.
Naming by style [[]]¶
The second convention bases a name specifically on its stylistic identity. For example, a company uses the Verdana font as a primary body text. Their app builder makes a new typography variable for this font face; if using the style naming convention, this variable could be named “Verdana.”
Pros:
- Naming by style allows for a design-focused design system that acts as more of a literal style guide instead of a functional style guide.
- Style naming also allows for context cluing of what that variable actually looks like. For example, in a drop down menu where you’d select a color for an element, the color variable will display as “Red” and not just “Primary.”
Cons:
- The Primary default color is used across all DSS components. Deleting it in favor of a variable that follows style naming convention requires the designer to update any component property that once pointed towards the Primary variable.
- Using the style naming convention, there’s more chance for functional inconsistency because it’s harder to know what function the color represents.
- Using naming by style, a variable named after its font face could be used in multiple components for multiple purposes, leading to usability and visual cueing issues. If there’s not a system in place to keep track of variable purpose, stylistic cohesion could be impacted.
The Skuid default DSS includes variables that use both conventions as examples. It’s up to the app builder to choose which they’d like to follow. Designers can also try mixing conventions, providing function first, then adding style. For example, a button color used only for form submission could be called, Form Submission Button - Red. A font face used only for headings could be called, Headings Font - Arial Bold.