Experiment - SCSS SVG Background Image with Variables
How do I make an experiment - scss svg background image with variables?
Working through some solutions to make these work, especially the hover transition in example #1. Any input/suggestions welcome.. What is a experiment - scss svg background image with variables? How do you make a experiment - scss svg background image with variables? This script and codes were developed by Chris Holder on 20 June 2022, Monday.
Experiment - SCSS SVG Background Image with Variables - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Experiment - SCSS SVG Background Image with Variables</title> <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! */ [class*="ex-"] { width: 100%; height: 400px; border: 1px solid #ccc; margin: 10px 0;
}
/*
// SVG
// Kinda Works! But needs to be much much smoother.
*/
.ex-1, p { transition: all 1s ease-in-out;
}
.ex-1 { background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="15px" height="15px"><rect fill="#3498db" width="7.5" height="7.5"/><rect fill="white" x="7.5" width="7.5" height="7.5"/><rect fill="white" y="7.5" width="7.5" height="7.5"/><rect fill="#b6daf2" x="7.5" y="7.5" width="7.5" height="7.5"/></svg>');
}
.ex-1 p { background: #e74c3c; width: 50%; margin: 150px auto; padding: 20px 0; text-align: center; color: white; font-family: sans-serif; font-size: 13px; font-weight: bold; box-shadow: 4px 4px 0 0 #c0392b;
}
.ex-1:hover { background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="152px" height="152px"><rect fill="#2ecc71" width="76" height="76"/><rect fill="white" x="76" width="76" height="76"/><rect fill="white" y="76" width="76" height="76"/><rect fill="#a8ebc4" x="76" y="76" width="76" height="76"/></svg>');
}
.ex-1:hover p { background: #9b59b6; box-shadow: 4px 4px 0 0 #8e44ad;
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <div class="examples"> <div class="ex-1"><p>HOVER ME</p></div>
</div>
</body>
</html>
Experiment - SCSS SVG Background Image with Variables - Script Codes CSS Codes
[class*="ex-"] { width: 100%; height: 400px; border: 1px solid #ccc; margin: 10px 0;
}
/*
// SVG
// Kinda Works! But needs to be much much smoother.
*/
.ex-1, p { transition: all 1s ease-in-out;
}
.ex-1 { background: url('data:image/svg+xml;utf8,');
}
.ex-1 p { background: #e74c3c; width: 50%; margin: 150px auto; padding: 20px 0; text-align: center; color: white; font-family: sans-serif; font-size: 13px; font-weight: bold; box-shadow: 4px 4px 0 0 #c0392b;
}
.ex-1:hover { background: url('data:image/svg+xml;utf8,');
}
.ex-1:hover p { background: #9b59b6; box-shadow: 4px 4px 0 0 #8e44ad;
}
Developer | Chris Holder |
Username | see8ch |
Uploaded | June 20, 2022 |
Rating | 3 |
Size | 3,270 Kb |
Views | 58,696 |
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 |
GSchool Workshop Demo - Winter 2015 | 2,017 Kb |
Readable typography mixin - auto line height | 2,827 Kb |
Contact Form Template | 5,229 Kb |
Localhost Directory GUI | 3,997 Kb |
My Logo | 2,811 Kb |
Styling Placeholders with a mixin | 4,205 Kb |
GSchool Workshop Demo - Winter 2015 | 3,433 Kb |
Northerli Logo | 5,477 Kb |
One from many. | 2,423 Kb |
DevCamp 2014 - Denver Public Library | 5,033 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 |
A Pen by Alex Bergin | Abergin | 3,347 Kb |
Formations | Cantelope | 5,731 Kb |
Brown by pure CSS, no image, no javascript | Aaronchuo | 2,652 Kb |
Pure CSS Torch Light | Juliendargelos | 2,727 Kb |
CardMove | Thompsonemerson | 3,699 Kb |
Colorful Sliders | Chanrith | 1,246 Kb |
Css3 slide | Nakome | 3,190 Kb |
Plotting Points with D3.js | Laurakelly | 31,996 Kb |
SVG Icons Template | Legofsalmon | 2,618 Kb |
Adding and Removing Element | Accimeesterlin | 2,119 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!