Can I use Native HTML, CSS and JS within LightningJS?

Is it possible to integrate the native HTML, CSS and JS in lighting JS?

Yes. For low end devices and RDK devices we recommend only using Lightning for performance reasons. On RDK devices there is a way to turn off the compositor (disable HTML + CSS) to get a 30% boost in performance

can you share the documention for the above @chiefcll

You might have to ask RDK team for it. Its a param we pass in on launching WPE browser.

@chiefcll can I get a code snippet or documentation to add HTML + CSS inside lighting JS ?

You wouldn’t add it “inside” of Lightning. Lightning is a JS framework which renders in a browser using a canvas tag. There is still HTML + CSS being handled by the browser. Anywhere you could use any of the DOM apis to create HTML markup and CSS to add it to the page, but it would be part of the DOM. You’d have to move the canvas tag, or position the HTML on top of the canvas tag. You’re not adding HTML inside of Canvas…

1 Like