Slanty Button Mixin
How do I make an slanty button mixin?
A button with slanted borders, and a slanty fill. The slanty bits are made from CSS gradients. Use the mixin and make one for yourself.. What is a slanty button mixin? How do you make a slanty button mixin? This script and codes were developed by Eli Fitch on 28 October 2022, Friday.
Slanty Button Mixin - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Slanty Button Mixin</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css"> <style> /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */ @import url(https://fonts.googleapis.com/css?family=Lato:400,700);
.fancy-button { background-repeat: no-repeat; background-image: linear-gradient(-60deg, #ff4cff 0%, #ff4cff 41.6%, #5bf390 41.6%, #5bf390 100%), linear-gradient(-60deg, #ff4cff 0%, #ff4cff calc(100% - 41.6%), #5bf390 calc(100% - 41.6%), #5bf390 100%); background-position: 0 0, 0 100%, 0 0, 100% 0; background-size: 100% 0.3em, 100% 0.3em, calc(100% + 0.6em) 100%, 100% calc(100% + 0.6em); border: none; border-left: 0.3em solid #5bf390; border-right: 0.3em solid #ff4cff; padding: 1em 1.5em; overflow: hidden; position: relative; font-size: 1em; margin-bottom: 1em; transition: all 0.4s;
}
.fancy-button:hover:before, .fancy-button:hover:after, .fancy-button:active:before, .fancy-button:active:after { transform: translateX(0);
}
.fancy-button:before, .fancy-button:after { content: ''; display: block; position: absolute; z-index: -1; width: 100%; height: 100%; top: 0; left: 0; background-repeat: no-repeat; background-size: 100% calc(100% - 0.6em); background-position: 50% 0.3em; transition: all 0.4s;
}
.fancy-button:before { background-image: linear-gradient(-60deg, transparent 0%, transparent 50%, #5bf390 50%, #5bf390 100%); transform: translateX(calc(-100% + 41.6%));
}
.fancy-button:after { background-image: linear-gradient(120deg, transparent 0%, transparent 50%, #ff4cff 50%, #ff4cff 100%); transform: translateX(calc(100% - 41.6%));
}
.fancy-button:hover { color: white;
}
html { font-size: 30px; font-family: 'Lato', 'brandon grotesque', 'gotham', futura, helvetica, sans-serif; padding: 1em; text-align: center;
}
button { appearance: none; background-color: transparent; border: none; font-family: 'Lato', 'brandon grotesque', 'gotham', futura, helvetica, sans-serif; outline: none !important;
}
h4 { margin-bottom: 1em;
}
h6 { font-size: 0.6em;
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <h4>A button with slanted borders, and a slanty fill. The slanty bits are made from CSS gradients.<br>Use the mixin and make one for yourself!
</h4>
<button class="fancy-button">Hover me, baby</button>
<h6>
Relies on a magic number, if you're smarter than me and can figure out how to get rid of that, then you get a
Slanty Button Mixin - Script Codes CSS Codes
@import url(https://fonts.googleapis.com/css?family=Lato:400,700);
.fancy-button { background-repeat: no-repeat; background-image: linear-gradient(-60deg, #ff4cff 0%, #ff4cff 41.6%, #5bf390 41.6%, #5bf390 100%), linear-gradient(-60deg, #ff4cff 0%, #ff4cff calc(100% - 41.6%), #5bf390 calc(100% - 41.6%), #5bf390 100%); background-position: 0 0, 0 100%, 0 0, 100% 0; background-size: 100% 0.3em, 100% 0.3em, calc(100% + 0.6em) 100%, 100% calc(100% + 0.6em); border: none; border-left: 0.3em solid #5bf390; border-right: 0.3em solid #ff4cff; padding: 1em 1.5em; overflow: hidden; position: relative; font-size: 1em; margin-bottom: 1em; transition: all 0.4s;
}
.fancy-button:hover:before, .fancy-button:hover:after, .fancy-button:active:before, .fancy-button:active:after { transform: translateX(0);
}
.fancy-button:before, .fancy-button:after { content: ''; display: block; position: absolute; z-index: -1; width: 100%; height: 100%; top: 0; left: 0; background-repeat: no-repeat; background-size: 100% calc(100% - 0.6em); background-position: 50% 0.3em; transition: all 0.4s;
}
.fancy-button:before { background-image: linear-gradient(-60deg, transparent 0%, transparent 50%, #5bf390 50%, #5bf390 100%); transform: translateX(calc(-100% + 41.6%));
}
.fancy-button:after { background-image: linear-gradient(120deg, transparent 0%, transparent 50%, #ff4cff 50%, #ff4cff 100%); transform: translateX(calc(100% - 41.6%));
}
.fancy-button:hover { color: white;
}
html { font-size: 30px; font-family: 'Lato', 'brandon grotesque', 'gotham', futura, helvetica, sans-serif; padding: 1em; text-align: center;
}
button { appearance: none; background-color: transparent; border: none; font-family: 'Lato', 'brandon grotesque', 'gotham', futura, helvetica, sans-serif; outline: none !important;
}
h4 { margin-bottom: 1em;
}
h6 { font-size: 0.6em;
}
Developer | Eli Fitch |
Username | elifitch |
Uploaded | October 28, 2022 |
Rating | 4.5 |
Size | 4,109 Kb |
Views | 12,144 |
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!
Name | Size |
Diagonal gradient fill button | 4,860 Kb |
SVG hamburger menu button | 2,602 Kb |
Cube of cubes | 6,112 Kb |
Mars | 3,817 Kb |
Animated SVG Hexagon | 3,470 Kb |
Flexslider thumbnail modification | 13,431 Kb |
Animated multi-line underline | 3,247 Kb |
3D Retro Wave Spin | 5,825 Kb |
Batman Middle Finger | 3,152 Kb |
Neon slicey cube | 5,020 Kb |
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!
Name | Username | Size |
Simple Linear Regression with Editable Table | Melatonind | 3,264 Kb |
Font stack | Adrianjacob | 1,868 Kb |
CSS3 keyframe onload animation. | Samueljseay | 1,706 Kb |
Lightrays v2 | Sinthetyc | 2,903 Kb |
Right Click Menu | Anodpixels | 2,252 Kb |
STAR WARS LIGHTSABER | Francoiscoron | 4,420 Kb |
Svg penguin | _massimo | 2,990 Kb |
Calculator - codevember 08 - 2016 | Caiocares | 3,260 Kb |
Sass random color animation | Jotavejv | 4,827 Kb |
Custom checkbox example | Capelo | 3,495 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!