Skip Navigation

[Resolved] Shortcodes in CSS/JS

This support ticket is created 7 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Tagged: 

This topic contains 4 replies, has 2 voices.

Last updated by Beda 7 years, 2 months ago.

Assisted by: Beda.

Author
Posts
#571700

Hello.

As with this thread: https://toolset.com/forums/topic/shortcodes-on-js-and-css-fields-in-views/

I was just wondering whether Andy's suggestion to pre-process the CSS/JS has been taken into consideration yet.

It would be great if we could use SCSS/LESS, and have shortcodes processed.

Imagine the potential.

#571704

ShortCodes in CSS are not possible.

I am not sure what happened to that Feature Request, I could not find any record of this.

I don't think we can implement this, as it's not allowed by WordPress either.

I will query with the Developers in this regard and update you here afterwards.

#572101

We do not plan to evaluate this, for several technical issues that you would stumble over if we would allow ShortCodes in JS or CSS.

Thank you, and I apologise that we cannot implement this.

#572112

That's unfortunate.

Would you at least consider SCSS preprocessing?

#572423

We should follow the way of WordPress, where ShortCodes in CSS or even in HTML, are not intended.

We created some custom features in Views so you can use ShortCodes within other ShortCodes or as attributes to HTML.

But we cannot create a new way to embed the CSS, the CSS and JS is not loop-element based, it is Views based.
The idea that you can include the same CSS and JS for each element in the loop is dangerous and potentially problematic: how would you manage to define the same function in JS, with a different behaviour for each element in the loop?

And it would be a complete change of the current implementation.

I am sorry to say that we cannot implement this.