• Resolved Andre

    (@andre-jutras)


    I was working on a new theme and discovered something about the customizer preview js options for colours. I can do colours and they give instant results in the preview window when using colour selectors, but I noticed that anything with a psuedo doesn’t work.

    Example:

    	wp.customize( 'line_colour', function( value ) {
    		value.bind( function( newval ) {
    			$('.entry-title:after').css('background-color', newval );
    		} );
    	} );

    Works fine if I remove :after but does a full background of the entry-title. But I have a border line below the title, hence the :after

    However, this doesn’t seem to work in the preview js; is there a way to make it work?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Have you looked it up in jQuery? I don’t think you can use the css function on a psuedo element since it’s not an actual element so there’s nowhere to put a style attribute.
    You will probably have to put a style element with that rule.

    Thread Starter Andre

    (@andre-jutras)

    Just before you replied, I came across some info on stackexchange which states it’s not possible. Not a major loss though as the colour setting still works on the front-end, just not for a preview.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Customizer Preview js for psuedo?’ is closed to new replies.