1

I have my own GUI generator for C++ applications. I don't want to create own file format for my GUI, and instead, I want to use simplified CSS for it.

For example:

#panel1{
    width: 100px;
    height: 50px;
    background-color: red;
}

Thanks to it, somebody who is using my program won't have to learn new file format. And I can preview my GUI not only in my program, but also in any web browser (when I include some reset.css and few global css rules/fixes).

But I've found an solid problem. I have some rules that do not exists in CSS (let's say it's background-id of type int). I can add that parameter to #panel1, browser will ignore it.

The problem is, to preview my GUI in web browser, I need to apply my JavaScript/jQuery fix to each parameter (beucase of diffrences in interpretation of e.g. position in CSS and my model).

For standard CSS parameters I can do it like that:

fixWidth( $('#panel1').css('width') );

But it won't work for background-id (my custom parameter):

fixBackgroundID( $('#panel1').css('background-id') );

because jQuery do not recognize it, unfortunatelly.

Is there any walkaround for it?

PolGraphic
  • 3,233
  • 11
  • 51
  • 108
  • 1
    It's been discussed here: http://stackoverflow.com/questions/2926326/can-i-access-the-value-of-invalid-custom-css-properties-from-javascript – LcSalazar Aug 27 '14 at 21:42

0 Answers0