[ALOY-16] There's no way to specify complex types in markup for UI properties
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-07-19T11:52:02.000+0000 |
Affected Version/s | 2012 Sprint 14 |
Fix Version/s | 2012 Sprint 14 |
Components | Runtime, XML |
Labels | n/a |
Reporter | Tony Lukasavage |
Assignee | Tony Lukasavage |
Created | 2012-05-11T13:46:19.000+0000 |
Updated | 2012-07-19T11:52:02.000+0000 |
Description
Description
ZipTi currently provides no means of specifying complex types in CSS, therefore there is no way of specifying many common UI properties from markup. This will cause some major confusion, not to mention that it is contrary to the point of abstracting styling through CSS. This effects some of our most used properties, likefont
.
Example
<html>
<body>
<div id="label1" data-ti-api="Label" style="font:{fontSize:30}"></div>
</body>
</html>
Will cause the following cryptic error to appear, as a result of the CSS-compliant grammar and parser used for parsing:
Uncaught SyntaxError: Expected "+", "-", angle, frequency, function, hash, identifier,
length, number, percentage, string, time, uri or whitespace but "{" found.
Comments
- Russell McMahon 2012-05-11 I think the way to handle this is to look at the complex properties that make up a majority of the Ti.UI namespace like Point, Font, and Array. For Array only simple types like strings or numbers should be supported. They map to CSS style using the shorthand syntax for example: -ti-font: 'Helvetica' '12px' 'italic' 'bold'; or -ti-fontFamily: 'Helvetica'; -ti-fontSize: '12px'; -ti-fontStyle: 'italic'; -ti-fontWeight: 'bold';
- Tony Lukasavage 2012-05-14 Should we create a ticket/story for documenting all of these cases? This likely will be a difficult task, especially considering that some won't have a direct correlation in CSS.
- Tony Lukasavage 2012-06-06 We have swicthed from CSS styling to JSON, so this is no longer an issue.