Skip Navigation

[Resolved] Unload certain default Toolset styles

This thread is resolved. Here is a description of the problem and solution.

Problem:
The user would like to remove some specific styles in the Toolset common CSS file.

Solution:
Toolset does not have a filter to customize what styles will be added or not. In the upcoming release, we'll introduce a new ID attribute on the body tag to ensure that the user-defined styles in blocks do not get overwritten by themes or plugins. It would be an option in Toolset Settings to enable/disable the body#id tag.

Regarding the rule ".tb-container p:first-child { margin-top: 0 !important }" there is no way to exclude it from the file "toolset-common-es.css". Either include the whole file or exclude it using custom code using wp_dequeue_style
https://developer.wordpress.org/reference/functions/wp_dequeue_style/

You may override it with your custom CSS with a more specific selector, by adding another class to the container:

.tb-container.my-class p:first-child { margin-top: 20px !important }

If you are more comfortable with HTML/CSS/JS, you may want to build using the legacy editor, and the Toolset shortcodes. You can activate the legacy editor in Toolset->Settings->General(tab)->Editing Experience.

Relevant Documentation:
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/

This support ticket is created 3 years, 10 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.

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

Supporter timezone: Africa/Casablanca (GMT+01:00)

This topic contains 2 replies, has 2 voices.

Last updated by lukaszS-3 3 years, 10 months ago.

Assisted by: Jamal.

Author
Posts
#2011995

Hi,

I'd like to unload certain styles loaded by default with Toolset. For example:

.tb-container p:first-child { margin-top: 0 !important } in toolset-common-es.css.

Obviously, the "important" declaration isn't helpful as I'm building a site with custom classes and intend to use Toolset only for logic an general site layout. Matter of fact, having such declaration by default isn't the best practice in my opinion as it leads to problems with custom CSS.

Is there a function or a filter in Toolset that would prevent loading such styles?

#2012041

Hello and thank you for contacting the Toolset support.

Toolset does not have a filter to customize what styles will be added or not. In the upcoming release, we'll introduce a new ID attribute on the body tag to ensure that the user-defined styles in blocks do not get overwritten by themes or plugins. It would be an option in Toolset Settings to enable/disable the body#id tag.

Regarding the rule ".tb-container p:first-child { margin-top: 0 !important }" there is no way to exclude it from the file "toolset-common-es.css". Either include the whole file or exclude it using custom code using wp_dequeue_style
https://developer.wordpress.org/reference/functions/wp_dequeue_style/

You may override it with your custom CSS with a more specific selector, by adding another class to the container:

.tb-container.my-class p:first-child { margin-top: 20px !important }

If you are more comfortable with HTML/CSS/JS, you may want to build using the legacy editor, and the Toolset shortcodes. You can activate the legacy editor in Toolset->Settings->General(tab)->Editing Experience.
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/

I hope this answers your request. Let me know if you have any questions.

#2013429

My issue is resolved now. Thank you!