My first commands
Let's learn basics
Lesson Setup
Go to Pages
Add new Page
Set some Page title and publish it
Edit with Oxygen
Wait 10-20s Oxygen Builder to load and we have small CSS framework made to demonstrate basic ideas when using Recoda so you should:
Copy this file: lesson CSS framework
Create new Stylesheet
Paste text in newly created Stylesheet
Click on comand line and paste command:
div>a+a^1*3Press
Enterkey to execute command
Classes
Ok, now we have lesson environment ready, let's do some work. Now we have our lesson CSS framework in Stylesheets, but Oxygen and command-line suggestion won't work for that classes so in order to have classes suggestion we need to one hack.
To import classes we will do hack:
Add some dummy div element
Click on command-line
Execute command:
.demo-buton.demo-button-main.big.red.color-white.boldSave
Delete that dummy div, we used it just to import classes.
Adding single class
Find button element on page, select it and then:
Press
Gto focus command-linetype:
.demo-buttonPress
Enter to apply suggestionPress
Enter to execute suggestion
Adding multiple classes at once
Find second button element in first, select it and then:
Press
Gto focus command-linetype:
.demo-button.demo-button-mainPress
Enter to execute command
When you were writing .my-button-class you could see that you have hint for that. If Class exist in Oxygen you will get auto-complete suggestion. Please do not paste command try to write it first it is very easy and it will onboard you to function which you will use all the time and you will see that suggestion will make writing pretty easy.
Adding multiple classes to multiple elements
We have three sections with two buttons in each, so overall we have six buttons. And usually you need add each class like:
click on element
click on selectors to open adding class prompt
start typing until suggestion appears
Press Enter to apply class suggestion
So and for other two classes we don't need first step. So it takes 10 actions (typing is calculated as single action). And for just six elements it would took 60 actions.
Let see how command-line compares with it:
Select first button.
Press
Gto focus command-linetype:
.red.big.boldPress
Enter to execute
It took four actions to make add three classes (To be true typing action is little longer, but it is not big difference, and wait for impact to see real impact).
Now we have situation like this:

To add all that classes to all elements we need just five more actions:

And after about two seconds and these five easy action, you have added three clasess to five button elements. And result is:

Attributes
Adding single attribute to multiple elements
OK, button styles are now as we wanted (eye-catching design really 😄). And Let's say we need add same attribute for all of them (this can was useful to us when we needed add lightbox trigger attributes, but in this case we will use our fancy buttons).
So we want to add attribute button-data="some-data" to all of them. If you would use Oxygen it can be tricky to copy paste two inputs of data and get every time inside attribute panel.
Lets add attribute to first button :
Select first button.
Press
Gto focus command-linetype:
[button-data=some-data]Press
Enter to execute
To add that same attribute to other too, just shift click on them. And result should look like:

Other commands
Rename element
We can see that on the image below that all buttons have generic name. Let's rename first button via command-line.

Let's rename button to my_button :
Select first button.
Press
Gto focus command-linetype:
@my_buttonPress
Enter to execute
Change content
We can see that on the image below that all buttons have generic content. Let's rename first via command-line.
Let's rename button to my_button :
Select first button.
Press
Gto focus command-linetype:
{Get Me!}Press
Enter to execute
And first button should look like this:

Chain commands
Rename and change content
Let's Rename and change content of second button, we want nicename to be awsome_button and content to be Click me!

Let's do it for second button :
Select second button.
Press
Gto focus command-linetype:
{Click Me!}@awsome_buttonPress
Enter to execute
Now we learned that we can apply last command with shift, so let's apply this command to the rest of buttons.

Last updated
Was this helpful?