12 karma · joined June 2, 2011
“Voltage and mAh are two different, but interrelated, things. voltage is a measure of the electrical power a battery can deliver, while mAH (milli-Amp hours) is a measure of how long the battery will maintain usable voltage at a given output current.” https://www.quora.com/How-much-mAh-will-equal-to-1-v
The concepts are similar but we needed a language to change the composition and configuration of our screens that had the same kind of flexibility as the CSS language.
It is used as a replacement to XML/HTML to define visual components of the page, having a better structure, and to easily change the screen to different merchants, and to easily implement variations for A/B tests using CSS like rules.
Ex:
B { value = "1"; }
Defines B as having value = "1".
A > B { value = "2"; }
Define B as having value = "2" if direct child of A.
So the definition:
C [ B, A [ B ] ]
The first B will have value = "1" and the second value = "2".
Each definition act as a template (like XSLT) to create the elements.
Also there is a main difference that element composition is separated from element definition. So:
A { B { value = 4} }
Do not define the element A as having the element B. It define that if there is an element B having a parent A the value will be 4.
The language do not hard define the elements but define how to create the elements. You ask the language to create an specific element and all the rules will be evaluated to return the desired element.
Edited: Clicked enter before finishing the message.
I am working on a new language concept (still at early thinking) but the alert template document would be defined as:
alert#update_available [ //Composition is separated from definition
btn#update,
btn#cancel
]
alert { //All alert elements are defined as alertTemplate
type: alertTemplate
}
btn { //All btn elements are define as button
type: button
}
alert#update_available { //Define the title and description for the alert with ID update_available
title: Get the latest tvOS version
description: Get the latest tvOS version
}
btn#update {
text: Update Now
}
btn#cancel {
text: Cancel
}
//We could override the settings like CSS
(@language = "pt_br") {
//If variable language is pt_br override the content with Brazilian Portuguese texts
btn#update {
text: Atualize Agora
}
btn#cancel {
text: Cancelar
}
}