SVG icon theming
How do I make an svg icon theming?
Trying to recreate Adobe Photoshop's icons in SVG and alter the colors using CSS.. What is a svg icon theming? How do you make a svg icon theming? This script and codes were developed by Jon Graft on 30 January 2023, Monday.
SVG icon theming - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>SVG icon theming</title> <script src="https://s.codepen.io/assets/libs/modernizr.js" type="text/javascript"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <link rel='stylesheet prefetch' href='https://fonts.googleapis.com/css?family=Open+Sans'> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div style="height: 100%; width: 100%;"> <div class="col1"> <h1>Light Theme</h1> <hr /> <!-- CROP --> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" enable-background="new 0 0 32 32"> <defs> <linearGradient id="dark" gradientUnits="userSpaceOnUse" y1="32" x2="0" y2="2"> <stop stop-color="#A6AFB7"/> <stop offset="1" stop-color="#DCE0E3"/> </linearGradient> <linearGradient id="light" gradientUnits="userSpaceOnUse" y1="32" x2="0" y2="2"> <stop stop-color="#2A2F34"/> <stop offset="1" stop-color="#4D575F"/> </linearGradient> </defs> <path class="icon" d="M11,8V2H7v6H1v4h6v14h14v6h4v-6h6v-4h-6V8H11z M21,12v10H11V12H21z"/> <g class="shadow"> <path d="m11 6h14v2h-14z"/> <path d="m11 20h10v2h-10z"/> <path d="m25 20h6v2h-6z"/> <path d="m7 0h4v2h-4z"/> <path d="m1 6h6v2h-6z"/> </g> <g class="shine"> <path d="m1 10h6v2h-6z"/> <path d="m7 24h14v2h-14z"/> <path d="m11 10h10v2h-10z"/> <path d="m25 24h6v2h-6z"/> <path d="m21 30h4v2h-4z"/> </g> </svg> <br /><br /> </div> <div class="col2"> <h1>Dark Theme</h1> <hr /> <!-- CROP --> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" enable-background="new 0 0 32 32"> <defs> <linearGradient id="dark" gradientUnits="userSpaceOnUse" y1="32" x2="0" y2="2"> <stop stop-color="#A6AFB7"/> <stop offset="1" stop-color="#DCE0E3"/> </linearGradient> <linearGradient id="light" gradientUnits="userSpaceOnUse" y1="32" x2="0" y2="2"> <stop stop-color="#2A2F34"/> <stop offset="1" stop-color="#4D575F"/> </linearGradient> </defs> <path class="icon" d="M11,8V2H7v6H1v4h6v14h14v6h4v-6h6v-4h-6V8H11z M21,12v10H11V12H21z"/> <g class="shadow"> <path d="m11 6h14v2h-14z"/> <path d="m11 20h10v2h-10z"/> <path d="m25 20h6v2h-6z"/> <path d="m7 0h4v2h-4z"/> <path d="m1 6h6v2h-6z"/> </g> <g class="shine"> <path d="m1 10h6v2h-6z"/> <path d="m7 24h14v2h-14z"/> <path d="m11 10h10v2h-10z"/> <path d="m25 24h6v2h-6z"/> <path d="m21 30h4v2h-4z"/> </g> </svg> <br /><br /> </div>
</div>
</body>
</html>
SVG icon theming - Script Codes CSS Codes
/* UNIVERSAL */
body {font-family: 'Open Sans', sans-serif;}
.col1, .col2 { width: 48%; height: 100%; padding: 0 10px;
}
.col1 { background-color: #A6AFB7; float: left;
}
.col2 { background-color: #4D575F; color: #FFFFFF; float: right;
}
svg { width: 32px; height: 32px;
}
/* Light Theme */
.col1 .icon{ fill: url(#light);
}
.col1 .shadow { fill: #EEF0F3 ; opacity: .45;
}
.col1 .shine { fill: #2A2F34; opacity: .5;
}
/* Dark Theme */
.col2 .icon{ fill: url(#dark);
}
.col2 .shadow { fill: #000; opacity: .35;
}
.col2 .shine { fill: #EEF0F3; opacity: .5;
}
Developer | Jon Graft |
Username | FlyersPh9 |
Uploaded | January 30, 2023 |
Rating | 3 |
Size | 2,268 Kb |
Views | 2,024 |
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 |
Bentley Systems Dropdown Menus | 3,163 Kb |
Pie Chart | 5,153 Kb |
Simple Social Buttons from Dribbble | 2,918 Kb |
User Profile in CSS | 3,047 Kb |
Bentley Systems Toggles | 2,468 Kb |
Bentley Systems Cards | 2,022 Kb |
A Pen by Jon Graft | 2,067 Kb |
Bentley Systems Progress Bar | 2,687 Kb |
Bentley Systems CSS Buttons | 2,630 Kb |
Bar Graph | 3,752 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 |
Sexy Social Buttons | Ipiyale | 2,226 Kb |
Highbrow Basic HTML Lesson 8 | Kimlarocca | 2,094 Kb |
Project Euler Problem 17 | Bfillmer | 2,739 Kb |
SVG Circle Progress | JMChristensen | 3,368 Kb |
Fluid Responsive Typography | Jonmilner | 4,205 Kb |
Brent Burns Tribute Page | Nevada48 | 2,569 Kb |
A bit of elegance | Hackthevoid | 9,095 Kb |
Console fun | Dviate | 1,500 Kb |
Easing | GreenSock | 2,043 Kb |
React JS Movie Info App | MTushar | 4,870 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!