PDA

View Full Version : How do a specify a subclassed item in Lianja CSS



hmischel@diligentsystems.com
2016-09-14, 10:37
Hi,

In a custom VFP Section.
I have some buttons which I style in my stylesheet using
lianja_ui_commandbutton{}

I have class named clsBtnBlue.

Whats the correct way to reference that in css file?

I think I tried all the obvious ways, but its alluding me.:confused:

Thanks.

Herb

barrymavin
2016-09-15, 00:05
Hi Herb,

In the case of custom controls in custom sections you should use "Property selectors". See below.



btn = createObject("CommandButton")
// you can add custom properties to any object like this
btn.btnstyle = "1"
// now in your CSS you can apply CSS depending on the value of custom properties
btn.css = 'lianja_ui_commandbutton["btnstyle"="1"] { color: red; } lianja_ui_commandbutton["btnstyle"="2"] { color: blue; }'


Note that the property selectors should be lower case.

You can use global CSS styles by specifying the CSS file in the App, Page, Section attributes.

If you are changing the properties and you want the CSS to be reapplied issue a redraw() on the object.