Re: CSS Downloaded Twice (was Re: Including CSS in apps)

2020-01-08 Thread Carlos Rovira
Hi Alex, - Are we using normal CSS rules in Royale Code? (If not why we load >again in code and encode all that simple CSS rules that are > processed by >Browsers) > Royale has a ValuesManager. The various IValuesImpls implement enough CSS > to get some app to work. I'm

Re: CSS Downloaded Twice (was Re: Including CSS in apps)

2020-01-07 Thread Alex Harui
On 1/7/20, 10:41 AM, "Carlos Rovira" wrote: Hi, About having CSS downloaded twice, I think is a very interesting topic to know more info about. I understand that for non-conforming CSS royale rules like ClassReference is ok, but for normal CSS rules, seems to me a

CSS Downloaded Twice (was Re: Including CSS in apps)

2020-01-07 Thread Carlos Rovira
Hi, About having CSS downloaded twice, I think is a very interesting topic to know more info about. I understand that for non-conforming CSS royale rules like ClassReference is ok, but for normal CSS rules, seems to me a waste of resources, right? Questions I have about this: - Are we using

Re: Including CSS in apps

2020-01-07 Thread Harbs
I have two use cases in mind: 1. Components which use images (most likely SVG) for skinning. The components would reference their own internal files by default, but would probably allow the end user to specify their own graphics instead for custom skinning. 2. A library which includes graphics

Re: Including CSS in apps

2020-01-07 Thread Josh Tynjala
As a developer, I would expect to create my own image element in ActionScript code and reference the appropriate URL based on where the file was copied. I wouldn't want the compiler to add an to my HTML template. It would feel too much like magic and probably wouldn't be configurable enough to be

Re: Including CSS in apps

2020-01-07 Thread Alex Harui
On 1/7/20, 9:33 AM, "Harbs" wrote: > On Jan 7, 2020, at 7:28 PM, Alex Harui wrote: > > I would think any of these files need to be loaded by some other code. They can't just sit in the output folder. True, but this problem is smaller for image files which can simply be

Re: Including CSS in apps

2020-01-07 Thread Harbs
I solved it in Spectrum by using common base classes, so a CSS file is only ever referenced once. Spectrum has many interesting approaches. It makes extensive use of CSS variables which makes for extremely powerful run-time theming. The major monkey-wrench with that is IE11 support. I’m not

Re: Including CSS in apps

2020-01-07 Thread Harbs
I agree with your approach, and including the files in a SWC to be extracted at build time would be the biggest immediate win. One inline comments below: > On Jan 7, 2020, at 7:28 PM, Alex Harui wrote: > > I would think any of these files need to be loaded by some other code. They > can't

Re: Including CSS in apps

2020-01-07 Thread Alex Harui
I would think any of these files need to be loaded by some other code. They can't just sit in the output folder. They may not have to be loaded by inject_html directives. As I proposed earlier in the thread, it might be best to think of this problem in separate pieces. The first piece is to

Re: Including CSS in apps

2020-01-07 Thread Carlos Rovira
Hi Harbs, about duplicate elements: I solved it recently in TDJ by adding "id" to link. The "loadCSS" method now returns that "id". I store it in TDJ so I can remove the link element (and that remove all styles in the browser too). Maybe we can have some Manager class (maybe a bead to use in

Re: Including CSS in apps

2020-01-07 Thread Harbs
For js and image/svg files this is probably a complete solution. For CSS, there also needs to be code to load the CSS. I guess a combination of include_file and inject_html might work, but then we still have the problem of duplicate injection and combined CSS would not be properly referenced.

Re: Including CSS in apps

2020-01-06 Thread Josh Tynjala
Being able to ensure that a particular file gets copied to the output folder when the class is used would be really nice. JS, CSS, and images would all be useful. -- Josh Tynjala Bowler Hat LLC On Mon, Jan 6, 2020 at 2:11 PM Alex Harui wrote: > > > On 1/6/20, 12:45

Re: Including CSS in apps

2020-01-06 Thread Alex Harui
On 1/6/20, 12:45 PM, "Harbs" wrote: Yes. JS specific. It would be very hard to do a SWF compatible build of Spectrum. So to me, this isn't so much about CSS as it is about externs. CSS that is processed by the compiler is intended for multi-platform CSS. Multi-platform CSS

Re: Including CSS in apps

2020-01-06 Thread Harbs
Yes. JS specific. It would be very hard to do a SWF compatible build of Spectrum. > On Jan 6, 2020, at 8:56 PM, Alex Harui wrote: > > But is that CSS platform-specific, or will that same CSS be needed if you > were to try to implement Spectrum in SWF? IMO, that's a key question for how > we

Re: Including CSS in apps

2020-01-06 Thread Alex Harui
On 1/6/20, 9:24 AM, "Harbs" wrote: > In summary, I'm not quite sure what you are trying to do, but improving inject_html may not be the best way of doing it since you are wrapping elements. We want better association of class selectors to the classes that need them, and that may solve

Re: Including CSS in apps

2020-01-06 Thread Harbs
> In summary, I'm not quite sure what you are trying to do, but improving > inject_html may not be the best way of doing it since you are wrapping > elements. We want better association of class selectors to the classes that > need them, and that may solve your problem. Agree. I’m not looking

Re: Including CSS in apps

2020-01-06 Thread Alex Harui
IMO, there are two kinds of CSS for Royale: multi-platform and platform-specific. The reason most SWCs have a .css file is mainly for multi-platform CSS so that the compiler can process it and encode it for ValuesManager. A second reason is to make it easier for folks to grab and modify. For

Including CSS in apps

2020-01-06 Thread Harbs
I was just working on improving https://github.com/unhurdle/spectrum-royale/tree/include-css Basically, for the Spectrum components to work, there is CSS which needs to be included in the application. Spectrum divides the css into components, so you can include only the CSS you need for