Shopify themes, liquid, logos, and UX
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
Hi guys, I've been stuck on this for hours. Anyone know how I can make the size of a button on hover to be smaller without affecting the size of the text inside of the button? Any help is greatly appreciated!
A good reference is how the buttons on Gucci's website operate.
My website: fluzeo.com
Solved! Go to the solution
This is an accepted solution.
Hey @flammagreg,
Go to your theme's "Edit Code" Option, then in the search bar type "theme.liquid"
Below the tag "<head>" tag paste the following. Screenshot attached for reference.
<style>
@media only screen and (min-width: 990px) {
.banner__buttons:hover {
transform: scale(1) !important;
}
.banner__buttons {
position: relative !important;
}
.banner__buttons .button {
background-color: transparent !important;
}
.banner__buttons:after {
content: '';
background-color: white !important;
height: 100% !important;
width: 100% !important;
position: absolute !important;
z-index: -1 !important;
border-radius: 2px !important;
transform: scale(1) !important;
transition: transform 300ms !important;
}
.banner__buttons:hover::after {
transform: scale(0.95) !important;
}
}
</style>
Screenshot is for reference only, the correct code to paste is the one shown above.
This is an accepted solution.
Hey @flammagreg,
Go to your theme's "Edit Code" Option, then in the search bar type "theme.liquid"
Below the tag "<head>" tag paste the following. Screenshot attached for reference.
<style>
@media only screen and (min-width: 990px) {
.banner__buttons:hover {
transform: scale(1) !important;
}
.banner__buttons {
position: relative !important;
}
.banner__buttons .button {
background-color: transparent !important;
}
.banner__buttons:after {
content: '';
background-color: white !important;
height: 100% !important;
width: 100% !important;
position: absolute !important;
z-index: -1 !important;
border-radius: 2px !important;
transform: scale(1) !important;
transition: transform 300ms !important;
}
.banner__buttons:hover::after {
transform: scale(0.95) !important;
}
}
</style>
Screenshot is for reference only, the correct code to paste is the one shown above.
Amazing, thank you! Do you know where and what line of code I should use to make the transition of the box slower (some sort of ease code)?
Here @flammagreg. It's 300 milliseconds now. Just change it to whatever you need. 1000ms for 1 second.
Super helpful thank you!