Build your own VueFront theme today. It's easy.
this instructions is made for devleoping a publicly accessible VueFront theme aka FREE THEME
- Setup VS Code development environment
- Develop
- Publish
Use VS Code. To make things easier, we recommend using VS Code for rapid development.
Name your theme in the following pattern:
# vuefront-[themename]-theme
vuefront-myvuefront-theme
# or vuefront-my-vuefront-theme
└── myvuefront-theme
yarn install
.vscode/tasks.json
- will add task to your VS Code. We recommend installing a VS Code plugintasks
to see these tasks in the status bar for ease of access.package.json
index.js
You will need to edit these veriables
YOUR_THEME_NAME
- your theme name. ex. myvuefront
YOUR_VUEFRONT_WEBAPP_TEST_FOLDER
- your vuefront web app test folder in VSCODE Workspace. ex. myvuefront-theme-test
YOUR_THEME_NPM_NAME
- your NPM package name. ex. vuefront-myvuefront-theme
To make your theme installible via NPM (or Yarn) you will need to publish the inistal version of 0.1.0 under your NPM username
# 1. Log in NPM
npm login
# 2. Publish (when publishing first time)
npm publish --access public
To start developing your theme, you will first need to install VueFront Web App.
- Create a folder
[themename]-theme-test
└── myvuefront-theme
└── myvuefront-theme-test
- Install VueFront Web App
# 1. Run command
yarn create vuefront-app
# 2. Provide CMS Connect URL (ex. https://wordpress.vuefront.com/wp-json/vuefront/v1/graphql)
- Install your theme on this App
# Run Command
yarn add vuefront-myvuefront-theme
- Edit
vuefront.config.js
to specify the theme
export default {
theme: 'vuefront-myvuefront-theme'
...
- Run command to see your theme in action
yarn dev
- Run task
Mytheme Build
- this will build your theme into the lib folder. - Run task
Mytheme Theme Sync
- this will start watching all changes in yourmyvuefront-theme
folder and move it tomyvuefront-theme-test/node_modules/vuefront-myvuefront-theme
Now you can develop the theme in your
myvuefront-theme
folder and see imidiate updates on the app built from foldermyvuefront-theme-test
Developing a theme is similar to customizing your VueFront Web App.
- You can customize components by creating a copy of them in your
YOUR_THEME_NAME-theme/components
and initializing them inYOUR_THEME_NAME-theme/components/index.js
. learn more - You can add your CSS styles in
assets/css/main.scss
Publishing is easy. Just upgrade your version in package.json
and rund command npm publish