Button Split Mixin

Developer
Size
2,543 Kb
Views
26,312

How do I make an button split mixin?

A Sass mixin for a link animation where the border splits down/left and up/right on hover.. What is a button split mixin? How do you make a button split mixin? This script and codes were developed by Thomas Vaeth on 24 September 2022, Saturday.

Button Split Mixin Previews

Button Split Mixin - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Button Split Mixin</title> <link rel='stylesheet prefetch' href='https://fonts.googleapis.com/css?family=Karla'> <link rel="stylesheet" href="css/style.css">
</head>
<body> <a class="btn" href="#">Hover Me</a>
</body>
</html>

Button Split Mixin - Script Codes CSS Codes

body { margin: 0; padding: 0;
}
* { box-sizing: border-box;
}
body { display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; height: 100vh; width: 100%; font-family: "Karla", sans-serif; -webkit-font-smoothing: antialiased; background-color: #f5f5f5;
}
a { font-size: 2em; text-decoration: none;
}
.btn { position: relative; padding: 0.25em 0.5em; color: #252525;
}
.btn:before, .btn:after { content: ""; position: absolute; top: 0; left: 0; height: 100%; width: 100%; border: 2px solid #252525; -webkit-transition: -webkit-transform 0.3s ease-in; transition: -webkit-transform 0.3s ease-in; transition: transform 0.3s ease-in; transition: transform 0.3s ease-in, -webkit-transform 0.3s ease-in;
}
.btn:hover:before, .btn:hover:after { -webkit-transition: -webkit-transform 0.3s ease-out; transition: -webkit-transform 0.3s ease-out; transition: transform 0.3s ease-out; transition: transform 0.3s ease-out, -webkit-transform 0.3s ease-out;
}
.btn:hover:before { -webkit-transform: translate3d(-3px, 3px, 0); transform: translate3d(-3px, 3px, 0);
}
.btn:hover:after { -webkit-transform: translate3d(3px, -3px, 0); transform: translate3d(3px, -3px, 0);
}
Button Split Mixin - Script Codes
Button Split Mixin - Script Codes
Home Page Home
Developer Thomas Vaeth
Username thomasvaeth
Uploaded September 24, 2022
Rating 4.5
Size 2,543 Kb
Views 26,312
Do you need developer help for Button Split Mixin?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Thomas Vaeth (thomasvaeth) Script Codes
Create amazing Facebook ads with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!