Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Z10/Q10 CSS Docs

Does anyone know of a good source to use CSS for BB10?  More for layout purposes and not CSSing core controls.  So most of this would be custom CSS values.

Developer
Developer
Posts: 226
Registered: ‎01-17-2012
My Device: PB

Re: Z10/Q10 CSS Docs

There was a bit of a tutorial up from one of the jam sessions: by JDolce... but you likely saw that.

 

Regards,

Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: Z10/Q10 CSS Docs

Was able to confirm that non-ui values works OK in the CSS singleton.  So this works:

ThemeGlobals.injectCSS( 'Bob { wx: "green"; padLeft: 20; } Fred { padTop: 50; padBottom: 75; }' );
trace( 'css ' + ThemeGlobals.lookupValue( 'Bob', 'wx' ).toString() );
trace( 'css ' + ThemeGlobals.lookupValue( 'Bob', 'padLeft' ).toString() );
trace( 'css ' + ThemeGlobals.lookupValue( 'Fred', 'padBottom' ).toString() );

 However, if you call lookupValue to an object or attribute that does not exist, it will crash the app.  There is no way to default to a value if the definition is not present. You could encapsulate the call, but that would put a fair overhead with try/catch blocks.