Skip to content

Commit

Permalink
Fix WooCommerce breadcrumb icon
Browse files Browse the repository at this point in the history
  • Loading branch information
crftwrk committed Aug 2, 2023
1 parent e44e81e commit 74766e7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 29 deletions.
42 changes: 14 additions & 28 deletions scss/bootscore_woocommerce/_wc_breadcrumb.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,22 @@ WooCommerce Breadcrumb

.wc-breadcrumb {

// Hide the "Home"
.breadcrumb-item:first-child {
position: relative;
text-indent: -9999px;
margin-right: $spacer;

a {

// Add a Fontawesome house icon instead
&::before {
content: ' ';
text-indent: 0;
position: absolute;
top: 50%;
left: 0;
transform: translate(0, -50%);
mask-position: center;
mask-repeat: no-repeat;
mask-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' height='1em' viewBox='0 0 576 512'%3e%3c!--! Font Awesome Free 6.4.0 by %40fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons%2c Inc. --%3e%3cpath d='M575.8 255.5c0 18-15 32.1-32 32.1h-32l.7 160.2c0 2.7-.2 5.4-.5 8.1V472c0 22.1-17.9 40-40 40H456c-1.1 0-2.2 0-3.3-.1c-1.4 .1-2.8 .1-4.2 .1H416 392c-22.1 0-40-17.9-40-40V448 384c0-17.7-14.3-32-32-32H256c-17.7 0-32 14.3-32 32v64 24c0 22.1-17.9 40-40 40H160 128.1c-1.5 0-3-.1-4.5-.2c-1.2 .1-2.4 .2-3.6 .2H104c-22.1 0-40-17.9-40-40V360c0-.9 0-1.9 .1-2.8V287.6H32c-18 0-32-14-32-32.1c0-9 3-17 10-24L266.4 8c7-7 15-8 22-8s15 2 21 7L564.8 231.5c8 7 12 15 11 24z'/%3e%3c/svg%3e");
-webkit-mask-position: center;
-webkit-mask-repeat: no-repeat;
-webkit-mask-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' height='1em' viewBox='0 0 576 512'%3e%3c!--! Font Awesome Free 6.4.0 by %40fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons%2c Inc. --%3e%3cpath d='M575.8 255.5c0 18-15 32.1-32 32.1h-32l.7 160.2c0 2.7-.2 5.4-.5 8.1V472c0 22.1-17.9 40-40 40H456c-1.1 0-2.2 0-3.3-.1c-1.4 .1-2.8 .1-4.2 .1H416 392c-22.1 0-40-17.9-40-40V448 384c0-17.7-14.3-32-32-32H256c-17.7 0-32 14.3-32 32v64 24c0 22.1-17.9 40-40 40H160 128.1c-1.5 0-3-.1-4.5-.2c-1.2 .1-2.4 .2-3.6 .2H104c-22.1 0-40-17.9-40-40V360c0-.9 0-1.9 .1-2.8V287.6H32c-18 0-32-14-32-32.1c0-9 3-17 10-24L266.4 8c7-7 15-8 22-8s15 2 21 7L564.8 231.5c8 7 12 15 11 24z'/%3e%3c/svg%3e");
width: $font-size-base;
height: $font-size-base;
background-color: $link-color;
}
}
// Add a Fontawesome house icon for empty "Home" (wc-functions.php)
.breadcrumb-item:first-child a::before {
content: ' ';
display: inline-block;
width: $font-size-base;
height: 100%;
background-color: var(--#{$prefix}link-color);
mask-position: center;
mask-repeat: no-repeat;
mask-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' height='1em' viewBox='0 0 576 512'%3e%3c!--! Font Awesome Free 6.4.0 by %40fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons%2c Inc. --%3e%3cpath d='M575.8 255.5c0 18-15 32.1-32 32.1h-32l.7 160.2c0 2.7-.2 5.4-.5 8.1V472c0 22.1-17.9 40-40 40H456c-1.1 0-2.2 0-3.3-.1c-1.4 .1-2.8 .1-4.2 .1H416 392c-22.1 0-40-17.9-40-40V448 384c0-17.7-14.3-32-32-32H256c-17.7 0-32 14.3-32 32v64 24c0 22.1-17.9 40-40 40H160 128.1c-1.5 0-3-.1-4.5-.2c-1.2 .1-2.4 .2-3.6 .2H104c-22.1 0-40-17.9-40-40V360c0-.9 0-1.9 .1-2.8V287.6H32c-18 0-32-14-32-32.1c0-9 3-17 10-24L266.4 8c7-7 15-8 22-8s15 2 21 7L564.8 231.5c8 7 12 15 11 24z'/%3e%3c/svg%3e");
-webkit-mask-position: center;
-webkit-mask-repeat: no-repeat;
-webkit-mask-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' height='1em' viewBox='0 0 576 512'%3e%3c!--! Font Awesome Free 6.4.0 by %40fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons%2c Inc. --%3e%3cpath d='M575.8 255.5c0 18-15 32.1-32 32.1h-32l.7 160.2c0 2.7-.2 5.4-.5 8.1V472c0 22.1-17.9 40-40 40H456c-1.1 0-2.2 0-3.3-.1c-1.4 .1-2.8 .1-4.2 .1H416 392c-22.1 0-40-17.9-40-40V448 384c0-17.7-14.3-32-32-32H256c-17.7 0-32 14.3-32 32v64 24c0 22.1-17.9 40-40 40H160 128.1c-1.5 0-3-.1-4.5-.2c-1.2 .1-2.4 .2-3.6 .2H104c-22.1 0-40-17.9-40-40V360c0-.9 0-1.9 .1-2.8V287.6H32c-18 0-32-14-32-32.1c0-9 3-17 10-24L266.4 8c7-7 15-8 22-8s15 2 21 7L564.8 231.5c8 7 12 15 11 24z'/%3e%3c/svg%3e");
}

// additional code for wc breadcrumbs,
// Additional code for wc breadcrumbs,
// as the wc breadcrumb function does not allow for custom
// class for last child
.breadcrumb-item:last-child {
Expand Down
4 changes: 3 additions & 1 deletion woocommerce/wc-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ function bs_woocommerce_breadcrumbs() {
</nav>',
'before' => '<li class="breadcrumb-item">',
'after' => '</li>',
'home' => _x('Home', 'breadcrumb', 'woocommerce'),
// Remove "Home" and add Fontawesome house icon (_wc_breadcrumb.scss)
//'home' => _x('Home', 'breadcrumb', 'woocommerce'),
'home' => ' ',
);
}
endif;
Expand Down

0 comments on commit 74766e7

Please sign in to comment.