• Resolved JackMister

    (@jackmister)


    Hello, first of all, thank you for the plugin, it works very well, I really like the design.

    I ‘m having trouble applying my own CSS styles, it seems they does not having any effect… Any thoughts?

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Marin Matosevic

    (@marinmatosevic)

    It sounds like you’re facing challenges with applying your own CSS styles, particularly because the element is part of the shadow DOM.

    When dealing with shadow DOM, traditional CSS styling might not directly affect the elements within it. Shadow DOM encapsulates styles to prevent external styles from unintentionally affecting its internal components. To style elements within a shadow DOM, you can use a few approaches:

    There are several CSS methods available, but not all are universally supported by all browsers. Currently, the most reliable approach is utilizing JavaScript. While it may not be the most elegant solution, it proves effective for achieving the desired results. Below is a brief example demonstrating how to style the button.

    	const easySubscribe = document.querySelector('#easy-subscribe');
    	const shadow = easySubscribe.shadowRoot;
    
    	if (shadow) {
    		const button = shadow.querySelector('button');
    
    		if (button) {
    			button.style.backgroundColor = 'lightblue';
    			button.style.color = 'white';
    		}
    	}

    We’re actively exploring the possibility of introducing a custom CSS option in upcoming releases. Your feedback is valuable as we work towards enhancing our features.

    Thread Starter JackMister

    (@jackmister)

    Thank you for your fast response and for the code, I really appreciate it.
    I’ve managed to add additional styles to the form, but it would be much easier with standard CSS rules. Hope to see this feature in the future releases.
    Thanks once again!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom CSS styles’ is closed to new replies.