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 |
Mars | 3,817 Kb |
Gradient Borders Mixin | 3,394 Kb |
Batman Middle Finger | 3,152 Kb |
SVG hamburger menu button | 2,602 Kb |
Canvas Hero Prototype | 3,070 Kb |
Animated multi-line underline | 3,247 Kb |
Diagonal gradient fill button | 4,860 Kb |
Node DC Animated SVG Logo | 4,055 Kb |
Smiley guy | 3,845 Kb |
Cube of cubes | 6,112 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 |
Basic jQuery Filter list | Mtedwards | 2,464 Kb |
A Pen by Oliver Schafeld | Schafeld | 1,720 Kb |
Tic Tac Toe | Volv | 4,862 Kb |
My Starter Kit For Codepen | Dkdesign | 2,012 Kb |
CSS Grid Overlay | Cliffpyles | 3,090 Kb |
Mini Profile | Frytyler | 3,828 Kb |
Waveform function for a siren tone modulation | Clafou | 1,656 Kb |
CSS3 Butterfly | Timohausmann | 3,430 Kb |
Avero - Collectieve LVVP Arbeidsongeschiktheidsverzekering - CSS - som | Frederiquebonink | 12,554 Kb |
Wip elementary os navbar | Nickcolley | 2,993 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!