Custom css in component

66 views
Skip to first unread message

Heike Franosch

unread,
Oct 24, 2022, 11:55:47 AM10/24/22
to Magnolia User Mailing List
Hi all,

I need to add some custom css for the TwinColSelect, because if nothing
is selected the two selects don't align. That's probably some local problem in my
installation. However it can easily be fixed by increasing the min-height.
I can add a custom class in my yaml definition with styleName, that works
fine. But I don't know how to inject the css file.
The VAADIN solution ist to add a @StyleSheet, but I think it must be used in a suitable
class. 
I need a hint how to do this.

Thanks for any help,
Heike

Bartosz Staryga

unread,
Oct 24, 2022, 12:07:15 PM10/24/22
to user...@magnolia-cms.com
Hey,

This might be something helpful:


Best regards,

Bartosz Staryga
Front-End Solution Architect, Headless Expert
bartosz...@magnolia-cms.com 

Magnolia 
Oslo-Strasse 2, 4142 Münchenstein (Basel), Switzerland
Office: +41 61 228 90 00 www.magnolia-cms.com
 
 


--
You received this message because you are subscribed to the Google Groups "Magnolia User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to user-list+...@magnolia-cms.com.
To view this discussion on the web, visit https://groups.google.com/a/magnolia-cms.com/d/msgid/user-list/aa09f885-53db-4ec4-84d5-4f683661b2f9n%40magnolia-cms.com.

Roman Kovařík

unread,
Oct 25, 2022, 2:50:28 AM10/25/22
to Magnolia User Mailing List, hfgm...@gmail.com
Hi Heike,

you can extend TwinColSelectFieldFactory, return a component extended from TwinColSelect with @StyleSheet annotation as you've mentioned.  

Hope that helps 
Roman

Heike Franosch

unread,
Oct 25, 2022, 4:56:57 AM10/25/22
to Magnolia User Mailing List, roman....@magnolia-cms.com
Hi,

extending TwinColSelect works. Perfect :-)

The custom-css module also looks nice. As I only need a minimal css snippet, I
use the extension. But I will keep it in mind, if I have some further requirements.

Thanks, Heike
Reply all
Reply to author
Forward
0 new messages