This repository contains generic templates for widgets in Pobo Page Builder.
Changelog versions:
- 3.4.2 - Fix
.rc-profit
icon width - 3.4.1 - Extension of variables
- 3.4.0 - Add multi-column widgets
- 3.3.0 - New gallery - PhotoSwipe
- 3.2.0 - Fix font family, add variable for image alignment
- 3.1.0 - Fix max width widget
- 3.0.2 - Fix
<li>
circle, remove native variable - 3.0.1 - Fix bug with full-width widget, add font family variable
- 3.0.0 - Support full-width widget, add background, spacing widget support
- 2.0.3 - Add variables for list item, paragraph, title line, standard table
- 2.0.2 - Add background color variable
- 2.0.1 - Add mobile variable support
- 2.0.0 - First version
-
rc-header-top-image-bottom
-
*__image
- image alignment -
typo - h2, h3, h4
- font family -
typo - h2, h3, h4
- font family -
typo - p
- font weight
This repository is primarily for Pobo Page Builder plugin clients who want to customize the appearance of their widgets.
Before starting, you need to have the following tools installed on your computer:
- Clone the repository using:
git clone [email protected]:pobo-builder/widget-asset.git
Then install the dependencies using:
npm install
If you are using Yarn:
yarn install
After installing the dependencies, you will see the following structure:
├── README.md
├── dist
├── node_modules
├── package-lock.json
├── package.json
└── src
└── *.scss
Main points of interest:
- The
dist/*
directory contains JS and CSS compiled from thesrc/*
directory. - The
src/*
directory contains the source SCSS files for individual Pobo widgets. - The
package.json
file includes the following scripts in thescripts
section:watch
(run withnpm run watch
) watches all files in thesrc/*
directory and compiles them intodist/*
upon changes.build
(run withnpm run build
) compiles thesrc/*
files intodist/*
, removes source maps, and minifies the code.proxy
(npm run proxy
) creates a tunnel (proxy) fromlocalhost:8088
to a public URL (explained further below).
Let's start by coding our first widget. First, create a new PR:
git checkout -b "widget-fv-bikemax-benefix-big" origin/main
.
Next, create a new SCSS file in the src/*
directory and name it using the convention [brand]-[client]-[widget-type]-[variant]
(e.g., fv-bikemax-benefit-big.scss
). Import this SCSS file into src/editor.scss
(e.g., @import "fv-bikemax-benefit-big.scss";
).
Run the command npm run watch
to watch for changes in SCSS files, compile them into CSS, and create a server displaying styled widgets at http://localhost:8088
.
We recommend styling widgets using the BEM methodology, which ensures low specificity and minimal risk of interference with external modifications (e.g., overriding styles by a template, global adjustments by coders, etc.).
When writing classes, we recommend using prefixes based on the SCSS file name (e.g., .fv-bikemax-benefit-big
). This avoids conflicts with other widgets. The code should look something like this:
.fv-bikemax-benefit-big {
&__title {
font-size: 10px;
}
&__subtitle {
font-size: 20px;
}
&__image {
float: left;
}
}
Important Information: Do not use prefixes like .pb-*
or .rc-*
as these are reserved for Pobo Page Builder widgets available to all clients, and conflicts may occur.
...
Before deploying, it's good practice to test the widget's appearance on the client's side. Here's a simple process:
- Start
ngrok
(a proxy server for local development) using:
npm run proxy
- The terminal will return output like this:
Note the public URL, e.g., https://abcd-12-34-56-789.ngrok.io/
. This URL is a public tunnel (proxy) to your local server (http://localhost:8088/
).
-
Open
https://abcd-12-34-56-789.ngrok.io/
and find the linked CSS file in the header (e.g.,/index.cc2492f5.css
- the name will vary, as a content hash is used). Copy the path to the CSS file (e.g.,https://abcd-12-34-56-789.ngrok.io/index.cc2492f5.css
). -
Log in to Pobo at www.pobo.cz/login, navigate to www.pobo.cz/app/asset, create your first customization, and insert the following into the code field:
@import "https://abcd-12-34-56-789.ngrok.io/index.cc2492f5.css";