Titanium JIRA Archive
Alloy (ALOY)

[ALOY-88] Alloy style files to specify platform and form factor specific sections

GitHub Issuen/a
TypeSub-task
PriorityHigh
StatusResolved
ResolutionFixed
Resolution Date2012-07-23T06:34:05.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsXML
Labelsn/a
ReporterTony Lukasavage
AssigneeUnknown
Created2012-07-16T09:06:47.000+0000
Updated2018-03-07T22:26:13.000+0000

Description

There's a couple ways we could do this:

A custom "selector"

**
"#myView[platform=ios]": { "backgroundColor": "#a00" }

A syntax by which multiple items can be grouped under one "selector"

**
"[platform=android,size=tablet]": {
    "#myView": { "backgroundColor": "#300" },
    "#anotherView: { "height": 200 }
}
I'm open to other suggestions that could be fit into the current JSON derivative syntax we are using.

Comments

  1. Russell McMahon 2012-07-16

    To makes use of media queries we can only make parse and prepare the query based on information we get back from the device. I'm not sure with Android we can get if it's a tablet or not. I think using a max/min width and pixel density are all values we can get back from querying device capabilities.
  2. Tony Lukasavage 2012-07-16

  3. Tony Lukasavage 2012-07-23

    Tons of detail available in the final comments in this thread: https://groups.google.com/forum/?fromgroups#!starred/appc-ti-alloy/xgsnEdhfIDo

JSON Source