# CSS Editing
Bootstrap Studio gives you an entirely visual way of building web pages, by using the Appearance panel and component options. But, if you require extra control and customizability, you can write CSS code directly in the Editor panel.
The CSS editor that's built into Bootstrap Studio will be familiar to anyone who's used their browser's developer tools. You can edit CSS code in the Styles tab, or in CSS files which you create in the Design panel.
# The Styles Tab
Styles is one of the two non-closable tabs in the Editor panel. It gives you a list of the CSS blocks in your design which match the currently selected component. This is a convenient way to discover which CSS blocks are affecting the component across all your files, and application-generated code.
Note that the app-generated styles (labeled as "Bootstrap") are locked and are not user editable. You can override them by clicking the three dot menu of the block and copying it to your own stylesheet.
# CSS Files
Creating a new CSS file is easy. Just right click the "Styles" label and choose the
New > CSS File menu.
To import an existing CSS file, just drag and drop it onto the application window. It will be parsed and added in your design.
You can create/import as many files as you wish, and organize them into folders to make them easier to manage.
# CSS File Order
When working with multiple CSS files, you will sooner or later run into a situation where you need to control the precedence of files. To change the order in which CSS files are applied, right click the Styles group and select
Here you can reorder the files as you need them and then click the Save button. These changes will be applied to all pages in your design.
Although it isn't shown in the dialog, the Bootstrap framework css file is always included first in the page, before your stylesheets.
When right clicking a CSS file, you get a couple of options for controlling its visibility.
- Enable/Disable - with this option you can disable a stylesheet, so that it doesn't apply in any of your pages.
- Visibility.. - this will open a dialog which lets you choose which pages of your design should the stylesheet be added to.
# Linking External CSS
You can link externally hosted stylesheets in Bootstrap Studio. Just right click the Styles group and choose
Link External CSS. In the dialog you can paste a URL to an externally hosted stylesheet and it will be added to your design.
# Editing CSS
Double click a CSS file and it will be opened for editing in our CSS editor. Click on a selector, css property or a value to edit them. Hit
Tab to move to the next rule, and
Shift+Tab to the previous. You can click the space between rules to create new ones, and between css blocks to create new blocks or comments.
Images and fonts that you've added to the Design panel will be automatically picked up and shown as suggestions when appropriate. There is a full undo/redo history, so feel free to experiment!
# Option Menu
When you click the three dots on the top right of each CSS block, you will see a menu with options. You have the basic operations like copy, move and delete, but also the option to add a media query and enabling/disabling the block.
# Multi Selection
Click CSS blocks while holding the
Ctrl/Shift (Windows/Linux) or
Cmd/Shift (Mac) keys to initiate a multi selection. This gives you quick actions to apply en masse.
# Working with Locked Blocks
The Bootstrap framework's CSS is locked In Bootstrap Studio. This is necessary so that we can upgrade the framework when new versions are released.
However, it is straightforward to modify one of these locked blocks if you need to. Just copy them to your stylesheet and override the styles.
If you need to make more comprehensive changes to Bootstrap, we recommend that you import a Custom Theme.
# Duplicating and Copying Blocks
If you want to duplicate your CSS block, you need to click the three dots on the top right of the block and select the Duplicate option. This will make an exact copy of the block in the same file.
If you want to make a copy of the CSS block or move it to another file, use the Copy To and Move To options.
# Rearranging Blocks
You can also rearrange your CSS blocks by dragging them. This allows you to organize your code better and control the order in which your rules are applied.
# Writing Media Queries
Media Queries are an important tool for creating responsive layouts. In Bootstrap Studio, media queries are assigned on a block by block basis. To do this, choose
Add Media Query from the Option menu (the three dots on the top right of the block).
The query will be prefilled with a
max-width depending on the current width of the stage.
If you find our CSS editor too restrictive, you can always switch to writing SASS code.
# Writing Keyframe Animations
Keyframe animations are a powerful way to create smooth animations on the web. You can use them in addition to the regular animation functionality in Bootstrap Studio.
To add a keyframe animation block to your CSS file, just type
@keyframes as the start of a new CSS selector.
After you've defined it, you can apply your animation to an element with an animation css rule:
animation: 2s test123. You can learn more on the MDN animations page.
To delete a breakpoint, click the box with the percentage value (
60% in the video above), delete the text so the box is empty, and press return. The entire block will be removed and focus will move to the next breakpoint (if any).
# CSS Variables
Bootstrap Studio has built-in support for CSS custom properties (opens new window) (also known as variables). They give you an easy way to reuse a specific color throughout your design and change it from a central location.
The Bootstrap framework makes use of custom properties primarily for color and font customization. Below you can see some of the available variables for Bootstrap 5, each starting with the
... --bs-danger: #dc3545;
--bs-font-sans-serif: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
"Segoe UI Symbol", "Noto Color Emoji";
--bs-font-monospace: SFMono-Regular, Menlo, Monaco, Consolas,
"Liberation Mono", "Courier New", monospace;
rgba(255, 255, 255, 0.15),
rgba(255, 255, 255, 0)
Defining your own custom properties, or overriding the built-in ones is straightforward. You can do it by writing code like the following in one of your css files:
--bs-blue: #007bff; /* Changes the blue color everywhere in the framework */
--myWonderfulColor: #654321; /* This is a new property */
To make use of CSS variables, just include them in the places you need that value. This way if you choose to make a change in the future, it will automatically be applied everywhere.
You can also find helpful references to the defined variables under all color-related options in the Appearance panel.