bulma and buefy

95 views
Skip to first unread message

António Ramos

unread,
Sep 14, 2022, 10:37:06 AM9/14/22
to py4web
Hello py4web has bulma out of the box but being buefy a 
"Lightweight UI components for Vue.js based on Bulma"  i guess it would make more sense to have buefy available out of the box wit py4web ??

Its just because i think buefy is sooo cool.......
especially tables

regards
António

Jim Steil

unread,
Sep 14, 2022, 11:35:36 AM9/14/22
to py4web
I see a couple things you can do if you'd like to use buefy in py4web.  

NOTE - I know enough about Vue.js to be dangerous and all I know about Buefy is based on a quick scan through their documentation, keep that in mind as you read through this.

css and js
Buefy has it's own .js and .css files you can include in your template.

css
py4web allows you to define your own classes/styles to use when building forms and grids.  py4web provides bulma grid and form classes/styles and bootstrap form classes/styles out of the box.  It would be pretty easy to write your own for Buefy and pass them on form and grid instantiation.
FormStyleBulma is defined here -> https://github.com/web2py/py4web/blob/master/py4web/utils/form.py#L605  ...with FormStyleBootstrap4 following

custom form widgets
You can build your own custom widgets to use with forms.  You could do this with Buefy/Vue to build all the form widgets to go with Buefy/Vue

attributes
py4web allows you to pass custom attributes when you instantiate grids or forms.  py4web provides a sample attribute plugin for grid.  For forms, you can pass custom attributes on instantiation that will be applied to the form element.  That, combined with custom form widgets would give you the ability to build forms customized for Buefy/Vue.

Maybe create a py4web_buefy (maybe check with Massimo on naming) package that has all of these components for people who would like to use it.  I'm not interested in creating the package, but would be happy to help get you started...

-Jim
Reply all
Reply to author
Forward
0 new messages