Bricksforge Terminal
A powerful tool that allows you to perform various tasks using an emmet syntax, making it faster and easier to work with the Bricks Builder. With this extension, you can add new elements to the canvas, apply multiple global classes at once, and much more - all from the comfort of your keyboard.
Whether youβre a beginner or an experienced user, this extension is sure to become an indispensable part of your workflow.
How to use
To open the terminal, press Ctrl + T
or Ctrl + Shift + T
. You can also use the Terminal Icon added to the Bricks Builder toolbar. Now youβre ready to start using the terminal.
Add New Elements
The syntax for adding new elements is as follows:
> element-name
The arrow >
indicates that you want to add a new element. The element name is the name of the element you want to add. For example, if you want to add a new div
element, you can type:
> div
This will add a new div
element to the canvas.
You can also nest elements by adding a >
after the element name. For example, if you want to add a new div
element inside a block
element, you can type:
> block > div
This will add a new div
element inside a block
element. You can nest elements as many times as you want.
Add Siblings
You can add siblings to an element by adding a +
after the element name. For example, if you want to add a new heading
element after a text-basic
element, which are inside a block
element, you can type:
> block > heading + text-basic
This will add a new text-basic
element after a heading
element. These new elements will be siblings. The parent element is the block
element.
The +
indicates that you want to add siblings to a new element.
Add Global Classes
You can add global classes to an element by adding a .
after the element name. For example, if you want to add a new div
element with the bg-primary
class, you can type:
> div.bg-primary
You can also add multiple classes by writing them after each other. For example, if you want to add a new div
element with the bg-primary
and text-white
classes, you can type:
> div.bg-primary.text-white
If you want to add global classes to an existing element, you need to select it in the structure panel. Then you can add the classes by typing the class names starting with a .
For example, if you want to add the bg-primary
and text-white
classes to the selected element, you can type:
.bg-primary.text-white
The .
indicates that you want to add global classes to a selected element.
Add Element ID
You can add a custom ID to an element by adding a #
after the element name. For example, if you want to add a new div
element with the ID my-custom-id
, you can type:
> div#my-custom-id
The #
indicates that you want to add an ID to a new element.
Add Attributes
You can add attributes to an element by using the syntax [attribute-name=attribute-value]
. For example, if you want to add a new div
element with the attribute data-type
and the value primary
, you can type:
> div[data-type=primary]
You can also add multiple attributes by writing them after each other. For example, if you want to add a new div
element with the attributes data-type
and data-color
and the values primary
and blue
, you can type:
> div[data-type=primary][data-color=blue]
Add Settings
You can add every setting to an element by using the syntax {settings-key: settings-value}
. For example, if you are adding a new heading
and want to set the tag
to h1
, you can type:
> heading{tag:h1}
You can add as many settings as you want. For example, if you want to add a new heading
element with the tag
set to h1
and the text
set to Hello World
, you can type:
> heading{tag: h1, text: Hello World}
To access nested settings, you can use the dot notation. For example, if you want to add a new button
with a link set to βexternalβ,the URL set to βhttps://bricksforge.ioβ and βOpen in new tabβ enabled, you can type:
> button{link.type: external, link.url: https://bricksforge.io, link.newTab: true}
How to find the correct settings key
To find the correct settings key, you can use the following steps:
- Select the element in the structure panel and do some settings changes.
- Copy the element to the clipboard.
- Paste the element into the text or code editor of your choice.
This way you can see the settings key and value pairs and use them in the terminal.
Common Setting Keys
Here are some common setting keys that you can use in the terminal:
tag
β The tag of the element, e.g.,h1
,p
,a
text
β The text content of the elementlink.type
β The link type of the element, e.g.,internal
,external
link.url
β The URL of the linklink.newTab
β Whether the link should open in a new tab or nottype
β The type of the element, e.g.,primary
,secondary
style
β The style of the element, e.g.,primary
,secondary
stretch
β Whether the element should stretch to the full width or not_display
β The display property of the element, e.g.,block
,flex
_overflow
β The overflow property of the element, e.g.,auto
,hidden
_opacity
β The opacity property of the element, e.g.,0.5
,1
_cursor
β The cursor property of the element, e.g.,pointer
,default
_zIndex
β The z-index property of the element, e.g.,1
,2
_width
β The width property of the element, e.g.,100%
,200px
_height
β The height property of the element, e.g.,100%
,200px
_widthMin
β The min-width property of the element, e.g.,100%
,200px
_widthMax
β The max-width property of the element, e.g.,100%
,200px
_heightMin
β The min-height property of the element, e.g.,100%
,200px
_heightMax
β The max-height property of the element, e.g.,100%
,200px
_padding.top
β The top padding property of the element, e.g.,10px
,20px
_padding.right
β The right padding property of the element, e.g.,10px
,20px
_padding.bottom
β The bottom padding property of the element, e.g.,10px
,20px
_padding.left
β The left padding property of the element, e.g.,10px
,20px
_margin.top
β The top margin property of the element, e.g.,10px
,20px
_margin.right
β The right margin property of the element, e.g.,10px
,20px
_margin.bottom
β The bottom margin property of the element, e.g.,10px
,20px
_margin.left
β The left margin property of the element, e.g.,10px
,20px
_visibility
β The visibility property of the element, e.g.,visible
,hidden
_aspectRatio
β The aspect ratio of the element, e.g.,16:9
,4:3
_objectFit
β The object fit of the element, e.g.,cover
,contain
_objectPosition
β The object position of the element, e.g.,center
,top left
_flexWrap
β The flex wrap property of the element, e.g.,wrap
,nowrap
_direction
β The direction property of the element, e.g.,row
,column
_alignSelf
β The align self property of the element, e.g.,center
,flex-start
_justifyContent
β The justify content property of the element, e.g.,center
,space-between
_alignItems
β The align items property of the element, e.g.,center
,flex-start
_columnGap
β The column gap property of the element, e.g.,10px
,20px
_rowGap
β The row gap property of the element, e.g.,10px
,20px
_flexGrow
β The flex grow property of the element, e.g.,1
,2
_flexShrink
β The flex shrink property of the element, e.g.,1
,2
_flexBasis
β The flex basis property of the element, e.g.,auto
,100%
_order
β The order property of the element, e.g.,1
,2
As you can see, all style related settings start with an underscore _
.
Multiplication
You can multiply elements by adding a *
after the element name. For example, if you want to add a new div
element 5 times, you can type:
> div*5
You can also multiply elements with attributes and classes. For example, if you want to add a new div
element with the bg-primary
class and the attribute data-type
and the value primary
5 times, you can type:
> div.bg-primary[data-type=primary]*5
The *
indicates that you want to multiply elements.
Grouping
Currently, grouping is not supported in the terminal.
Custom Commands
Since Bricksforge 2.0.1, you can create custom commands in the terminal. This allows you to create your own shortcuts for adding entire element structures.
Create a Custom Command
In the structure panel context menu (right click), youβll find a new list item βCreate Terminal Commandβ. After clicking on it, a modal will open where you can enter the name of your command and the structure you want to add.
Use a Custom Command
To use a custom command, you can type the name of the command in the terminal with the prefix >*
. For example, if you have created a command called my-command
, you can type:
>* my-command
Examples
Here are some examples of how you can use the terminal to add new elements and apply global classes:
> section > container > block > heading + text-basic + text-basic
This will add a section
element with a container
element inside it. The container
element will have a block
element inside it. The block
element will have a heading
element, followed by two text-basic
elements.
> section#testimonials > container.testimonials--wrapper > block.testimonials--inner > heading + text-basic + image
This will add a section
element with the ID testimonials
and a container
element with the class testimonials--wrapper
inside it. The container
element will have a block
element with the class testimonials--inner
inside it. The block
element will have a heading
element, followed by a text-basic
element and an image
element.
> section#cto[data-style=primary] > container > block > heading + button
This will add a section
element with the ID cto
and the attribute data-style
and the value primary
inside it. The section
element will have a container
element inside it. The container
element will have a block
element inside it. The block
element will have a heading
element, followed by a button
element.