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;
}
![SVG icon theming - Script Codes](http://shots.codepen.io/FlyersPh9/pen/wBbLry-512.jpg)
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 CSS Buttons | 2,630 Kb |
Pie Chart | 5,153 Kb |
Bentley Systems Toggles | 2,468 Kb |
Bentley Systems Progress Bar | 2,687 Kb |
Simple Social Buttons from Dribbble | 2,918 Kb |
A Pen by Jon Graft | 2,067 Kb |
Bentley Systems Cards | 2,022 Kb |
SVG icon theming | 2,268 Kb |
User Profile in CSS | 3,047 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 |
GrcJS | Vino6 | 2,047 Kb |
Social buttons | Flacu | 2,022 Kb |
Flexbox playground | Enxaneta | 5,418 Kb |
Learning canvas drawing | Aurer | 2,204 Kb |
Apple website | Jds317 | 1,835 Kb |
Resize image | Happyhj | 1,892 Kb |
Page Transitions in Backbone | Mikefowler | 3,691 Kb |
Freecodecamp - Tribute Page | Samoht513 | 3,583 Kb |
A Pen by Manoz | Manoz | 2,424 Kb |
A Pen by Moeid Saleem | Moeidsaleem | 1,862 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!