Genie Discord forum

Author AvatarPere
10/21/2022, 2:07:12 PM

Right now I'm passing the style keyword to a slider component. If I wanted to assign a class, where would I add the CSS code? Is it possible to include external CSS files from the Julia code?

`using GenieFramework @genietools

@in const value = 1

function ui() row(slider(1:1:20, , style="width : 200px;")) row([ cell(span("Value: null")) cell(numberfield("", )) ]) end

@page("/", ui)`

Author Avatarabhimanyuaryan
10/25/2022, 3:57:45 PM

you mean add css to slider component or entire page?

Author Avataressenciary
10/25/2022, 3:58:26 PM

if you create public/css/genieapp.css it will be automatically injected in the page -- you can define there classes and add them to the components

Author Avataressenciary
10/25/2022, 3:58:36 PM

same for public/js/genieapp.js

Author Avatarabhimanyuaryan
10/25/2022, 3:59:08 PM

or you can also prepend that in ui function if I remember correctly

Author Avataressenciary
10/25/2022, 4:00:29 PM

no, that was something else (it was the function)

Author Avatarabhimanyuaryan
10/25/2022, 4:00:55 PM

oh yes page() would take style

Author Avataressenciary
10/25/2022, 4:01:41 PM

for a fully customised approach, one can also create their own layout file (and pass it to @page) and there they can load any assets they want

Author Avataressenciary
10/25/2022, 4:02:02 PM

yes, but that's not relevant for the question / new API @abhimanyuaryan

Author Avatarabhimanyuaryan
10/25/2022, 4:02:11 PM

aah ok yes doesn't have page

Author AvatarMav
11/24/2022, 10:22:29 AM

Thanks! Could you provide a more detailed explanation/example for this?

Author AvatarPere
11/25/2022, 8:30:42 AM

Hey @Mav Sorry i don’t think we have any example out for this yet. We’ll do a full tutorial on component styling soon