Skip Navigation

[Escalated to 2nd Tier] Additional CSS loading issue

This support ticket is created 4 years 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.

Our next available supporter will start replying to tickets in about 7.93 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

Tagged: 

This topic contains 10 replies, has 2 voices.

Last updated by Raja Mohammed 4 years ago.

Assisted by: Raja Mohammed.

Author
Posts
#1834463

Hi

The CSS when added to a Toolset view always loads to late and causes things to move around as the page is loading.

I see someone reported this back in 2018 and you mentioned you working on a solution:
https://toolset.com/forums/topic/site-load-custom-toolset-css-is-loaded-too-late/

Is there any solution to this?

Thanks

#1835349

Raja Mohammed
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello there,

I am afraid this is still not available yet, Since there are quite a lot of changes in WordPress and with View has got a new dimension with block based plugin this has received lesser priority also there is some technical difficulty on rendering the CSS before the content as any style tags inside the document body would be considered as invalid, Since View loads inside the document body we are looking into other possibilities.

I kindly request you to follow the workaround suggested in this ticket https://toolset.com/forums/topic/site-load-custom-toolset-css-is-loaded-too-late/,
I will add your ticket to the developers attention.

Kind regards
Raja

#1835355

I feel like that workaround is going to be bad for performance though right?

By the way does this issue exist with block editor? I am going to start trying to use this more as I know you are actively developing this more.

With block editor:

1) does the issue exist when you modify display/style options in the block?

2) does the issue exist if you add custom CSS to the content template/archive? If it does, what is the workaround here? As the above workaround would not work as theres no way to add this in right?

Matt

#1836121

Raja Mohammed
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hey Matt,

I have done a quick test and i can confirm the issue does not happen with View Blocks custom CSS,
As the block custom CSS are rendered in the document head and they are available before the contents are loaded on the page.
So you should be good with the blocks .

Raja

#1836649

Nah this issue 100% exists with the block editor, I am seeing it on multiple pages.

What is the work around hear since we can't easily add style code in the block editor?

The CSS in the additional CSS for the template still loads too late.

This is a huge issue..

#1838325

Raja Mohammed
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

custom_css_in_view_block.jpg
Screenshot 2020-11-09 at 10.02.41 AM.jpg

I am attaching the screenshot examples of how the Custom Css added to the View block is rendered before the body tag which means the styles are already available by the time the blocks are rendered.

I am not sure how you are adding the custom css to the view block, Please refer to the screenshot , if you are doing something different let me know.

#1841075

Hi Raja

Possibly this is just in block views and not archives made with blocks?

As its 100% added after I have checked the code for archives, how can I have the CSS code load before the blocks? This is a huge issue..

Matt

#1841285

Raja Mohammed
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

css_rendered_in_document_head.jpg
archive_block_custom_css.jpg

Hi Matt,

I think the archives blocks is no different that the view block in rendering the Custom CSS,

I did a quick test and i can see the custom CSS added to the archive block are rendered in the archives page head.

Can you please share a screenshot how the custom CSS is added to the archive block and where it is rendered in the page source, May be that will help me understand better.

Regards
Raja

#1843825
Screenshot 2020-11-13 at 18.40.43.png
Screenshot 2020-11-13 at 18.43.02.png

Hi Raja

Please see attached the screenshot showing where I added the custom CSS and a screenshot of the code, although you can't see where about it is really, its 100% not in the head, in fact it is in the footer. I was going to send the source code I seem to only be able to attached images.

I checked it on a view actually as I have one built with the block editor now and this was also in the footer after the view.

#1845457

Raja Mohammed
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Thanks for the screenshots i see the issue now i am checking this with the team. i will update you in a while

#1845585

Raja Mohammed
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I have discussed the issue with the second tier also inspected the codes. You got it right, the block follow the same pattern for loading custom css as the views does, I have reported the issue and our developers has taken a note of it. The style in the head is injected by a script in the footer which is causing the confusion here. we are looking for alternative ways to deal with it without affecting the HTML validation

As of now I would suggest adding an HTML block as the first block with the CSS inside script tags so the CSS will be effective.