You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello
Right now there is no way to remove the generated styles for breadcrumbs.
We can use this filter, but the <style></style> tags are still returned in the markup.
add_filter(
'the_seo_framework_breadcrumb_shortcode_css',
function ( $css, $class ) {
// Remove all entries in $css
$css = [];
return $css;
}, 10, 2 );
Or is there any other way without touching core files?
The text was updated successfully, but these errors were encountered:
I recommend using that filter only to modify or add styles, not remove them altogether.
The breadcrumbs are generated as a list for improved machine readability, but they should actually be styled inline.
Outputting the CSS asynchronously would cause the browser to render the breadcrumbs as a list and then again as inline, causing a significant jump in the content, which is bad for UX. To learn more about this, see https://web.dev/articles/cls.
In any case, yes, that filter would effectively remove the default styles.
Is there any reason you wish to remove the styling? I made them as tiny as possible to mitigate any measurable impact.
P.S. is this your request? I've halted support on Matt's website until the litigatory dust is settled.
I use function_exists( 'tsf_breadcrumb' ) ? tsf_breadcrumb(['class' => 'breadcrumb-nav'])
As I do the styling for the breadcrumb in the themes CSS, I would like to completely remove the one you provided. It would be a bit cleaner instead overriding the TSF styles.
The mentioned filter just removes the styles. But it leaves the empty <style></style> tags still in place. Actually it would be great tu update the filter, so it does not return them if the $css array is empty.
Thanks!
PS. Yes, this was my request. Let's hope the dust settles soon …
Hello
Right now there is no way to remove the generated styles for breadcrumbs.
We can use this filter, but the
<style></style>
tags are still returned in the markup.Or is there any other way without touching core files?
The text was updated successfully, but these errors were encountered: