rawpython / remi

Python REMote Interface library. Platform independent. In about 100 Kbytes, perfect for your diet.
Apache License 2.0
3.48k stars 401 forks source link

how to use remi with utility driven CSS such as Tailwinds #482

Closed amiracam closed 2 years ago

amiracam commented 2 years ago

Tailwinds is all about specifying inline tags via the construct

class="etc etc"

so if I have a Remi component , is there a way of specifying a string to it that effectively amounts to doing the "class="tag tag tag" in the generated html ?

a better example would be:

<h1 class="text-2xl font-bold mt-8 mb-5">

thanks

-Charles

dddomodossola commented 2 years ago

Hello @amiracam,

you can add classes by doing:

mywidget.add_class('text-2xl')
mywidget.add_class('font-bold')

or you can specify classes in constructor:

mywidget  = Widget(_class='text-2xl font-bold')

Regards

amiracam commented 2 years ago

thank you, this is perfect, very well thought out framework. I've gotten so sick of this whole JS ecosystem, I find it a mess. Instead, using a Kivy/ KivyMD to deliver desktop/mobile and then using Remi to deliver web pages is so very much straightforward and clean. I just bumped into Remi , I think that the "web/browsers" and desktop/mobile are two viable but separate venues. Now with Remi, I feel hopeful i have found that missing piece.

thanks again

-Charles

dddomodossola commented 2 years ago

You are welcome 😉