feathersui / feathersui-starling

User interface components for Starling Framework and Adobe AIR
https://feathersui.com/learn/as3-starling/
Other
915 stars 386 forks source link

CSS styling #1344

Open mistergreen opened 8 years ago

mistergreen commented 8 years ago

The feathers SDK makes component layout much easier but I think we all can agree that the styling is the most tedious part of feathers. How about an engine that style for you? All you would need is a css file for the engine to parse and apply the styles. In a way, this would get rid of themes. All you would need is a css file.

yuhengh commented 8 years ago

That's a good idea. I have been thinking to support theme editing in Starling Builder, but since feathers themes are hard coded into as3 I can't do it without recompile. It would be good to have an alternative way to edit theme without compilation.

teotigraphix commented 8 years ago

I could swear Josh said that styling was on hist long list, or maybe it was states and css was not.

Either way it has been brought up before. It's something that has to be implemented in the compiler so it's not trivial.

teotigraphix commented 8 years ago

And when I say implemented in the compiler, you don't want runtime parsing of css files for performance reasons, so having an ahead of time compile for styles is the right way to do it.

Yeah it could be manageable with smaller apps but there would be a line that would be reached really quick.

yuhengh commented 8 years ago

I don't think performance is the main concern. You only need to parse the css files once and cache it in the memory, and from then on it's basically the same as the compiled version. I do see some functionality is not possible this way like the custom factory methods, but the majority of the features should be able to supported without problems.

teotigraphix commented 8 years ago

Yeah I guess I was thinking of the things Flex had that would not be possible.

teotigraphix commented 8 years ago

I would be interested in helping on this if someone had ideas, I have some major apps and the themes are the most painful part of development.

joshtynjala commented 8 years ago

In the near future, I'm planning to build a desktop app for creating Feathers themes without writing code manually.

yuhengh commented 8 years ago

Cool. Can the styling data (scale9Grid, style definition and mapping, padding, etc) also be able to pulled out of the code?

joshtynjala commented 8 years ago

I'm not planning to make the tool parse ActionScript. It will probably use some kind of JSON or XML to store its data. If all goes as planned, I'll have the tool output a SWC so that no one expects any kind of round trip with raw code.

yuhengh commented 8 years ago

That's exactly what I am thinking, thanks!

mistergreen commented 8 years ago

Can you add some sort of media query like css? Styles on a tablet would look good but not on a phone. Currently I have to extend a theme and add my on isTablet condition to change styles based on screen size.

Klug76 commented 7 years ago

Maybe it would be better not to create an editor for that, but to make an AIR desktop application that shows all of the components (like the component explorer), and automatically detects and reflects changes in theme files (just by timer and hash). Theme files can be edited with any suitable editor. Some-like live coding. There may be some reasonable limits, e.g. if you change the atlas image size, you will have to restart the app, but it would be very useful anyway. (I have a working prototype of this "live component explorer" for my game, but it is not good enough to come out into the open source, and most importantly, it uses a number of closed commercial code). P.S. here are little examples of theme and UI data: https://gist.github.com/Klug76/0c8e5aa30f8594d6da2813df120e5d10 https://gist.github.com/Klug76/2999a0123f3ed1030030771faaa8734b

gene-pavlovsky commented 7 years ago

Any progress on that?

joshtynjala commented 7 years ago

Progress on what exactly? There are a lot of things mentioned in this thread that your question could apply to.

gene-pavlovsky commented 7 years ago

Sorry if I was unclear. I meant the desktop app for creating Feathers themes without writing code manually which you mentioned as planned.

joshtynjala commented 7 years ago

Development stalled, and I got pulled into other features.

teotigraphix commented 7 years ago

@joshtynjala It doesn't seem like this would be good use of your time any way. Seems like something the community could put together if there was a real need for it.