FYI, I worked out a theming class for my (Royale) InDesign extensions which 
allows for setting global CSS at runtime. The approach might be useful in your 
theming effort:
https://paste.apache.org/cOBC <https://paste.apache.org/cOBC>

(Some of the code is specific to Adobe Extensions.)

Some pointers:
I used inject_html because I needed some overrides in a CSS file. I might have 
been able to rework it so the CSS file was not needed.

There is a function called createStyleSheet which is commented out. That 
creates a stylesheet called “royale_theme_styles”. It’s the same as including a 
blank css file with the same name, but it’s loaded dynamically rather than 
requiring the file to be included. If that function is used inject_html is not 
necessary.

The order of dynamically loaded CSS has the same rules as CSS loaded via 
declaring it in HTML and the later ones override the earlier ones. We can 
probably take advantage of that for different levels of defaults.

HTH,
Harbs

> On Nov 1, 2017, at 8:05 PM, Carlos Rovira <carlosrov...@apache.org> wrote:
> 
> Hi,
> 
> I think I could start to try what Harbs expose, although I think what I
> will need in the end is to control some SVG parts with variables. Maybe
> with the showed SVG/CSS relation could be sufficient. I'll be showing how
> limitations I find. As well as Alex said having inline SVG as HTML would be
> very useful.
> 
> 2017-11-01 18:27 GMT+01:00 Harbs <harbs.li...@gmail.com>:
> 
>> I’m not sure. I haven’t seen problems.
>> 
>> The only issues that come to mind are:
>> 1. There’s no load events on SVG images on Microsoft browsers.
>> 2. Chrome has issues with SVG, transforms and fractional pixels.
>> 3. There’s some blending issues that different browsers handle differently
>> depending on isolation modes.
>> 
>> There’s likely other issues, but these are ones that I’ve had to deal with.
>> 
>> The major gotcha in terms of mixing HTML and SVG is that HTML can not be
>> nested inside SVG without ForeignObject. ForeignObject does not have full
>> browser support.
>> 
>>> On Nov 1, 2017, at 7:08 PM, Alex Harui <aha...@adobe.com.INVALID> wrote:
>>> 
>>> A couple of years ago, I thought I had learned that some browsers had
>>> issues with SVG background-images.  Maybe psuedo-states were involved,
>> but
>>> a Button might "blink" as it changed states and loaded an SVG
>>> background-image.  Do we know if that was just a bug in some browser or
>> is
>>> that still a concern?
>>> 
>>> I think I would like to see a simple set of HTML/SVG/CSS/JS that shows
>> how
>>> any declarative SVG and JS have to work together to handle resizable
>>> skins/components.  Then it might be more obvious what needs to change in
>>> the tooling.  We allow inline HTML now in MXML.  I think we can/should
>>> allow inline SVG, but for both inline HTML and SVG, id's in the inline
>>> content do not become id's to MXML and AS.
>>> 
>>> HTH,
>>> -Alex
>>> 
>> 
>> 

Reply via email to