[ALOY-562] Order of TSS classes declaration has effect instead of order in which they are assigned to an object
GitHub Issue | n/a |
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Won't Fix |
Resolution Date | 2013-03-13T13:21:14.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | n/a |
Labels | alloy, alloy-generate |
Reporter | Davide Cassenti |
Assignee | Tony Lukasavage |
Created | 2013-03-13T10:49:12.000+0000 |
Updated | 2015-10-22T04:14:09.000+0000 |
Description
Changing the order of class declarations in TSS files actually changes the order in which the attribute values are applied. Changing the order of the classes in the element "class" attribute doesn't make any difference. This is different from what a user would normally expect (looking at CSS) and not logical.
Refer to the testcase attached. The text displayed shows the exact class attribute value. One would expect the order of classes in the class attribute would affect the appearance. Instead, the order of classes declaration in the TSS file does.
Attachments
Quick test case. In index.xml we would have:
Both lines have style2 applied, because style2 is defined after style1 in index.tss
This behavior is by design and is consistent with CSS: http://stackoverflow.com/questions/1321692/how-to-specifiy-the-order-of-css-classes
I see I was mistaken about the CSS (it was and stays confusing). But why would someone want this in Alloy? It is much more logical to be able to specify the order of classes application in the element instead of by the order of definitions.
I disagree, as order in the style files is always significant in pretty much any framework. The developer generally places them there with specific intention. If you need more flexibility in the application of classes, you should likely use more, smaller classes that cover specific characteristics and have less overlap.