> Here's another idea idea: what if there was a compiler option that would > override the xmlns in the MXML files? > > mxmlc -compiler.mxml.xmlns=js,library://ns.apache.org/flexjs/mdl > > That would be ok, but it seems a bit tacky to me...my vote would be not introduce things like this and keep it as clean as possible.
> > Just so I'm clear, is your concern that you don't like setting the > className property in ActionScript? But isn't that essentially how you > would do it in HTML? IOW, you would open an HTML editor and write: > > <html> > <body> > <button class="mdl-button" /> > > IMO, what we are doing in writing AS components is taking common patterns > from HTML and reproducing them in AS. So I'm not really sure it is wrong > to be setting className="mdl-button" in the Button.as for the MDL.swc. > What I don't really one is to end declaring a "height" or "color" or "className" in component code. I feel it like is very bad. don't you?. I do it in order to continue progressing, but don't like it as final since this shouldn't be applied in the component. If I have a MDL component set...is clear that I should use "mdl-button" (in a button), but there's some optional params to get different mdl buttons (fab, raised, with ripple...i.e: mdl-button--fab) so maybe in the MDL Button it could be a tag attribute like "mdlEffect", that could set as "fabAndRipple" or "raised"... (but in my actual implementation, that I don't think it should be final). Thinking about what I would like to have: if we want to end with js:Button getting a MDL style and effect, that's not the way. First, we must make possible to clean all styles inside component code (Core.js or HTML.swc should not have any style config in code), and then apply it as external CSS. If I want to change default for mdl style, I think we could introduce something new like: js|Button { className: mdl-button mdl-js-button mdl-button--fab mdl-button--colored; } (maybe thinking loud) ...or something similar. This would allow great flexibility without mixing control and styling. Of course, in addition I should need to change DOM composition overriding the Button's createElement method (...and maybe this could be done as well vía config ?...but maybe to think at later time ;)) what do you think?