Shopify themes, liquid, logos, and UX
Hi
I have added breadcrumb navigation to my website, but can't seem to make it adjust with a margin on the left to align with the logo. It also needs to be flexible for mobile use. The options I've found with adjusting distance, seems to be fixed and doesn't adjust when the window is smaller. I've got the Dawn theme.
breadcrumbs.liquid looks like this:
<style>
.breadcrumbs {
margin: 0 0 2em;
}
.breadcrumbs__list {
list-style-type: none;
margin: 0;
padding: 0;
}
.breadcrumbs__item {
display: inline-block;
}
.breadcrumbs__item:not(:last-child):after {
border-style: solid;
border-width: .10em .10em 0 0;
content: '';
display: inline-block;
height: .20em;
margin: 0 .20em;
position: relative;
transform: rotate(45deg);
vertical-align: middle;
width: .20em;
}
.breadcrumbs__link {
text-decoration: underline;
}
.breadcrumbs__link[aria-current="page"] {
color: inherit;
font-weight: normal;
text-decoration: none;
}
.breadcrumbs__link[aria-current="page"]:hover,
.breadcrumbs__link[aria-current="page"]:focus {
text-decoration: underline;
}
@media screen and (max-width: 640px){
nav.breadcrumb, nav.breadcrumb a.Breadcrumbs, nav.breadcrumb span {
margin-left: 5px;
margin-right: 5px;
margin-top: 30px;
font-size: 12px;
text-transform: uppercase;
}
}
</style>
Hi,
To solved that issue, you can add to element which is wrapping breadcrumbs a class "page-width" as like this:
<div class="breadcrumbs page-width">
.....
.....
<div>
Thanks! do I add it to breadcrumbs.liquid, just anywhere?
yes, you need go to breadcrumbs.liquid file and add that class to inside div tag had class breadcrumbs already.
I've added it in but get an error message, any ideas?
Tried here also, with </div> but no change
Thank you 🙂
@emhog - are you able to save it?
Hi,
You must add that class in here:
<nav class="breadcrumbs page-width">
I've added it here, brings the breadcrumb a bit to the right, but doesn't align with logo when full window size, it does however respond to the size of the window when made smaller which is great.
Could you share the store url here?
Like that will easy to check and give to you the suggestion.
Hi,
To solved this issue, you can do follow.
Admin -> Theme -> Customize Code -> assets -> base.css
Then add this code bellow to that file:
.breadcrumbs {
margin-left: auto;
margin-right: auto;
width: 100%;
}
@emhog - can you please share the page link from where you got the screenshot?
Thank you! It looks better and better. It's still not inline with the logo in fullscreen, but maybe that is the closest it will get? Do you know how to add a layer to it; when you go Products>Collection>Item it only says Home>Item...
🙂
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024