feathersui-starling icon indicating copy to clipboard operation
feathersui-starling copied to clipboard

CSS styling

Open mistergreen opened this issue 8 years ago • 17 comments

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.

mistergreen avatar Apr 21 '16 16:04 mistergreen

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.

yuhengh avatar Apr 21 '16 16:04 yuhengh

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 avatar Apr 21 '16 17:04 teotigraphix

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.

teotigraphix avatar Apr 21 '16 17:04 teotigraphix

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.

yuhengh avatar Apr 21 '16 17:04 yuhengh

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

teotigraphix avatar Apr 21 '16 17:04 teotigraphix

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.

teotigraphix avatar Apr 21 '16 17:04 teotigraphix

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

joshtynjala avatar Apr 21 '16 17:04 joshtynjala

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

yuhengh avatar Apr 21 '16 18:04 yuhengh

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.

joshtynjala avatar Apr 21 '16 19:04 joshtynjala

That's exactly what I am thinking, thanks!

yuhengh avatar Apr 21 '16 20:04 yuhengh

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.

mistergreen avatar May 13 '16 13:05 mistergreen

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

Klug76 avatar Dec 08 '16 11:12 Klug76

Any progress on that?

gene-pavlovsky avatar Sep 16 '17 09:09 gene-pavlovsky

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

joshtynjala avatar Sep 18 '17 15:09 joshtynjala

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

gene-pavlovsky avatar Sep 18 '17 22:09 gene-pavlovsky

Development stalled, and I got pulled into other features.

joshtynjala avatar Sep 19 '17 14:09 joshtynjala

@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.

teotigraphix avatar Sep 19 '17 14:09 teotigraphix