Difference between revisions of "User:Christopherszu"
Line 7: | Line 7: | ||
In the [https://www.zkoss.org/wiki/Small_Talks/2016/May/New_Approach_for_Building_Custom_ZK_Theme previous smalltalk], we've covered how to build ZK custom theme using the newly introduced ZK Theme Template. If you are not familiar with ZK Theme Template, we'd recommend a quick read through. | In the [https://www.zkoss.org/wiki/Small_Talks/2016/May/New_Approach_for_Building_Custom_ZK_Theme previous smalltalk], we've covered how to build ZK custom theme using the newly introduced ZK Theme Template. If you are not familiar with ZK Theme Template, we'd recommend a quick read through. | ||
− | + | Before ZK Theme Template came along, one sitution that often troubles ZK developers is trying to upgrade their ZK custom theme version to match the ZK version of the application. | |
− | + | There were no mechanism or tools provided officially, thus making it even harder. | |
− | with the | + | But since we have built ZK Theme Temaplte with Git, switching versions becomes much easier as we leverage the versioning capabilities of Git. |
− | we will show how to | + | In this smalltalk, we will show you how to build your custom based on any version of ZK, and how to switch to a different version. |
− | |||
− | |||
= Steps to Upgrading Your Custom Theme = | = Steps to Upgrading Your Custom Theme = | ||
Line 26: | Line 24: | ||
</li> | </li> | ||
<li> | <li> | ||
− | theme version should match | + | Since your theme version should match the ZK version of your application, we will assume ZK version is 7.0.2 initially and upgraded to 7.0.8 afterwards. |
</li> | </li> | ||
<li> | <li> | ||
Line 80: | Line 78: | ||
= Known Difficulties = | = Known Difficulties = | ||
− | Although this new approach gives ZK developers more freedom to create their own theme, there | + | Although this new approach gives ZK developers more freedom to create their own theme, there are still some inconveniences. |
<br/> | <br/> | ||
− | + | ZK developers not familiar with Git might find all the Git commands intimidating, especially with pull and merge. | |
{{Template:CommentedSmalltalk_Footer_new| | {{Template:CommentedSmalltalk_Footer_new| |
Revision as of 07:57, 14 June 2016
Christopher Szu, Engineer, Potix Corporation
Jun 21, 2016
ZK 8.0.2
Introduction
In the previous smalltalk, we've covered how to build ZK custom theme using the newly introduced ZK Theme Template. If you are not familiar with ZK Theme Template, we'd recommend a quick read through.
Before ZK Theme Template came along, one sitution that often troubles ZK developers is trying to upgrade their ZK custom theme version to match the ZK version of the application.
There were no mechanism or tools provided officially, thus making it even harder.
But since we have built ZK Theme Temaplte with Git, switching versions becomes much easier as we leverage the versioning capabilities of Git.
In this smalltalk, we will show you how to build your custom based on any version of ZK, and how to switch to a different version.
Steps to Upgrading Your Custom Theme
Follow these steps to upgrade your own custom theme based on ZK's new theme template.
We will assume you have already cloned ZK Theme Template and ran the init script. Please refer to the previous smalltalk for more detail.
- At this stage, you should have a custom theme based on the master (newest) branch of ZK Theme Template.
- Since your theme version should match the ZK version of your application, we will assume ZK version is 7.0.2 initially and upgraded to 7.0.8 afterwards.
- in this demo, let's make two changes, one of them will cause git merge conflict when we perform the upgrade later
- We'll edit src/archive/web/zul/less/_zkvariables.less, the file where all the colors are defined.
-
Change the background color of the ZK window component
from@windowBackgroundColor: #D9E5EF;
to
@windowBackgroundColor: #FF8888;
- We'll edit src/archive/web/zul/less/_zkvariables.less, the file where all the colors are defined.
-
Change the background color of the ZK window component
from@windowBackgroundColor: #D9E5EF;
to
@windowBackgroundColor: #FF8888;
-
If you build the theme right now, you'll get a ZK 7.0.2 custom theme. But since we want to upgrade to ZK xxx, let's just commit the changes for now.
➜ git add -u ➜ git commit -m "some changes"
-
Let's upgrade from current version to ZK xxx.
➜ git tag -l ➜ git fetch vxxxx ➜ git merge vxxxx
- Run git pull upstream to receive the latest change in ZK template theme- for example CSS related bug fixes. This way, if your customization has any conflict with ZK's change, you will see git merge conflict messages.
Known Difficulties
Although this new approach gives ZK developers more freedom to create their own theme, there are still some inconveniences.
ZK developers not familiar with Git might find all the Git commands intimidating, especially with pull and merge.
Comments
Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License. |