Results 1 to 2 of 2

Thread: How do a specify a subclassed item in Lianja CSS

  1. #1
    Senior Member
    Join Date
    Feb 2012
    Posts
    1,214

    How do a specify a subclassed item in Lianja CSS

    Hi,

    In a custom VFP Section.
    I have some buttons which I style in my stylesheet using
    Code:
    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.

    Thanks.

    Herb

  2. #2
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,771
    Hi Herb,

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

    Code:
    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.
    Last edited by barrymavin; 2016-09-15 at 05:41.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Journey into the Cloud
Join us